SCSI: remove LBDATA/PBDATA from the WriteSame10/16 signatures

Make LBA the third argument to the iscsi writesame functions
This commit is contained in:
Ronnie Sahlberg
2013-01-21 21:15:37 -08:00
parent 9bf6a3d68b
commit 0f73f062d2
18 changed files with 170 additions and 129 deletions

View File

@@ -750,18 +750,16 @@ iscsi_verify16_task(struct iscsi_context *iscsi, int lun,
int blocksize, iscsi_command_cb cb,
void *private_data);
EXTERN struct scsi_task *
iscsi_writesame10_task(struct iscsi_context *iscsi, int lun,
iscsi_writesame10_task(struct iscsi_context *iscsi, int lun, uint32_t lba,
unsigned char *data, uint32_t datalen,
uint32_t lba, uint16_t num_blocks,
int anchor, int unmap, int pbdata, int lbdata,
int wrprotect, int group,
uint16_t num_blocks,
int anchor, int unmap, int wrprotect, int group,
iscsi_command_cb cb, void *private_data);
EXTERN struct scsi_task *
iscsi_writesame16_task(struct iscsi_context *iscsi, int lun,
iscsi_writesame16_task(struct iscsi_context *iscsi, int lun, uint64_t lba,
unsigned char *data, uint32_t datalen,
uint64_t lba, uint32_t num_blocks,
int anchor, int unmap, int pbdata, int lbdata,
int wrprotect, int group,
uint32_t num_blocks,
int anchor, int unmap, int wrprotect, int group,
iscsi_command_cb cb, void *private_data);
EXTERN struct scsi_task *
iscsi_modesense6_task(struct iscsi_context *iscsi, int lun, int dbd,
@@ -943,18 +941,16 @@ iscsi_verify16_sync(struct iscsi_context *iscsi, int lun,
int blocksize);
EXTERN struct scsi_task *
iscsi_writesame10_sync(struct iscsi_context *iscsi, int lun,
iscsi_writesame10_sync(struct iscsi_context *iscsi, int lun, uint32_t lba,
unsigned char *data, uint32_t datalen,
uint32_t lba, uint16_t num_blocks,
int anchor, int unmap, int pbdata, int lbdata,
int wrprotect, int group);
uint16_t num_blocks,
int anchor, int unmap, int wrprotect, int group);
EXTERN struct scsi_task *
iscsi_writesame16_sync(struct iscsi_context *iscsi, int lun,
iscsi_writesame16_sync(struct iscsi_context *iscsi, int lun, uint64_t lba,
unsigned char *data, uint32_t datalen,
uint64_t lba, uint32_t num_blocks,
int anchor, int unmap, int pbdata, int lbdata,
int wrprotect, int group);
uint32_t num_blocks,
int anchor, int unmap, int wrprotect, int group);
EXTERN struct scsi_task *
iscsi_persistent_reserve_in_sync(struct iscsi_context *iscsi, int lun,

View File

@@ -792,8 +792,8 @@ EXTERN struct scsi_task *scsi_cdb_get_lba_status(uint64_t starting_lba, uint32_t
EXTERN struct scsi_task *scsi_cdb_unmap(int anchor, int group, uint16_t xferlen);
EXTERN struct scsi_task *scsi_cdb_persistent_reserve_in(enum scsi_persistent_in_sa sa, uint16_t xferlen);
EXTERN struct scsi_task *scsi_cdb_persistent_reserve_out(enum scsi_persistent_out_sa sa, enum scsi_persistent_out_scope scope, enum scsi_persistent_out_type type, void *params);
EXTERN struct scsi_task *scsi_cdb_writesame10(int wrprotect, int anchor, int unmap, int pbdata, int lbdata, uint32_t lba, int group, uint16_t num_blocks);
EXTERN struct scsi_task *scsi_cdb_writesame16(int wrprotect, int anchor, int unmap, int pbdata, int lbdata, uint64_t lba, int group, uint32_t num_blocks);
EXTERN struct scsi_task *scsi_cdb_writesame10(int wrprotect, int anchor, int unmap, uint32_t lba, int group, uint16_t num_blocks);
EXTERN struct scsi_task *scsi_cdb_writesame16(int wrprotect, int anchor, int unmap, uint64_t lba, int group, uint32_t num_blocks);
EXTERN struct scsi_task *scsi_cdb_prefetch10(uint32_t lba, int num_blocks, int immed, int group);
EXTERN struct scsi_task *scsi_cdb_prefetch16(uint64_t lba, int num_blocks, int immed, int group);
EXTERN struct scsi_task *scsi_cdb_report_supported_opcodes(int report_timeouts, uint32_t alloc_len);

View File

@@ -1349,17 +1349,16 @@ iscsi_prefetch16_task(struct iscsi_context *iscsi, int lun, uint64_t lba,
}
struct scsi_task *
iscsi_writesame10_task(struct iscsi_context *iscsi, int lun,
iscsi_writesame10_task(struct iscsi_context *iscsi, int lun, uint32_t lba,
unsigned char *data, uint32_t datalen,
uint32_t lba, uint16_t num_blocks,
int anchor, int unmap, int pbdata, int lbdata,
int wrprotect, int group,
uint16_t num_blocks,
int anchor, int unmap, int wrprotect, int group,
iscsi_command_cb cb, void *private_data)
{
struct scsi_task *task;
struct iscsi_data d;
task = scsi_cdb_writesame10(wrprotect, anchor, unmap, pbdata, lbdata, lba, group, num_blocks);
task = scsi_cdb_writesame10(wrprotect, anchor, unmap, lba, group, num_blocks);
if (task == NULL) {
iscsi_set_error(iscsi, "Out-of-memory: Failed to create "
"writesame10 cdb.");
@@ -1384,17 +1383,16 @@ iscsi_writesame10_task(struct iscsi_context *iscsi, int lun,
}
struct scsi_task *
iscsi_writesame16_task(struct iscsi_context *iscsi, int lun,
iscsi_writesame16_task(struct iscsi_context *iscsi, int lun, uint64_t lba,
unsigned char *data, uint32_t datalen,
uint64_t lba, uint32_t num_blocks,
int anchor, int unmap, int pbdata, int lbdata,
int wrprotect, int group,
uint32_t num_blocks,
int anchor, int unmap, int wrprotect, int group,
iscsi_command_cb cb, void *private_data)
{
struct scsi_task *task;
struct iscsi_data d;
task = scsi_cdb_writesame16(wrprotect, anchor, unmap, pbdata, lbdata, lba, group, num_blocks);
task = scsi_cdb_writesame16(wrprotect, anchor, unmap, lba, group, num_blocks);
if (task == NULL) {
iscsi_set_error(iscsi, "Out-of-memory: Failed to create "
"writesame16 cdb.");

View File

@@ -1873,7 +1873,7 @@ scsi_cdb_persistent_reserve_out(enum scsi_persistent_out_sa sa, enum scsi_persis
* WRITE_SAME10
*/
struct scsi_task *
scsi_cdb_writesame10(int wrprotect, int anchor, int unmap, int pbdata, int lbdata, uint32_t lba, int group, uint16_t num_blocks)
scsi_cdb_writesame10(int wrprotect, int anchor, int unmap, uint32_t lba, int group, uint16_t num_blocks)
{
struct scsi_task *task;
@@ -1894,12 +1894,6 @@ scsi_cdb_writesame10(int wrprotect, int anchor, int unmap, int pbdata, int lbdat
if (unmap) {
task->cdb[1] |= 0x08;
}
if (pbdata) {
task->cdb[1] |= 0x04;
}
if (lbdata) {
task->cdb[1] |= 0x02;
}
scsi_set_uint32(&task->cdb[2], lba);
if (group) {
task->cdb[6] |= (group & 0x1f);
@@ -1917,7 +1911,7 @@ scsi_cdb_writesame10(int wrprotect, int anchor, int unmap, int pbdata, int lbdat
* WRITE_SAME16
*/
struct scsi_task *
scsi_cdb_writesame16(int wrprotect, int anchor, int unmap, int pbdata, int lbdata, uint64_t lba, int group, uint32_t num_blocks)
scsi_cdb_writesame16(int wrprotect, int anchor, int unmap, uint64_t lba, int group, uint32_t num_blocks)
{
struct scsi_task *task;
@@ -1938,12 +1932,6 @@ scsi_cdb_writesame16(int wrprotect, int anchor, int unmap, int pbdata, int lbdat
if (unmap) {
task->cdb[1] |= 0x08;
}
if (pbdata) {
task->cdb[1] |= 0x04;
}
if (lbdata) {
task->cdb[1] |= 0x02;
}
scsi_set_uint32(&task->cdb[2], lba >> 32);
scsi_set_uint32(&task->cdb[6], lba & 0xffffffff);
scsi_set_uint32(&task->cdb[10], num_blocks);

View File

@@ -747,21 +747,19 @@ iscsi_verify16_sync(struct iscsi_context *iscsi, int lun, unsigned char *data, u
}
struct scsi_task *
iscsi_writesame10_sync(struct iscsi_context *iscsi, int lun,
iscsi_writesame10_sync(struct iscsi_context *iscsi, int lun, uint32_t lba,
unsigned char *data, uint32_t datalen,
uint32_t lba, uint16_t num_blocks,
int anchor, int unmap, int pbdata, int lbdata,
int wrprotect, int group)
uint16_t num_blocks,
int anchor, int unmap, int wrprotect, int group)
{
struct iscsi_sync_state state;
memset(&state, 0, sizeof(state));
if (iscsi_writesame10_task(iscsi, lun, data, datalen,
lba, num_blocks,
anchor, unmap, pbdata, lbdata,
wrprotect, group,
scsi_sync_cb, &state) == NULL) {
if (iscsi_writesame10_task(iscsi, lun, lba,
data, datalen, num_blocks,
anchor, unmap, wrprotect, group,
scsi_sync_cb, &state) == NULL) {
iscsi_set_error(iscsi,
"Failed to send WRITESAME10 command");
return NULL;
@@ -773,21 +771,19 @@ iscsi_writesame10_sync(struct iscsi_context *iscsi, int lun,
}
struct scsi_task *
iscsi_writesame16_sync(struct iscsi_context *iscsi, int lun,
iscsi_writesame16_sync(struct iscsi_context *iscsi, int lun, uint64_t lba,
unsigned char *data, uint32_t datalen,
uint64_t lba, uint32_t num_blocks,
int anchor, int unmap, int pbdata, int lbdata,
int wrprotect, int group)
uint32_t num_blocks,
int anchor, int unmap, int wrprotect, int group)
{
struct iscsi_sync_state state;
memset(&state, 0, sizeof(state));
if (iscsi_writesame16_task(iscsi, lun, data, datalen,
lba, num_blocks,
anchor, unmap, pbdata, lbdata,
wrprotect, group,
scsi_sync_cb, &state) == NULL) {
if (iscsi_writesame16_task(iscsi, lun, lba,
data, datalen, num_blocks,
anchor, unmap, wrprotect, group,
scsi_sync_cb, &state) == NULL) {
iscsi_set_error(iscsi,
"Failed to send WRITESAME16 command");
return NULL;

View File

@@ -116,9 +116,10 @@ int T0180_writesame10_unmap(const char *initiator, const char *url)
if (lbpws10 == 1 && i % lbppb) {
continue;
}
task = iscsi_writesame10_sync(iscsi, lun, NULL, 0,
0, i,
0, 1, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, 0,
NULL, 0,
i,
0, 1, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));
@@ -171,9 +172,10 @@ int T0180_writesame10_unmap(const char *initiator, const char *url)
continue;
}
task = iscsi_writesame10_sync(iscsi, lun, NULL, 0,
num_blocks + 1 - i, i,
0, 1, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, num_blocks + 1 - i,
NULL, 0,
i,
0, 1, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));
@@ -206,9 +208,10 @@ int T0180_writesame10_unmap(const char *initiator, const char *url)
/* Test that UNMAP=0 and ANCHOR==1 fails with check condition */
printf("Try UNMAP==0 and ANCHOR==1 ... ");
task = iscsi_writesame10_sync(iscsi, lun, NULL, 0,
0, 64,
1, 0, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, 0,
NULL, 0,
64,
1, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));
@@ -236,9 +239,10 @@ int T0180_writesame10_unmap(const char *initiator, const char *url)
if (anc_sup == 0) {
printf("(ANC_SUP==0 so check condition expected) ");
}
task = iscsi_writesame10_sync(iscsi, lun, NULL, 0,
0, 64,
1, 1, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, 0,
NULL, 0,
64,
1, 1, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));

View File

@@ -65,9 +65,10 @@ int T0181_writesame10_unmap_unaligned(const char *initiator, const char *url)
/* unmap the first 1 - lbppb blocks at the start of the LUN */
printf("Unmapping first 1 - (LBPPB-1) blocks ... ");
for (i=1; i < lbppb; i++) {
task = iscsi_writesame10_sync(iscsi, lun, NULL, 0,
0, i,
0, 1, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, 0,
NULL, 0,
i,
0, 1, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));

View File

@@ -64,8 +64,10 @@ int T0182_writesame10_beyondeol(const char *initiator, const char *url)
/* write 1 - 256 blocks beyond the end of the device */
printf("Writing 1-256 blocks beyond end-of-device ... ");
for (i = 2; i <= 257; i++) {
task = iscsi_writesame10_sync(iscsi, lun, buf, block_size,
num_blocks, i, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, num_blocks,
buf, block_size,
i,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));
@@ -105,8 +107,10 @@ int T0182_writesame10_beyondeol(const char *initiator, const char *url)
/* writing 1 - 256 blocks at LBA 2^31 */
printf("Writing 1-256 blocks at LBA 2^31 ... ");
for (i = 1; i <= 256; i++) {
task = iscsi_writesame10_sync(iscsi, lun, buf, block_size,
0x80000000, i, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, 0x80000000,
buf, block_size,
i,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));
@@ -137,8 +141,10 @@ int T0182_writesame10_beyondeol(const char *initiator, const char *url)
/* write 1 - 256 blocks at LBA -1 */
printf("Writing 1-256 blocks at LBA -1 ... ");
for (i = 1; i <= 256; i++) {
task = iscsi_writesame10_sync(iscsi, lun, buf, block_size,
-1, i, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, -1,
buf, block_size,
i,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));

View File

@@ -56,8 +56,10 @@ int T0183_writesame10_wrprotect(const char *initiator, const char *url)
/* Writesame10 with wrprotect */
printf("WRITESAME10 with WRPROTECT ... ");
for (i = 1; i <= 7; i++) {
task = iscsi_writesame10_sync(iscsi, lun, buf, block_size,
0, 1, 0, 0, 0, 0, i, 0);
task = iscsi_writesame10_sync(iscsi, lun, 0,
buf, block_size,
1,
0, 0, i, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));

View File

@@ -55,8 +55,10 @@ int T0184_writesame10_0blocks(const char *initiator, const char *url)
ret = 0;
printf("Writesame10 0blocks at LBA:0 ... ");
task = iscsi_writesame10_sync(iscsi, lun, buf, block_size,
0, 0, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, 0,
buf, block_size,
0,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));
@@ -89,8 +91,10 @@ int T0184_writesame10_0blocks(const char *initiator, const char *url)
printf("LUN is too big, skipping test\n");
goto finished;
}
task = iscsi_writesame10_sync(iscsi, lun, buf, block_size,
num_blocks + 1, 0, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, num_blocks + 1,
buf, block_size,
0,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));
@@ -123,8 +127,10 @@ int T0184_writesame10_0blocks(const char *initiator, const char *url)
printf("LUN is too big, skipping test\n");
goto finished;
}
task = iscsi_writesame10_sync(iscsi, lun, buf, block_size,
0x80000000, 0, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, 0x80000000,
buf, block_size,
0,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));
@@ -157,8 +163,10 @@ int T0184_writesame10_0blocks(const char *initiator, const char *url)
printf("LUN is too big, skipping test\n");
goto finished;
}
task = iscsi_writesame10_sync(iscsi, lun, buf, block_size,
-1, 0, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, -1,
buf, block_size,
0,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));

View File

@@ -118,9 +118,10 @@ int T0190_writesame16_unmap(const char *initiator, const char *url)
if (lbpws == 1 && i % lbppb) {
continue;
}
task = iscsi_writesame16_sync(iscsi, lun, NULL, 0,
0, i,
0, 1, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, 0,
NULL, 0,
i,
0, 1, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));
@@ -173,9 +174,10 @@ int T0190_writesame16_unmap(const char *initiator, const char *url)
continue;
}
task = iscsi_writesame16_sync(iscsi, lun, NULL, 0,
num_blocks + 1 - i, i,
0, 1, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, num_blocks + 1 - i,
NULL, 0,
i,
0, 1, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));
@@ -208,9 +210,10 @@ int T0190_writesame16_unmap(const char *initiator, const char *url)
/* Test that UNMAP=0 and ANCHOR==1 fails with check condition */
printf("Try UNMAP==0 and ANCHOR==1 ... ");
task = iscsi_writesame16_sync(iscsi, lun, NULL, 0,
0, 64,
1, 0, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, 0,
NULL, 0,
64,
1, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));
@@ -235,9 +238,10 @@ int T0190_writesame16_unmap(const char *initiator, const char *url)
if (anc_sup == 0) {
printf("(ANC_SUP==0 so check condition expected) ");
}
task = iscsi_writesame16_sync(iscsi, lun, NULL, 0,
0, 64,
1, 1, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, 0,
NULL, 0,
64,
1, 1, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));

View File

@@ -64,9 +64,10 @@ int T0191_writesame16_unmap_unaligned(const char *initiator, const char *url)
/* unmap the first 1 - lbppb blocks at the start of the LUN */
printf("Unmapping first 1 - (LBPPB-1) blocks ... ");
for (i=1; i < lbppb; i++) {
task = iscsi_writesame16_sync(iscsi, lun, NULL, 0,
0, i,
0, 1, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, 0,
NULL, 0,
i,
0, 1, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));

View File

@@ -56,8 +56,10 @@ int T0192_writesame16_beyondeol(const char *initiator, const char *url)
/* write 1 - 256 blocks beyond the end of the device */
printf("Writing 1-256 blocks beyond end-of-device ... ");
for (i = 2; i <= 257; i++) {
task = iscsi_writesame16_sync(iscsi, lun, buf, block_size,
num_blocks, i, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, num_blocks,
buf, block_size,
i,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));
@@ -97,8 +99,10 @@ int T0192_writesame16_beyondeol(const char *initiator, const char *url)
/* writing 1 - 256 blocks at LBA 2^63 */
printf("Writing 1-256 blocks at LBA 2^63 ... ");
for (i = 1; i <= 256; i++) {
task = iscsi_writesame16_sync(iscsi, lun, buf, block_size,
0x8000000000000000ULL, i, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, 0x8000000000000000ULL,
buf, block_size,
i,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));
@@ -129,8 +133,10 @@ int T0192_writesame16_beyondeol(const char *initiator, const char *url)
/* write 1 - 256 blocks at LBA -1 */
printf("Writing 1-256 blocks at LBA -1 ... ");
for (i = 1; i <= 256; i++) {
task = iscsi_writesame16_sync(iscsi, lun, buf, block_size,
-1, i, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, -1,
buf, block_size,
i,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));

View File

@@ -55,8 +55,10 @@ int T0193_writesame16_wrprotect(const char *initiator, const char *url)
/* Writesame16 with wrprotect */
printf("WRITESAME16 with WRPROTECT ... ");
for (i = 1; i <= 7; i++) {
task = iscsi_writesame16_sync(iscsi, lun, buf, block_size,
0, 1, 0, 0, 0, 0, i, 0);
task = iscsi_writesame16_sync(iscsi, lun, 0,
buf, block_size,
1,
0, 0, i, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));

View File

@@ -55,8 +55,10 @@ int T0194_writesame16_0blocks(const char *initiator, const char *url)
ret = 0;
printf("Writesame16 0blocks at LBA:0 ... ");
task = iscsi_writesame16_sync(iscsi, lun, buf, block_size,
0, 0, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, 0,
buf, block_size,
0,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));
@@ -84,8 +86,10 @@ int T0194_writesame16_0blocks(const char *initiator, const char *url)
printf("Writesame16 0blocks at one block beyond <end-of-LUN> ... ");
task = iscsi_writesame16_sync(iscsi, lun, buf, block_size,
num_blocks + 1, 0, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, num_blocks + 1,
buf, block_size,
0,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));
@@ -113,8 +117,10 @@ int T0194_writesame16_0blocks(const char *initiator, const char *url)
printf("Writesame16 0blocks at LBA 2^63 ... ");
task = iscsi_writesame16_sync(iscsi, lun, buf, block_size,
0x8000000000000000, 0, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, 0x8000000000000000,
buf, block_size,
0,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));
@@ -142,8 +148,10 @@ int T0194_writesame16_0blocks(const char *initiator, const char *url)
printf("Writesame16 0blocks at LBA -1 ... ");
task = iscsi_writesame16_sync(iscsi, lun, buf, block_size,
-1, 0, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, -1,
buf, block_size,
0,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));

View File

@@ -196,7 +196,10 @@ int T0300_readonly(const char *initiator, const char *url)
/* Write one block at lba 0 */
printf("WRITESAME10 to LUN 0 ... ");
task = iscsi_writesame10_sync(iscsi, lun, data, block_size, 0, 1, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, 0,
data, block_size,
1,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));
@@ -225,7 +228,10 @@ int T0300_readonly(const char *initiator, const char *url)
/* Write one block at lba 0 */
printf("WRITESAME16 to LUN 0 ... ");
task = iscsi_writesame16_sync(iscsi, lun, data, block_size, 0, 1, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, 0,
data, block_size,
1,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));
@@ -258,7 +264,10 @@ int T0300_readonly(const char *initiator, const char *url)
printf("LUN is not thin-provisioned. [SKIPPED]\n");
goto finished;
}
task = iscsi_writesame10_sync(iscsi, lun, data, block_size, 0, 1, 0, 1, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, 0,
data, block_size,
1,
0, 1, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));
@@ -291,7 +300,10 @@ int T0300_readonly(const char *initiator, const char *url)
printf("LUN is not thin-provisioned. [SKIPPED]\n");
goto finished;
}
task = iscsi_writesame16_sync(iscsi, lun, data, block_size, 0, 1, 0, 1, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, 0,
data, block_size,
1,
0, 1, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));

