Commit ebf1d95ca297a06fe760177b614646dcec06abef
Committed by
Nicholas Bellinger
1 parent
065ca1e42f
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
target/iscsi: Eliminate iscsi_cmd.data_length
Redundant, just use iscsi_cmd->se_cmd.data_length once se_cmd is initialized, or hdr->data_length before then. Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Showing 8 changed files with 60 additions and 67 deletions Side-by-side Diff
- drivers/target/iscsi/iscsi_target.c
- drivers/target/iscsi/iscsi_target_core.h
- drivers/target/iscsi/iscsi_target_datain_values.c
- drivers/target/iscsi/iscsi_target_erl0.c
- drivers/target/iscsi/iscsi_target_erl1.c
- drivers/target/iscsi/iscsi_target_seq_pdu_list.c
- drivers/target/iscsi/iscsi_target_tmr.c
- drivers/target/iscsi/iscsi_target_util.c
drivers/target/iscsi/iscsi_target.c
... | ... | @@ -968,7 +968,6 @@ |
968 | 968 | buf, conn); |
969 | 969 | |
970 | 970 | cmd->data_direction = data_direction; |
971 | - cmd->data_length = hdr->data_length; | |
972 | 971 | iscsi_task_attr = hdr->flags & ISCSI_FLAG_CMD_ATTR_MASK; |
973 | 972 | /* |
974 | 973 | * Figure out the SAM Task Attribute for the incoming SCSI CDB |
... | ... | @@ -1026,7 +1025,7 @@ |
1026 | 1025 | * Initialize struct se_cmd descriptor from target_core_mod infrastructure |
1027 | 1026 | */ |
1028 | 1027 | transport_init_se_cmd(&cmd->se_cmd, &lio_target_fabric_configfs->tf_ops, |
1029 | - conn->sess->se_sess, cmd->data_length, cmd->data_direction, | |
1028 | + conn->sess->se_sess, hdr->data_length, cmd->data_direction, | |
1030 | 1029 | sam_task_attr, &cmd->sense_buffer[0]); |
1031 | 1030 | |
1032 | 1031 | pr_debug("Got SCSI Command, ITT: 0x%08x, CmdSN: 0x%08x," |
... | ... | @@ -1061,8 +1060,6 @@ |
1061 | 1060 | */ |
1062 | 1061 | send_check_condition = 1; |
1063 | 1062 | } else { |
1064 | - cmd->data_length = cmd->se_cmd.data_length; | |
1065 | - | |
1066 | 1063 | if (iscsit_decide_list_to_build(cmd, payload_length) < 0) |
1067 | 1064 | return iscsit_add_reject_from_cmd( |
1068 | 1065 | ISCSI_REASON_BOOKMARK_NO_RESOURCES, |
1069 | 1066 | |
... | ... | @@ -1329,10 +1326,10 @@ |
1329 | 1326 | se_cmd = &cmd->se_cmd; |
1330 | 1327 | iscsit_mod_dataout_timer(cmd); |
1331 | 1328 | |
1332 | - if ((hdr->offset + payload_length) > cmd->data_length) { | |
1329 | + if ((hdr->offset + payload_length) > cmd->se_cmd.data_length) { | |
1333 | 1330 | pr_err("DataOut Offset: %u, Length %u greater than" |
1334 | 1331 | " iSCSI Command EDTL %u, protocol error.\n", |
1335 | - hdr->offset, payload_length, cmd->data_length); | |
1332 | + hdr->offset, payload_length, cmd->se_cmd.data_length); | |
1336 | 1333 | return iscsit_add_reject_from_cmd(ISCSI_REASON_BOOKMARK_INVALID, |
1337 | 1334 | 1, 0, buf, cmd); |
1338 | 1335 | } |
... | ... | @@ -2427,7 +2424,7 @@ |
2427 | 2424 | |
2428 | 2425 | cmd->write_data_done += length; |
2429 | 2426 | |
2430 | - if (cmd->write_data_done == cmd->data_length) { | |
2427 | + if (cmd->write_data_done == cmd->se_cmd.data_length) { | |
2431 | 2428 | spin_lock_bh(&cmd->istate_lock); |
2432 | 2429 | cmd->cmd_flags |= ICF_GOT_LAST_DATAOUT; |
2433 | 2430 | cmd->i_state = ISTATE_RECEIVED_LAST_DATAOUT; |
2434 | 2431 | |
... | ... | @@ -2559,11 +2556,11 @@ |
2559 | 2556 | /* |
2560 | 2557 | * Be paranoid and double check the logic for now. |
2561 | 2558 | */ |
2562 | - if ((datain.offset + datain.length) > cmd->data_length) { | |
2559 | + if ((datain.offset + datain.length) > cmd->se_cmd.data_length) { | |
2563 | 2560 | pr_err("Command ITT: 0x%08x, datain.offset: %u and" |
2564 | 2561 | " datain.length: %u exceeds cmd->data_length: %u\n", |
2565 | 2562 | cmd->init_task_tag, datain.offset, datain.length, |
2566 | - cmd->data_length); | |
2563 | + cmd->se_cmd.data_length); | |
2567 | 2564 | return -1; |
2568 | 2565 | } |
2569 | 2566 | |
... | ... | @@ -3071,8 +3068,8 @@ |
3071 | 3068 | conn->sess->sess_ops->MaxBurstLength - |
3072 | 3069 | cmd->next_burst_len; |
3073 | 3070 | |
3074 | - if (new_data_end > cmd->data_length) | |
3075 | - xfer_len = cmd->data_length - offset; | |
3071 | + if (new_data_end > cmd->se_cmd.data_length) | |
3072 | + xfer_len = cmd->se_cmd.data_length - offset; | |
3076 | 3073 | else |
3077 | 3074 | xfer_len = |
3078 | 3075 | conn->sess->sess_ops->MaxBurstLength - |
3079 | 3076 | |
... | ... | @@ -3081,14 +3078,14 @@ |
3081 | 3078 | int new_data_end = offset + |
3082 | 3079 | conn->sess->sess_ops->MaxBurstLength; |
3083 | 3080 | |
3084 | - if (new_data_end > cmd->data_length) | |
3085 | - xfer_len = cmd->data_length - offset; | |
3081 | + if (new_data_end > cmd->se_cmd.data_length) | |
3082 | + xfer_len = cmd->se_cmd.data_length - offset; | |
3086 | 3083 | else |
3087 | 3084 | xfer_len = conn->sess->sess_ops->MaxBurstLength; |
3088 | 3085 | } |
3089 | 3086 | cmd->r2t_offset += xfer_len; |
3090 | 3087 | |
3091 | - if (cmd->r2t_offset == cmd->data_length) | |
3088 | + if (cmd->r2t_offset == cmd->se_cmd.data_length) | |
3092 | 3089 | cmd->cmd_flags |= ICF_SENT_LAST_R2T; |
3093 | 3090 | } else { |
3094 | 3091 | struct iscsi_seq *seq; |
drivers/target/iscsi/iscsi_target_core.h
... | ... | @@ -380,8 +380,6 @@ |
380 | 380 | u32 buf_ptr_size; |
381 | 381 | /* Used to store DataDigest */ |
382 | 382 | u32 data_crc; |
383 | - /* Total size in bytes associated with command */ | |
384 | - u32 data_length; | |
385 | 383 | /* Counter for MaxOutstandingR2T */ |
386 | 384 | u32 outstanding_r2ts; |
387 | 385 | /* Next R2T Offset when DataSequenceInOrder=Yes */ |
drivers/target/iscsi/iscsi_target_datain_values.c
... | ... | @@ -110,7 +110,7 @@ |
110 | 110 | read_data_done = (!dr->recovery) ? |
111 | 111 | cmd->read_data_done : dr->read_data_done; |
112 | 112 | |
113 | - read_data_left = (cmd->data_length - read_data_done); | |
113 | + read_data_left = (cmd->se_cmd.data_length - read_data_done); | |
114 | 114 | if (!read_data_left) { |
115 | 115 | pr_err("ITT: 0x%08x read_data_left is zero!\n", |
116 | 116 | cmd->init_task_tag); |
... | ... | @@ -209,7 +209,7 @@ |
209 | 209 | seq_send_order = (!dr->recovery) ? |
210 | 210 | cmd->seq_send_order : dr->seq_send_order; |
211 | 211 | |
212 | - read_data_left = (cmd->data_length - read_data_done); | |
212 | + read_data_left = (cmd->se_cmd.data_length - read_data_done); | |
213 | 213 | if (!read_data_left) { |
214 | 214 | pr_err("ITT: 0x%08x read_data_left is zero!\n", |
215 | 215 | cmd->init_task_tag); |
... | ... | @@ -228,8 +228,8 @@ |
228 | 228 | offset = (seq->offset + seq->next_burst_len); |
229 | 229 | |
230 | 230 | if ((offset + conn->conn_ops->MaxRecvDataSegmentLength) >= |
231 | - cmd->data_length) { | |
232 | - datain->length = (cmd->data_length - offset); | |
231 | + cmd->se_cmd.data_length) { | |
232 | + datain->length = (cmd->se_cmd.data_length - offset); | |
233 | 233 | datain->offset = offset; |
234 | 234 | |
235 | 235 | datain->flags |= ISCSI_FLAG_CMD_FINAL; |
... | ... | @@ -261,7 +261,7 @@ |
261 | 261 | } |
262 | 262 | } |
263 | 263 | |
264 | - if ((read_data_done + datain->length) == cmd->data_length) | |
264 | + if ((read_data_done + datain->length) == cmd->se_cmd.data_length) | |
265 | 265 | datain->flags |= ISCSI_FLAG_DATA_STATUS; |
266 | 266 | |
267 | 267 | datain->data_sn = (!dr->recovery) ? cmd->data_sn++ : dr->data_sn++; |
... | ... | @@ -330,7 +330,7 @@ |
330 | 330 | read_data_done = (!dr->recovery) ? |
331 | 331 | cmd->read_data_done : dr->read_data_done; |
332 | 332 | |
333 | - read_data_left = (cmd->data_length - read_data_done); | |
333 | + read_data_left = (cmd->se_cmd.data_length - read_data_done); | |
334 | 334 | if (!read_data_left) { |
335 | 335 | pr_err("ITT: 0x%08x read_data_left is zero!\n", |
336 | 336 | cmd->init_task_tag); |
... | ... | @@ -341,7 +341,7 @@ |
341 | 341 | if (!pdu) |
342 | 342 | return dr; |
343 | 343 | |
344 | - if ((read_data_done + pdu->length) == cmd->data_length) { | |
344 | + if ((read_data_done + pdu->length) == cmd->se_cmd.data_length) { | |
345 | 345 | pdu->flags |= (ISCSI_FLAG_CMD_FINAL | ISCSI_FLAG_DATA_STATUS); |
346 | 346 | if (conn->sess->sess_ops->ErrorRecoveryLevel > 0) |
347 | 347 | pdu->flags |= ISCSI_FLAG_DATA_ACK; |
... | ... | @@ -430,7 +430,7 @@ |
430 | 430 | seq_send_order = (!dr->recovery) ? |
431 | 431 | cmd->seq_send_order : dr->seq_send_order; |
432 | 432 | |
433 | - read_data_left = (cmd->data_length - read_data_done); | |
433 | + read_data_left = (cmd->se_cmd.data_length - read_data_done); | |
434 | 434 | if (!read_data_left) { |
435 | 435 | pr_err("ITT: 0x%08x read_data_left is zero!\n", |
436 | 436 | cmd->init_task_tag); |
... | ... | @@ -460,7 +460,7 @@ |
460 | 460 | } else |
461 | 461 | seq->next_burst_len += pdu->length; |
462 | 462 | |
463 | - if ((read_data_done + pdu->length) == cmd->data_length) | |
463 | + if ((read_data_done + pdu->length) == cmd->se_cmd.data_length) | |
464 | 464 | pdu->flags |= ISCSI_FLAG_DATA_STATUS; |
465 | 465 | |
466 | 466 | pdu->data_sn = (!dr->recovery) ? cmd->data_sn++ : dr->data_sn++; |
drivers/target/iscsi/iscsi_target_erl0.c
... | ... | @@ -48,9 +48,9 @@ |
48 | 48 | if (cmd->unsolicited_data) { |
49 | 49 | cmd->seq_start_offset = cmd->write_data_done; |
50 | 50 | cmd->seq_end_offset = (cmd->write_data_done + |
51 | - (cmd->data_length > | |
51 | + (cmd->se_cmd.data_length > | |
52 | 52 | conn->sess->sess_ops->FirstBurstLength) ? |
53 | - conn->sess->sess_ops->FirstBurstLength : cmd->data_length); | |
53 | + conn->sess->sess_ops->FirstBurstLength : cmd->se_cmd.data_length); | |
54 | 54 | return; |
55 | 55 | } |
56 | 56 | |
57 | 57 | |
58 | 58 | |
... | ... | @@ -59,15 +59,15 @@ |
59 | 59 | |
60 | 60 | if (!cmd->seq_start_offset && !cmd->seq_end_offset) { |
61 | 61 | cmd->seq_start_offset = cmd->write_data_done; |
62 | - cmd->seq_end_offset = (cmd->data_length > | |
62 | + cmd->seq_end_offset = (cmd->se_cmd.data_length > | |
63 | 63 | conn->sess->sess_ops->MaxBurstLength) ? |
64 | 64 | (cmd->write_data_done + |
65 | - conn->sess->sess_ops->MaxBurstLength) : cmd->data_length; | |
65 | + conn->sess->sess_ops->MaxBurstLength) : cmd->se_cmd.data_length; | |
66 | 66 | } else { |
67 | 67 | cmd->seq_start_offset = cmd->seq_end_offset; |
68 | 68 | cmd->seq_end_offset = ((cmd->seq_end_offset + |
69 | 69 | conn->sess->sess_ops->MaxBurstLength) >= |
70 | - cmd->data_length) ? cmd->data_length : | |
70 | + cmd->se_cmd.data_length) ? cmd->se_cmd.data_length : | |
71 | 71 | (cmd->seq_end_offset + |
72 | 72 | conn->sess->sess_ops->MaxBurstLength); |
73 | 73 | } |
74 | 74 | |
... | ... | @@ -182,13 +182,13 @@ |
182 | 182 | if (!conn->sess->sess_ops->DataPDUInOrder) |
183 | 183 | goto out; |
184 | 184 | |
185 | - if ((first_burst_len != cmd->data_length) && | |
185 | + if ((first_burst_len != cmd->se_cmd.data_length) && | |
186 | 186 | (first_burst_len != conn->sess->sess_ops->FirstBurstLength)) { |
187 | 187 | pr_err("Unsolicited non-immediate data" |
188 | 188 | " received %u does not equal FirstBurstLength: %u, and" |
189 | 189 | " does not equal ExpXferLen %u.\n", first_burst_len, |
190 | 190 | conn->sess->sess_ops->FirstBurstLength, |
191 | - cmd->data_length); | |
191 | + cmd->se_cmd.data_length); | |
192 | 192 | transport_send_check_condition_and_sense(&cmd->se_cmd, |
193 | 193 | TCM_INCORRECT_AMOUNT_OF_DATA, 0); |
194 | 194 | return DATAOUT_CANNOT_RECOVER; |
195 | 195 | |
... | ... | @@ -201,10 +201,10 @@ |
201 | 201 | conn->sess->sess_ops->FirstBurstLength); |
202 | 202 | return DATAOUT_CANNOT_RECOVER; |
203 | 203 | } |
204 | - if (first_burst_len == cmd->data_length) { | |
204 | + if (first_burst_len == cmd->se_cmd.data_length) { | |
205 | 205 | pr_err("Command ITT: 0x%08x reached" |
206 | 206 | " ExpXferLen: %u, but ISCSI_FLAG_CMD_FINAL is not set. protocol" |
207 | - " error.\n", cmd->init_task_tag, cmd->data_length); | |
207 | + " error.\n", cmd->init_task_tag, cmd->se_cmd.data_length); | |
208 | 208 | return DATAOUT_CANNOT_RECOVER; |
209 | 209 | } |
210 | 210 | } |
... | ... | @@ -294,7 +294,7 @@ |
294 | 294 | if ((next_burst_len < |
295 | 295 | conn->sess->sess_ops->MaxBurstLength) && |
296 | 296 | ((cmd->write_data_done + payload_length) < |
297 | - cmd->data_length)) { | |
297 | + cmd->se_cmd.data_length)) { | |
298 | 298 | pr_err("Command ITT: 0x%08x set ISCSI_FLAG_CMD_FINAL" |
299 | 299 | " before end of DataOUT sequence, protocol" |
300 | 300 | " error.\n", cmd->init_task_tag); |
... | ... | @@ -319,7 +319,7 @@ |
319 | 319 | return DATAOUT_CANNOT_RECOVER; |
320 | 320 | } |
321 | 321 | if ((cmd->write_data_done + payload_length) == |
322 | - cmd->data_length) { | |
322 | + cmd->se_cmd.data_length) { | |
323 | 323 | pr_err("Command ITT: 0x%08x reached" |
324 | 324 | " last DataOUT PDU in sequence but ISCSI_FLAG_" |
325 | 325 | "CMD_FINAL is not set, protocol error.\n", |
... | ... | @@ -640,7 +640,7 @@ |
640 | 640 | |
641 | 641 | cmd->write_data_done += payload_length; |
642 | 642 | |
643 | - if (cmd->write_data_done == cmd->data_length) | |
643 | + if (cmd->write_data_done == cmd->se_cmd.data_length) | |
644 | 644 | return DATAOUT_SEND_TO_TRANSPORT; |
645 | 645 | else if (send_r2t) |
646 | 646 | return DATAOUT_SEND_R2T; |
drivers/target/iscsi/iscsi_target_erl1.c
... | ... | @@ -1116,8 +1116,8 @@ |
1116 | 1116 | if (cmd->unsolicited_data) { |
1117 | 1117 | *offset = 0; |
1118 | 1118 | *length = (conn->sess->sess_ops->FirstBurstLength > |
1119 | - cmd->data_length) ? | |
1120 | - cmd->data_length : | |
1119 | + cmd->se_cmd.data_length) ? | |
1120 | + cmd->se_cmd.data_length : | |
1121 | 1121 | conn->sess->sess_ops->FirstBurstLength; |
1122 | 1122 | return 0; |
1123 | 1123 | } |
... | ... | @@ -1188,8 +1188,8 @@ |
1188 | 1188 | if (conn->sess->sess_ops->DataPDUInOrder) { |
1189 | 1189 | pdu_offset = cmd->write_data_done; |
1190 | 1190 | if ((pdu_offset + (conn->sess->sess_ops->MaxBurstLength - |
1191 | - cmd->next_burst_len)) > cmd->data_length) | |
1192 | - pdu_length = (cmd->data_length - | |
1191 | + cmd->next_burst_len)) > cmd->se_cmd.data_length) | |
1192 | + pdu_length = (cmd->se_cmd.data_length - | |
1193 | 1193 | cmd->write_data_done); |
1194 | 1194 | else |
1195 | 1195 | pdu_length = (conn->sess->sess_ops->MaxBurstLength - |
drivers/target/iscsi/iscsi_target_seq_pdu_list.c
... | ... | @@ -226,11 +226,10 @@ |
226 | 226 | |
227 | 227 | if ((bl->type == PDULIST_UNSOLICITED) || |
228 | 228 | (bl->type == PDULIST_IMMEDIATE_AND_UNSOLICITED)) |
229 | - unsolicited_data_length = (cmd->data_length > | |
230 | - conn->sess->sess_ops->FirstBurstLength) ? | |
231 | - conn->sess->sess_ops->FirstBurstLength : cmd->data_length; | |
229 | + unsolicited_data_length = min(cmd->se_cmd.data_length, | |
230 | + conn->sess->sess_ops->FirstBurstLength); | |
232 | 231 | |
233 | - while (offset < cmd->data_length) { | |
232 | + while (offset < cmd->se_cmd.data_length) { | |
234 | 233 | *pdu_count += 1; |
235 | 234 | |
236 | 235 | if (check_immediate) { |
237 | 236 | |
... | ... | @@ -244,10 +243,10 @@ |
244 | 243 | } |
245 | 244 | if (unsolicited_data_length > 0) { |
246 | 245 | if ((offset + conn->conn_ops->MaxRecvDataSegmentLength) |
247 | - >= cmd->data_length) { | |
246 | + >= cmd->se_cmd.data_length) { | |
248 | 247 | unsolicited_data_length -= |
249 | - (cmd->data_length - offset); | |
250 | - offset += (cmd->data_length - offset); | |
248 | + (cmd->se_cmd.data_length - offset); | |
249 | + offset += (cmd->se_cmd.data_length - offset); | |
251 | 250 | continue; |
252 | 251 | } |
253 | 252 | if ((offset + conn->conn_ops->MaxRecvDataSegmentLength) |
... | ... | @@ -268,8 +267,8 @@ |
268 | 267 | continue; |
269 | 268 | } |
270 | 269 | if ((offset + conn->conn_ops->MaxRecvDataSegmentLength) >= |
271 | - cmd->data_length) { | |
272 | - offset += (cmd->data_length - offset); | |
270 | + cmd->se_cmd.data_length) { | |
271 | + offset += (cmd->se_cmd.data_length - offset); | |
273 | 272 | continue; |
274 | 273 | } |
275 | 274 | if ((burstlength + conn->conn_ops->MaxRecvDataSegmentLength) >= |
276 | 275 | |
... | ... | @@ -311,11 +310,10 @@ |
311 | 310 | |
312 | 311 | if ((bl->type == PDULIST_UNSOLICITED) || |
313 | 312 | (bl->type == PDULIST_IMMEDIATE_AND_UNSOLICITED)) |
314 | - unsolicited_data_length = (cmd->data_length > | |
315 | - conn->sess->sess_ops->FirstBurstLength) ? | |
316 | - conn->sess->sess_ops->FirstBurstLength : cmd->data_length; | |
313 | + unsolicited_data_length = min(cmd->se_cmd.data_length, | |
314 | + conn->sess->sess_ops->FirstBurstLength); | |
317 | 315 | |
318 | - while (offset < cmd->data_length) { | |
316 | + while (offset < cmd->se_cmd.data_length) { | |
319 | 317 | pdu_count++; |
320 | 318 | if (!datapduinorder) { |
321 | 319 | pdu[i].offset = offset; |
322 | 320 | |
323 | 321 | |
324 | 322 | |
... | ... | @@ -351,21 +349,21 @@ |
351 | 349 | if (unsolicited_data_length > 0) { |
352 | 350 | if ((offset + |
353 | 351 | conn->conn_ops->MaxRecvDataSegmentLength) >= |
354 | - cmd->data_length) { | |
352 | + cmd->se_cmd.data_length) { | |
355 | 353 | if (!datapduinorder) { |
356 | 354 | pdu[i].type = PDUTYPE_UNSOLICITED; |
357 | 355 | pdu[i].length = |
358 | - (cmd->data_length - offset); | |
356 | + (cmd->se_cmd.data_length - offset); | |
359 | 357 | } |
360 | 358 | if (!datasequenceinorder) { |
361 | 359 | seq[seq_no].type = SEQTYPE_UNSOLICITED; |
362 | 360 | seq[seq_no].pdu_count = pdu_count; |
363 | 361 | seq[seq_no].xfer_len = (burstlength + |
364 | - (cmd->data_length - offset)); | |
362 | + (cmd->se_cmd.data_length - offset)); | |
365 | 363 | } |
366 | 364 | unsolicited_data_length -= |
367 | - (cmd->data_length - offset); | |
368 | - offset += (cmd->data_length - offset); | |
365 | + (cmd->se_cmd.data_length - offset); | |
366 | + offset += (cmd->se_cmd.data_length - offset); | |
369 | 367 | continue; |
370 | 368 | } |
371 | 369 | if ((offset + |
372 | 370 | |
373 | 371 | |
374 | 372 | |
... | ... | @@ -407,18 +405,18 @@ |
407 | 405 | continue; |
408 | 406 | } |
409 | 407 | if ((offset + conn->conn_ops->MaxRecvDataSegmentLength) >= |
410 | - cmd->data_length) { | |
408 | + cmd->se_cmd.data_length) { | |
411 | 409 | if (!datapduinorder) { |
412 | 410 | pdu[i].type = PDUTYPE_NORMAL; |
413 | - pdu[i].length = (cmd->data_length - offset); | |
411 | + pdu[i].length = (cmd->se_cmd.data_length - offset); | |
414 | 412 | } |
415 | 413 | if (!datasequenceinorder) { |
416 | 414 | seq[seq_no].type = SEQTYPE_NORMAL; |
417 | 415 | seq[seq_no].pdu_count = pdu_count; |
418 | 416 | seq[seq_no].xfer_len = (burstlength + |
419 | - (cmd->data_length - offset)); | |
417 | + (cmd->se_cmd.data_length - offset)); | |
420 | 418 | } |
421 | - offset += (cmd->data_length - offset); | |
419 | + offset += (cmd->se_cmd.data_length - offset); | |
422 | 420 | continue; |
423 | 421 | } |
424 | 422 | if ((burstlength + conn->conn_ops->MaxRecvDataSegmentLength) >= |
drivers/target/iscsi/iscsi_target_tmr.c
... | ... | @@ -269,9 +269,9 @@ |
269 | 269 | offset = cmd->next_burst_len = cmd->write_data_done; |
270 | 270 | |
271 | 271 | if ((conn->sess->sess_ops->FirstBurstLength - offset) >= |
272 | - cmd->data_length) { | |
272 | + cmd->se_cmd.data_length) { | |
273 | 273 | no_build_r2ts = 1; |
274 | - length = (cmd->data_length - offset); | |
274 | + length = (cmd->se_cmd.data_length - offset); | |
275 | 275 | } else |
276 | 276 | length = (conn->sess->sess_ops->FirstBurstLength - offset); |
277 | 277 |
drivers/target/iscsi/iscsi_target_util.c
... | ... | @@ -379,14 +379,14 @@ |
379 | 379 | if (!(hdr->flags & ISCSI_FLAG_CMD_FINAL)) |
380 | 380 | return 0; |
381 | 381 | |
382 | - if (((cmd->first_burst_len + payload_length) != cmd->data_length) && | |
382 | + if (((cmd->first_burst_len + payload_length) != cmd->se_cmd.data_length) && | |
383 | 383 | ((cmd->first_burst_len + payload_length) != |
384 | 384 | conn->sess->sess_ops->FirstBurstLength)) { |
385 | 385 | pr_err("Unsolicited non-immediate data received %u" |
386 | 386 | " does not equal FirstBurstLength: %u, and does" |
387 | 387 | " not equal ExpXferLen %u.\n", |
388 | 388 | (cmd->first_burst_len + payload_length), |
389 | - conn->sess->sess_ops->FirstBurstLength, cmd->data_length); | |
389 | + conn->sess->sess_ops->FirstBurstLength, cmd->se_cmd.data_length); | |
390 | 390 | transport_send_check_condition_and_sense(se_cmd, |
391 | 391 | TCM_INCORRECT_AMOUNT_OF_DATA, 0); |
392 | 392 | return -1; |