[SCSI] ips: sg chaining support to the path to non I/O commands
I overlooked ips_scmd_buf_write and ips_scmd_buf_read when I converted ips to use the data buffer accessors. ips is unlikely to use sg chaining (especially in this path) since a) this path is used only for non I/O commands (with little data transfer), b) ips's sg_tablesize is set to just 17. Thanks to Tim Pepper for testing this patch. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Mark Salyzyn <Mark_Salyzyn@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
This commit is contained in:
parent
cff2680643
commit
7e23ea4884
1 changed files with 10 additions and 8 deletions
|
@ -3510,15 +3510,16 @@ ips_scmd_buf_write(struct scsi_cmnd *scmd, void *data, unsigned int count)
|
||||||
struct scatterlist *sg = scsi_sglist(scmd);
|
struct scatterlist *sg = scsi_sglist(scmd);
|
||||||
|
|
||||||
for (i = 0, xfer_cnt = 0;
|
for (i = 0, xfer_cnt = 0;
|
||||||
(i < scsi_sg_count(scmd)) && (xfer_cnt < count); i++) {
|
(i < scsi_sg_count(scmd)) && (xfer_cnt < count);
|
||||||
min_cnt = min(count - xfer_cnt, sg[i].length);
|
i++, sg = sg_next(sg)) {
|
||||||
|
min_cnt = min(count - xfer_cnt, sg->length);
|
||||||
|
|
||||||
/* kmap_atomic() ensures addressability of the data buffer.*/
|
/* kmap_atomic() ensures addressability of the data buffer.*/
|
||||||
/* local_irq_save() protects the KM_IRQ0 address slot. */
|
/* local_irq_save() protects the KM_IRQ0 address slot. */
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
buffer = kmap_atomic(sg_page(&sg[i]), KM_IRQ0) + sg[i].offset;
|
buffer = kmap_atomic(sg_page(sg), KM_IRQ0) + sg->offset;
|
||||||
memcpy(buffer, &cdata[xfer_cnt], min_cnt);
|
memcpy(buffer, &cdata[xfer_cnt], min_cnt);
|
||||||
kunmap_atomic(buffer - sg[i].offset, KM_IRQ0);
|
kunmap_atomic(buffer - sg->offset, KM_IRQ0);
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
|
|
||||||
xfer_cnt += min_cnt;
|
xfer_cnt += min_cnt;
|
||||||
|
@ -3543,15 +3544,16 @@ ips_scmd_buf_read(struct scsi_cmnd *scmd, void *data, unsigned int count)
|
||||||
struct scatterlist *sg = scsi_sglist(scmd);
|
struct scatterlist *sg = scsi_sglist(scmd);
|
||||||
|
|
||||||
for (i = 0, xfer_cnt = 0;
|
for (i = 0, xfer_cnt = 0;
|
||||||
(i < scsi_sg_count(scmd)) && (xfer_cnt < count); i++) {
|
(i < scsi_sg_count(scmd)) && (xfer_cnt < count);
|
||||||
min_cnt = min(count - xfer_cnt, sg[i].length);
|
i++, sg = sg_next(sg)) {
|
||||||
|
min_cnt = min(count - xfer_cnt, sg->length);
|
||||||
|
|
||||||
/* kmap_atomic() ensures addressability of the data buffer.*/
|
/* kmap_atomic() ensures addressability of the data buffer.*/
|
||||||
/* local_irq_save() protects the KM_IRQ0 address slot. */
|
/* local_irq_save() protects the KM_IRQ0 address slot. */
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
buffer = kmap_atomic(sg_page(&sg[i]), KM_IRQ0) + sg[i].offset;
|
buffer = kmap_atomic(sg_page(sg), KM_IRQ0) + sg->offset;
|
||||||
memcpy(&cdata[xfer_cnt], buffer, min_cnt);
|
memcpy(&cdata[xfer_cnt], buffer, min_cnt);
|
||||||
kunmap_atomic(buffer - sg[i].offset, KM_IRQ0);
|
kunmap_atomic(buffer - sg->offset, KM_IRQ0);
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
|
|
||||||
xfer_cnt += min_cnt;
|
xfer_cnt += min_cnt;
|
||||||
|
|
Reference in a new issue