aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/st.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-22 22:11:06 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-22 22:11:06 -0400
commit69450bb5eb8e9df28281c62f98e971c9969dc4ff (patch)
tree85991e6e8b74cb08b5013fd7e419c3df67d23e35 /drivers/scsi/st.c
parente38f981758118d829cd40cfe9c09e3fa81e422aa (diff)
parentd6ec084200c37683278c821338f74ddf21ab80f5 (diff)
Merge branch 'sg' of git://git.kernel.dk/linux-2.6-block
* 'sg' of git://git.kernel.dk/linux-2.6-block: Add CONFIG_DEBUG_SG sg validation Change table chaining layout Update arch/ to use sg helpers Update swiotlb to use sg helpers Update net/ to use sg helpers Update fs/ to use sg helpers [SG] Update drivers to use sg helpers [SG] Update crypto/ to sg helpers [SG] Update block layer to use sg helpers [SG] Add helpers for manipulating SG entries
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);