diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-10-22 15:19:53 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-10-22 15:19:53 -0400 |
commit | 45711f1af6eff1a6d010703b4862e0d2b9afd056 (patch) | |
tree | 3d0048f46e3df9d217d56127462ebe680348bd5a /drivers/ata | |
parent | 78c2f0b8c285c5305b3e67b0595200541e15eb43 (diff) |
[SG] Update drivers to use sg helpers
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-core.c | 10 | ||||
-rw-r--r-- | drivers/ata/libata-scsi.c | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 629eadbd0ec0..69092bce1ada 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -4296,7 +4296,7 @@ void ata_sg_clean(struct ata_queued_cmd *qc) | |||
4296 | sg_last(sg, qc->orig_n_elem)->length += qc->pad_len; | 4296 | sg_last(sg, qc->orig_n_elem)->length += qc->pad_len; |
4297 | if (pad_buf) { | 4297 | if (pad_buf) { |
4298 | struct scatterlist *psg = &qc->pad_sgent; | 4298 | struct scatterlist *psg = &qc->pad_sgent; |
4299 | void *addr = kmap_atomic(psg->page, KM_IRQ0); | 4299 | void *addr = kmap_atomic(sg_page(psg), KM_IRQ0); |
4300 | memcpy(addr + psg->offset, pad_buf, qc->pad_len); | 4300 | memcpy(addr + psg->offset, pad_buf, qc->pad_len); |
4301 | kunmap_atomic(addr, KM_IRQ0); | 4301 | kunmap_atomic(addr, KM_IRQ0); |
4302 | } | 4302 | } |
@@ -4686,11 +4686,11 @@ static int ata_sg_setup(struct ata_queued_cmd *qc) | |||
4686 | * data in this function or read data in ata_sg_clean. | 4686 | * data in this function or read data in ata_sg_clean. |
4687 | */ | 4687 | */ |
4688 | offset = lsg->offset + lsg->length - qc->pad_len; | 4688 | offset = lsg->offset + lsg->length - qc->pad_len; |
4689 | psg->page = nth_page(lsg->page, offset >> PAGE_SHIFT); | 4689 | sg_set_page(psg, nth_page(sg_page(lsg), offset >> PAGE_SHIFT)); |
4690 | psg->offset = offset_in_page(offset); | 4690 | psg->offset = offset_in_page(offset); |
4691 | 4691 | ||
4692 | if (qc->tf.flags & ATA_TFLAG_WRITE) { | 4692 | if (qc->tf.flags & ATA_TFLAG_WRITE) { |
4693 | void *addr = kmap_atomic(psg->page, KM_IRQ0); | 4693 | void *addr = kmap_atomic(sg_page(psg), KM_IRQ0); |
4694 | memcpy(pad_buf, addr + psg->offset, qc->pad_len); | 4694 | memcpy(pad_buf, addr + psg->offset, qc->pad_len); |
4695 | kunmap_atomic(addr, KM_IRQ0); | 4695 | kunmap_atomic(addr, KM_IRQ0); |
4696 | } | 4696 | } |
@@ -4836,7 +4836,7 @@ static void ata_pio_sector(struct ata_queued_cmd *qc) | |||
4836 | if (qc->curbytes == qc->nbytes - qc->sect_size) | 4836 | if (qc->curbytes == qc->nbytes - qc->sect_size) |
4837 | ap->hsm_task_state = HSM_ST_LAST; | 4837 | ap->hsm_task_state = HSM_ST_LAST; |
4838 | 4838 | ||
4839 | page = qc->cursg->page; | 4839 | page = sg_page(qc->cursg); |
4840 | offset = qc->cursg->offset + qc->cursg_ofs; | 4840 | offset = qc->cursg->offset + qc->cursg_ofs; |
4841 | 4841 | ||
4842 | /* get the current page and offset */ | 4842 | /* get the current page and offset */ |
@@ -4988,7 +4988,7 @@ next_sg: | |||
4988 | 4988 | ||
4989 | sg = qc->cursg; | 4989 | sg = qc->cursg; |
4990 | 4990 | ||
4991 | page = sg->page; | 4991 | page = sg_page(sg); |
4992 | offset = sg->offset + qc->cursg_ofs; | 4992 | offset = sg->offset + qc->cursg_ofs; |
4993 | 4993 | ||
4994 | /* get the current page and offset */ | 4994 | /* get the current page and offset */ |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 9fbb39cd0f58..5b758b9ad0b8 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -1544,7 +1544,7 @@ static unsigned int ata_scsi_rbuf_get(struct scsi_cmnd *cmd, u8 **buf_out) | |||
1544 | struct scatterlist *sg = scsi_sglist(cmd); | 1544 | struct scatterlist *sg = scsi_sglist(cmd); |
1545 | 1545 | ||
1546 | if (sg) { | 1546 | if (sg) { |
1547 | buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset; | 1547 | buf = kmap_atomic(sg_page(sg), KM_IRQ0) + sg->offset; |
1548 | buflen = sg->length; | 1548 | buflen = sg->length; |
1549 | } else { | 1549 | } else { |
1550 | buf = NULL; | 1550 | buf = NULL; |