diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2007-07-16 09:24:14 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-10-16 05:21:00 -0400 |
commit | e0eaf8882879ee2118ae830f6999cc4a71deb9ac (patch) | |
tree | e8281ef033aadb8824f85e9879055d5bdbd5c735 /drivers/scsi/ips.c | |
parent | 55c16a70041ba55e235c5944dccb9c1de0dd3ca6 (diff) |
ips: sg chaining support
ips properly uses scsi_for_each_sg for the normal I/O path, however,
the breakup path doesn't.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/scsi/ips.c')
-rw-r--r-- | drivers/scsi/ips.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index 2ed099e2c20d..edaac2714c5a 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c | |||
@@ -3252,7 +3252,7 @@ ips_done(ips_ha_t * ha, ips_scb_t * scb) | |||
3252 | */ | 3252 | */ |
3253 | if ((scb->breakup) || (scb->sg_break)) { | 3253 | if ((scb->breakup) || (scb->sg_break)) { |
3254 | struct scatterlist *sg; | 3254 | struct scatterlist *sg; |
3255 | int sg_dma_index, ips_sg_index = 0; | 3255 | int i, sg_dma_index, ips_sg_index = 0; |
3256 | 3256 | ||
3257 | /* we had a data breakup */ | 3257 | /* we had a data breakup */ |
3258 | scb->data_len = 0; | 3258 | scb->data_len = 0; |
@@ -3261,20 +3261,22 @@ ips_done(ips_ha_t * ha, ips_scb_t * scb) | |||
3261 | 3261 | ||
3262 | /* Spin forward to last dma chunk */ | 3262 | /* Spin forward to last dma chunk */ |
3263 | sg_dma_index = scb->breakup; | 3263 | sg_dma_index = scb->breakup; |
3264 | for (i = 0; i < scb->breakup; i++) | ||
3265 | sg = sg_next(sg); | ||
3264 | 3266 | ||
3265 | /* Take care of possible partial on last chunk */ | 3267 | /* Take care of possible partial on last chunk */ |
3266 | ips_fill_scb_sg_single(ha, | 3268 | ips_fill_scb_sg_single(ha, |
3267 | sg_dma_address(&sg[sg_dma_index]), | 3269 | sg_dma_address(sg), |
3268 | scb, ips_sg_index++, | 3270 | scb, ips_sg_index++, |
3269 | sg_dma_len(&sg[sg_dma_index])); | 3271 | sg_dma_len(sg)); |
3270 | 3272 | ||
3271 | for (; sg_dma_index < scsi_sg_count(scb->scsi_cmd); | 3273 | for (; sg_dma_index < scsi_sg_count(scb->scsi_cmd); |
3272 | sg_dma_index++) { | 3274 | sg_dma_index++, sg = sg_next(sg)) { |
3273 | if (ips_fill_scb_sg_single | 3275 | if (ips_fill_scb_sg_single |
3274 | (ha, | 3276 | (ha, |
3275 | sg_dma_address(&sg[sg_dma_index]), | 3277 | sg_dma_address(sg), |
3276 | scb, ips_sg_index++, | 3278 | scb, ips_sg_index++, |
3277 | sg_dma_len(&sg[sg_dma_index])) < 0) | 3279 | sg_dma_len(sg)) < 0) |
3278 | break; | 3280 | break; |
3279 | } | 3281 | } |
3280 | 3282 | ||