Libiscsi: add support for EXTENDED COPY
Build on existing scsi_cdb_extended_copy() functionality. This operation can be used to offload inter and intra LU copies to the target. The API is rather primitive, in that the caller needs to construct the parameter buffer, including CSCD and segment descriptor lists, etc. Signed-off-by: David Disseldorp <ddiss@suse.de>
This commit is contained in:
@@ -2634,6 +2634,29 @@ iscsi_receive_copy_results_task(struct iscsi_context *iscsi, int lun,
|
||||
return task;
|
||||
}
|
||||
|
||||
struct scsi_task *
|
||||
iscsi_extended_copy_task(struct iscsi_context *iscsi, int lun,
|
||||
struct iscsi_data *param_data,
|
||||
iscsi_command_cb cb, void *private_data)
|
||||
{
|
||||
struct scsi_task *task;
|
||||
|
||||
task = scsi_cdb_extended_copy(param_data->size);
|
||||
if (task == NULL) {
|
||||
iscsi_set_error(iscsi, "Out-of-memory: Failed to create "
|
||||
"EXTENDED COPY cdb.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (iscsi_scsi_command_async(iscsi, lun, task, cb,
|
||||
param_data, private_data) != 0) {
|
||||
scsi_free_scsi_task(task);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return task;
|
||||
}
|
||||
|
||||
struct scsi_task *
|
||||
iscsi_scsi_get_task_from_pdu(struct iscsi_pdu *pdu)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user