Add support for UNMAP command and add a simple test for this opcode

This commit is contained in:
Ronnie Sahlberg
2012-04-22 08:09:15 +10:00
parent d71a9d4f95
commit dd5f94b2ca
10 changed files with 260 additions and 2 deletions

View File

@@ -361,6 +361,26 @@ iscsi_verify10_sync(struct iscsi_context *iscsi, int lun, unsigned char *data, u
return state.task;
}
struct scsi_task *
iscsi_unmap_sync(struct iscsi_context *iscsi, int lun, int anchor, int group,
struct unmap_list *list, int list_len)
{
struct iscsi_sync_state state;
memset(&state, 0, sizeof(state));
if (iscsi_unmap_task(iscsi, lun, anchor, group, list, list_len,
scsi_sync_cb, &state) == NULL) {
iscsi_set_error(iscsi,
"Failed to send UNMAP 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)