aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/st.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-10-22 15:19:53 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-10-22 15:19:53 -0400
commit45711f1af6eff1a6d010703b4862e0d2b9afd056 (patch)
tree3d0048f46e3df9d217d56127462ebe680348bd5a /drivers/scsi/st.c
parent78c2f0b8c285c5305b3e67b0595200541e15eb43 (diff)
[SG] Update drivers to use sg helpers
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/scsi/st.c')
-rw-r--r--drivers/scsi/st.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 73c44cbdea47..ce69b9efc102 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -3797,7 +3797,7 @@ static void buf_to_sg(struct st_buffer *STbp, unsigned int length)
3797 sg = &(STbp->sg[0]); 3797 sg = &(STbp->sg[0]);
3798 frp = STbp->frp; 3798 frp = STbp->frp;
3799 for (i=count=0; count < length; i++) { 3799 for (i=count=0; count < length; i++) {
3800 sg[i].page = frp[i].page; 3800 sg_set_page(&sg[i], frp[i].page);
3801 if (length - count > frp[i].length) 3801 if (length - count > frp[i].length)
3802 sg[i].length = frp[i].length; 3802 sg[i].length = frp[i].length;
3803 else 3803 else
@@ -4446,14 +4446,14 @@ static int sgl_map_user_pages(struct scatterlist *sgl, const unsigned int max_pa
4446 } 4446 }
4447 4447
4448 /* Populate the scatter/gather list */ 4448 /* Populate the scatter/gather list */
4449 sgl[0].page = pages[0]; 4449 sg_set_page(&sgl[0], pages[0]);
4450 sgl[0].offset = uaddr & ~PAGE_MASK; 4450 sgl[0].offset = uaddr & ~PAGE_MASK;
4451 if (nr_pages > 1) { 4451 if (nr_pages > 1) {
4452 sgl[0].length = PAGE_SIZE - sgl[0].offset; 4452 sgl[0].length = PAGE_SIZE - sgl[0].offset;
4453 count -= sgl[0].length; 4453 count -= sgl[0].length;
4454 for (i=1; i < nr_pages ; i++) { 4454 for (i=1; i < nr_pages ; i++) {
4455 sg_set_page(&sgl[i], pages[i]);;
4455 sgl[i].offset = 0; 4456 sgl[i].offset = 0;
4456 sgl[i].page = pages[i];
4457 sgl[i].length = count < PAGE_SIZE ? count : PAGE_SIZE; 4457 sgl[i].length = count < PAGE_SIZE ? count : PAGE_SIZE;
4458 count -= PAGE_SIZE; 4458 count -= PAGE_SIZE;
4459 } 4459 }
@@ -4483,7 +4483,7 @@ static int sgl_unmap_user_pages(struct scatterlist *sgl, const unsigned int nr_p
4483 int i; 4483 int i;
4484 4484
4485 for (i=0; i < nr_pages; i++) { 4485 for (i=0; i < nr_pages; i++) {
4486 struct page *page = sgl[i].page; 4486 struct page *page = sg_page(&sgl[i]);
4487 4487
4488 if (dirtied) 4488 if (dirtied)
4489 SetPageDirty(page); 4489 SetPageDirty(page);