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:
20
lib/sync.c
20
lib/sync.c
@@ -1687,6 +1687,26 @@ iscsi_receive_copy_results_sync(struct iscsi_context *iscsi, int lun,
|
||||
return state.task;
|
||||
}
|
||||
|
||||
struct scsi_task *
|
||||
iscsi_extended_copy_sync(struct iscsi_context *iscsi, int lun,
|
||||
struct iscsi_data *param_data)
|
||||
{
|
||||
struct iscsi_sync_state state;
|
||||
|
||||
memset(&state, 0, sizeof(state));
|
||||
|
||||
if (iscsi_extended_copy_task(iscsi, lun, param_data,
|
||||
scsi_sync_cb, &state) == NULL) {
|
||||
iscsi_set_error(iscsi, "Failed to send EXTENDED COPY"
|
||||
" command");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
event_loop(iscsi, &state);
|
||||
|
||||
return state.task;
|
||||
}
|
||||
|
||||
struct scsi_task *
|
||||
iscsi_scsi_command_sync(struct iscsi_context *iscsi, int lun,
|
||||
struct scsi_task *task, struct iscsi_data *data)
|
||||
|
||||
Reference in New Issue
Block a user