add sync write10

This commit is contained in:
Ronnie Sahlberg
2011-09-29 22:01:53 +10:00
parent ad7651006d
commit 2f23773390
3 changed files with 26 additions and 0 deletions

View File

@@ -633,6 +633,11 @@ EXTERN struct scsi_task *
iscsi_synchronizecache10_sync(struct iscsi_context *iscsi, int lun, int lba,
int num_blocks, int syncnv, int immed);
EXTERN struct scsi_task *
iscsi_write10_sync(struct iscsi_context *iscsi, int lun,
unsigned char *data, uint32_t datalen, uint32_t lba, int fua,
int fuanv, int blocksize);
/*
* This function is used when the application wants to specify its own buffers to read the data

View File

@@ -56,6 +56,7 @@ iscsi_readcapacity10_sync
iscsi_synchronizecache10_sync
iscsi_read6_sync
iscsi_read10_sync
iscsi_write10_sync
iscsi_task_cancel
poll
scsi_task_add_data_in_buffer

View File

@@ -302,6 +302,26 @@ iscsi_synchronizecache10_sync(struct iscsi_context *iscsi, int lun, int lba,
return state.task;
}
struct scsi_task *
iscsi_write10_sync(struct iscsi_context *iscsi, int lun, unsigned char *data, uint32_t datalen, uint32_t lba,
int fua, int fuanv, int blocksize)
{
struct iscsi_sync_state state;
memset(&state, 0, sizeof(state));
if (iscsi_write10_task(iscsi, lun, data, datalen, lba, fua, fuanv, blocksize,
scsi_sync_cb, &state) == NULL) {
iscsi_set_error(iscsi,
"Failed to send Write10 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)