diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2007-05-30 13:57:15 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2007-06-01 12:58:22 -0400 |
commit | 857ae0bdb72999936a28ce621e38e2e288c485da (patch) | |
tree | cf1b9272c6c5bdb5448d016390bc2b07d435f5b3 /drivers/scsi/libiscsi.c | |
parent | d473cc7f15f64ab8a90c3d7288ef30f46785d8d5 (diff) |
[SCSI] iscsi: Some fixes in preparation for bidirectional support - total_length
- Remove shadow of request length from struct iscsi_cmd_task.
- change all users to use scsi_cmnd->request_bufflen directly
(With bidi we will use scsi-ml API to retrieve in/out length)
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Cc: Roland Dreier <rdreier@cisco.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r-- | drivers/scsi/libiscsi.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index eb5113607958..0a9c64e9ce8b 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -147,19 +147,19 @@ static void iscsi_prep_scsi_cmd_pdu(struct iscsi_cmd_task *ctask) | |||
147 | ctask->unsol_datasn = 0; | 147 | ctask->unsol_datasn = 0; |
148 | 148 | ||
149 | if (session->imm_data_en) { | 149 | if (session->imm_data_en) { |
150 | if (ctask->total_length >= session->first_burst) | 150 | if (sc->request_bufflen >= session->first_burst) |
151 | ctask->imm_count = min(session->first_burst, | 151 | ctask->imm_count = min(session->first_burst, |
152 | conn->max_xmit_dlength); | 152 | conn->max_xmit_dlength); |
153 | else | 153 | else |
154 | ctask->imm_count = min(ctask->total_length, | 154 | ctask->imm_count = min(sc->request_bufflen, |
155 | conn->max_xmit_dlength); | 155 | conn->max_xmit_dlength); |
156 | hton24(ctask->hdr->dlength, ctask->imm_count); | 156 | hton24(ctask->hdr->dlength, ctask->imm_count); |
157 | } else | 157 | } else |
158 | zero_data(ctask->hdr->dlength); | 158 | zero_data(ctask->hdr->dlength); |
159 | 159 | ||
160 | if (!session->initial_r2t_en) { | 160 | if (!session->initial_r2t_en) { |
161 | ctask->unsol_count = min(session->first_burst, | 161 | ctask->unsol_count = min((session->first_burst), |
162 | ctask->total_length) - ctask->imm_count; | 162 | (sc->request_bufflen)) - ctask->imm_count; |
163 | ctask->unsol_offset = ctask->imm_count; | 163 | ctask->unsol_offset = ctask->imm_count; |
164 | } | 164 | } |
165 | 165 | ||
@@ -815,7 +815,6 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) | |||
815 | ctask->conn = conn; | 815 | ctask->conn = conn; |
816 | ctask->sc = sc; | 816 | ctask->sc = sc; |
817 | INIT_LIST_HEAD(&ctask->running); | 817 | INIT_LIST_HEAD(&ctask->running); |
818 | ctask->total_length = sc->request_bufflen; | ||
819 | iscsi_prep_scsi_cmd_pdu(ctask); | 818 | iscsi_prep_scsi_cmd_pdu(ctask); |
820 | 819 | ||
821 | session->tt->init_cmd_task(ctask); | 820 | session->tt->init_cmd_task(ctask); |