diff options
author | Andy Grover <agrover@redhat.com> | 2012-04-03 18:51:24 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-04-14 20:40:38 -0400 |
commit | ebf1d95ca297a06fe760177b614646dcec06abef (patch) | |
tree | 6ee7e2c5934ff0e7cd7e30b1e02590d0b4145406 /drivers/target/iscsi/iscsi_target_erl0.c | |
parent | 065ca1e42ffd74dd03cf60f61cead35934c91ed5 (diff) |
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>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_erl0.c')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_erl0.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/target/iscsi/iscsi_target_erl0.c b/drivers/target/iscsi/iscsi_target_erl0.c index dd11520eb8b4..1a02016ecdab 100644 --- a/drivers/target/iscsi/iscsi_target_erl0.c +++ b/drivers/target/iscsi/iscsi_target_erl0.c | |||
@@ -48,9 +48,9 @@ void iscsit_set_dataout_sequence_values( | |||
48 | if (cmd->unsolicited_data) { | 48 | if (cmd->unsolicited_data) { |
49 | cmd->seq_start_offset = cmd->write_data_done; | 49 | cmd->seq_start_offset = cmd->write_data_done; |
50 | cmd->seq_end_offset = (cmd->write_data_done + | 50 | cmd->seq_end_offset = (cmd->write_data_done + |
51 | (cmd->data_length > | 51 | (cmd->se_cmd.data_length > |
52 | conn->sess->sess_ops->FirstBurstLength) ? | 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 | return; | 54 | return; |
55 | } | 55 | } |
56 | 56 | ||
@@ -59,15 +59,15 @@ void iscsit_set_dataout_sequence_values( | |||
59 | 59 | ||
60 | if (!cmd->seq_start_offset && !cmd->seq_end_offset) { | 60 | if (!cmd->seq_start_offset && !cmd->seq_end_offset) { |
61 | cmd->seq_start_offset = cmd->write_data_done; | 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 | conn->sess->sess_ops->MaxBurstLength) ? | 63 | conn->sess->sess_ops->MaxBurstLength) ? |
64 | (cmd->write_data_done + | 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 | } else { | 66 | } else { |
67 | cmd->seq_start_offset = cmd->seq_end_offset; | 67 | cmd->seq_start_offset = cmd->seq_end_offset; |
68 | cmd->seq_end_offset = ((cmd->seq_end_offset + | 68 | cmd->seq_end_offset = ((cmd->seq_end_offset + |
69 | conn->sess->sess_ops->MaxBurstLength) >= | 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 | (cmd->seq_end_offset + | 71 | (cmd->seq_end_offset + |
72 | conn->sess->sess_ops->MaxBurstLength); | 72 | conn->sess->sess_ops->MaxBurstLength); |
73 | } | 73 | } |
@@ -182,13 +182,13 @@ static int iscsit_dataout_check_unsolicited_sequence( | |||
182 | if (!conn->sess->sess_ops->DataPDUInOrder) | 182 | if (!conn->sess->sess_ops->DataPDUInOrder) |
183 | goto out; | 183 | goto out; |
184 | 184 | ||
185 | if ((first_burst_len != cmd->data_length) && | 185 | if ((first_burst_len != cmd->se_cmd.data_length) && |
186 | (first_burst_len != conn->sess->sess_ops->FirstBurstLength)) { | 186 | (first_burst_len != conn->sess->sess_ops->FirstBurstLength)) { |
187 | pr_err("Unsolicited non-immediate data" | 187 | pr_err("Unsolicited non-immediate data" |
188 | " received %u does not equal FirstBurstLength: %u, and" | 188 | " received %u does not equal FirstBurstLength: %u, and" |
189 | " does not equal ExpXferLen %u.\n", first_burst_len, | 189 | " does not equal ExpXferLen %u.\n", first_burst_len, |
190 | conn->sess->sess_ops->FirstBurstLength, | 190 | conn->sess->sess_ops->FirstBurstLength, |
191 | cmd->data_length); | 191 | cmd->se_cmd.data_length); |
192 | transport_send_check_condition_and_sense(&cmd->se_cmd, | 192 | transport_send_check_condition_and_sense(&cmd->se_cmd, |
193 | TCM_INCORRECT_AMOUNT_OF_DATA, 0); | 193 | TCM_INCORRECT_AMOUNT_OF_DATA, 0); |
194 | return DATAOUT_CANNOT_RECOVER; | 194 | return DATAOUT_CANNOT_RECOVER; |
@@ -201,10 +201,10 @@ static int iscsit_dataout_check_unsolicited_sequence( | |||
201 | conn->sess->sess_ops->FirstBurstLength); | 201 | conn->sess->sess_ops->FirstBurstLength); |
202 | return DATAOUT_CANNOT_RECOVER; | 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 | pr_err("Command ITT: 0x%08x reached" | 205 | pr_err("Command ITT: 0x%08x reached" |
206 | " ExpXferLen: %u, but ISCSI_FLAG_CMD_FINAL is not set. protocol" | 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 | return DATAOUT_CANNOT_RECOVER; | 208 | return DATAOUT_CANNOT_RECOVER; |
209 | } | 209 | } |
210 | } | 210 | } |
@@ -294,7 +294,7 @@ static int iscsit_dataout_check_sequence( | |||
294 | if ((next_burst_len < | 294 | if ((next_burst_len < |
295 | conn->sess->sess_ops->MaxBurstLength) && | 295 | conn->sess->sess_ops->MaxBurstLength) && |
296 | ((cmd->write_data_done + payload_length) < | 296 | ((cmd->write_data_done + payload_length) < |
297 | cmd->data_length)) { | 297 | cmd->se_cmd.data_length)) { |
298 | pr_err("Command ITT: 0x%08x set ISCSI_FLAG_CMD_FINAL" | 298 | pr_err("Command ITT: 0x%08x set ISCSI_FLAG_CMD_FINAL" |
299 | " before end of DataOUT sequence, protocol" | 299 | " before end of DataOUT sequence, protocol" |
300 | " error.\n", cmd->init_task_tag); | 300 | " error.\n", cmd->init_task_tag); |
@@ -319,7 +319,7 @@ static int iscsit_dataout_check_sequence( | |||
319 | return DATAOUT_CANNOT_RECOVER; | 319 | return DATAOUT_CANNOT_RECOVER; |
320 | } | 320 | } |
321 | if ((cmd->write_data_done + payload_length) == | 321 | if ((cmd->write_data_done + payload_length) == |
322 | cmd->data_length) { | 322 | cmd->se_cmd.data_length) { |
323 | pr_err("Command ITT: 0x%08x reached" | 323 | pr_err("Command ITT: 0x%08x reached" |
324 | " last DataOUT PDU in sequence but ISCSI_FLAG_" | 324 | " last DataOUT PDU in sequence but ISCSI_FLAG_" |
325 | "CMD_FINAL is not set, protocol error.\n", | 325 | "CMD_FINAL is not set, protocol error.\n", |
@@ -640,7 +640,7 @@ static int iscsit_dataout_post_crc_passed( | |||
640 | 640 | ||
641 | cmd->write_data_done += payload_length; | 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 | return DATAOUT_SEND_TO_TRANSPORT; | 644 | return DATAOUT_SEND_TO_TRANSPORT; |
645 | else if (send_r2t) | 645 | else if (send_r2t) |
646 | return DATAOUT_SEND_R2T; | 646 | return DATAOUT_SEND_R2T; |