View File

@@ -524,7 +524,10 @@ int T0370_nomedia(const char *initiator, const char *url)
printf("Test WRITESAME10 ... ");
task = iscsi_writesame10_sync(iscsi, lun, buf, block_size, 0, 1, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame10_sync(iscsi, lun, 0,
buf, block_size,
1,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME10 command: %s\n", iscsi_get_error(iscsi));
@@ -547,7 +550,10 @@ int T0370_nomedia(const char *initiator, const char *url)
printf("Test WRITESAME16 ... ");
task = iscsi_writesame16_sync(iscsi, lun, buf, block_size, 0, 1, 0, 0, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, 0,
buf, block_size,
1,
0, 0, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITESAME16 command: %s\n", iscsi_get_error(iscsi));

View File

@@ -251,7 +251,10 @@ int T0390_mandatory_opcodes_sbc(const char *initiator, const char *url)
if (lbpme == 0) {
printf("[LBPME == 0, SKIPPING TEST]\n");
} else {
task = iscsi_writesame16_sync(iscsi, lun, data, block_size, 0, 1, 0, 1, 0, 0, 0, 0);
task = iscsi_writesame16_sync(iscsi, lun, 0,
data, block_size,
1,
0, 1, 0, 0);
if (task == NULL) {
printf("[FAILED]\n");
printf("Failed to send WRITE SAME16 command: %s\n", iscsi_get_error(iscsi));