Add PREFETCH10/16 implementations
This commit is contained in:
@@ -924,6 +924,49 @@ iscsi_synchronizecache10_task(struct iscsi_context *iscsi, int lun, int lba,
|
||||
return task;
|
||||
}
|
||||
|
||||
struct scsi_task *
|
||||
iscsi_prefetch10_task(struct iscsi_context *iscsi, int lun, uint32_t lba,
|
||||
int num_blocks, int immed, int group,
|
||||
iscsi_command_cb cb, void *private_data)
|
||||
{
|
||||
struct scsi_task *task;
|
||||
|
||||
task = scsi_cdb_prefetch10(lba, num_blocks, immed, group);
|
||||
if (task == NULL) {
|
||||
iscsi_set_error(iscsi, "Out-of-memory: Failed to create "
|
||||
"prefetch10 cdb.");
|
||||
return NULL;
|
||||
}
|
||||
if (iscsi_scsi_command_async(iscsi, lun, task, cb, NULL,
|
||||
private_data) != 0) {
|
||||
scsi_free_scsi_task(task);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return task;
|
||||
}
|
||||
|
||||
struct scsi_task *
|
||||
iscsi_prefetch16_task(struct iscsi_context *iscsi, int lun, uint64_t lba,
|
||||
int num_blocks, int immed, int group,
|
||||
iscsi_command_cb cb, void *private_data)
|
||||
{
|
||||
struct scsi_task *task;
|
||||
|
||||
task = scsi_cdb_prefetch16(lba, num_blocks, immed, group);
|
||||
if (task == NULL) {
|
||||
iscsi_set_error(iscsi, "Out-of-memory: Failed to create "
|
||||
"prefetch16 cdb.");
|
||||
return NULL;
|
||||
}
|
||||
if (iscsi_scsi_command_async(iscsi, lun, task, cb, NULL,
|
||||
private_data) != 0) {
|
||||
scsi_free_scsi_task(task);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return task;
|
||||
}
|
||||
|
||||
struct scsi_task *
|
||||
iscsi_writesame10_task(struct iscsi_context *iscsi, int lun,
|
||||
|
||||
Reference in New Issue
Block a user