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

@@ -613,6 +613,16 @@ iscsi_modesense6_task(struct iscsi_context *iscsi, int lun, int dbd,
unsigned char alloc_len, iscsi_command_cb cb,
void *private_data);
struct unmap_list {
uint64_t lba;
uint32_t num;
};
EXTERN struct scsi_task *
iscsi_unmap_task(struct iscsi_context *iscsi, int lun, int anchor, int group,
struct unmap_list *list, int list_len,
iscsi_command_cb cb, void *private_data);
/*
* Sync commands for SCSI
@@ -662,6 +672,10 @@ iscsi_verify10_sync(struct iscsi_context *iscsi, int lun,
int vprotect, int dpo, int bytchk,
int blocksize);
EXTERN struct scsi_task *
iscsi_unmap_sync(struct iscsi_context *iscsi, int lun, int anchor, int group,
struct unmap_list *list, int list_len);
/*
* This function is used when the application wants to specify its own buffers to read the data
* from the DATA-IN PDUs into.