provide offset and tl to DataSync

This commit is contained in:
chessman
2019-06-27 19:23:13 +03:00
parent d13122d350
commit 0b1ffd5704
6 changed files with 26 additions and 7 deletions

View File

@@ -708,5 +708,19 @@ func SBCServiceAction(host int, cmd *api.SCSICommand) api.SAMStat {
* 5.19 - SYNCHRONIZE CACHE (16)
*/
func SBCSyncCache(host int, cmd *api.SCSICommand) api.SAMStat {
scb := cmd.SCB
lba := getSCSIReadWriteOffset(scb)
tl := getSCSIReadWriteCount(scb)
dev := cmd.Device
cmd.Offset = lba << dev.BlockShift
cmd.TL = tl << dev.BlockShift
err, key, asc := bsPerformCommand(dev.Storage, cmd)
if err != nil {
BuildSenseData(cmd, key, asc)
return api.SAMStatCheckCondition
}
return api.SAMStatGood
}