提交 e0eaf888 编写于 作者: F FUJITA Tomonori 提交者: Jens Axboe

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: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
上级 55c16a70
...@@ -3252,7 +3252,7 @@ ips_done(ips_ha_t * ha, ips_scb_t * scb) ...@@ -3252,7 +3252,7 @@ ips_done(ips_ha_t * ha, ips_scb_t * scb)
*/ */
if ((scb->breakup) || (scb->sg_break)) { if ((scb->breakup) || (scb->sg_break)) {
struct scatterlist *sg; struct scatterlist *sg;
int sg_dma_index, ips_sg_index = 0; int i, sg_dma_index, ips_sg_index = 0;
/* we had a data breakup */ /* we had a data breakup */
scb->data_len = 0; scb->data_len = 0;
...@@ -3261,20 +3261,22 @@ ips_done(ips_ha_t * ha, ips_scb_t * scb) ...@@ -3261,20 +3261,22 @@ ips_done(ips_ha_t * ha, ips_scb_t * scb)
/* Spin forward to last dma chunk */ /* Spin forward to last dma chunk */
sg_dma_index = scb->breakup; sg_dma_index = scb->breakup;
for (i = 0; i < scb->breakup; i++)
sg = sg_next(sg);
/* Take care of possible partial on last chunk */ /* Take care of possible partial on last chunk */
ips_fill_scb_sg_single(ha, ips_fill_scb_sg_single(ha,
sg_dma_address(&sg[sg_dma_index]), sg_dma_address(sg),
scb, ips_sg_index++, scb, ips_sg_index++,
sg_dma_len(&sg[sg_dma_index])); sg_dma_len(sg));
for (; sg_dma_index < scsi_sg_count(scb->scsi_cmd); for (; sg_dma_index < scsi_sg_count(scb->scsi_cmd);
sg_dma_index++) { sg_dma_index++, sg = sg_next(sg)) {
if (ips_fill_scb_sg_single if (ips_fill_scb_sg_single
(ha, (ha,
sg_dma_address(&sg[sg_dma_index]), sg_dma_address(sg),
scb, ips_sg_index++, scb, ips_sg_index++,
sg_dma_len(&sg[sg_dma_index])) < 0) sg_dma_len(sg)) < 0)
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册