SBC: Add GET_LBA_STATUS support and simple test

This commit is contained in:
Ronnie Sahlberg
2012-05-30 18:41:12 +10:00
parent 6be4a82407
commit 812df62bfd
11 changed files with 266 additions and 8 deletions

View File

@@ -355,6 +355,25 @@ iscsi_readcapacity16_sync(struct iscsi_context *iscsi, int lun)
return state.task;
}
struct scsi_task *
iscsi_get_lba_status_sync(struct iscsi_context *iscsi, int lun, uint64_t starting_lba, uint32_t alloc_len)
{
struct iscsi_sync_state state;
memset(&state, 0, sizeof(state));
if (iscsi_get_lba_status_task(iscsi, lun, starting_lba, alloc_len,
scsi_sync_cb, &state) == NULL) {
iscsi_set_error(iscsi,
"Failed to send GetLbaStatus command");
return NULL;
}
event_loop(iscsi, &state);
return state.task;
}
struct scsi_task *
iscsi_synchronizecache10_sync(struct iscsi_context *iscsi, int lun, int lba,
int num_blocks, int syncnv, int immed)