aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFUJITA Tomonori2008-12-17 23:49:37 -0600
committerJames Bottomley2009-01-02 11:10:08 -0600
commit56c451f4b583ccdf80c9e676179c9cb49de86745 (patch)
tree7ad9daeafb88e3c4390bf7a2db0c203fe2642728 /block/blk-map.c
parente623ddb4e940b266adc77ba1cc28a3554aa90e79 (diff)
downloadkernel-common-56c451f4b583ccdf80c9e676179c9cb49de86745.tar.gz
kernel-common-56c451f4b583ccdf80c9e676179c9cb49de86745.tar.xz
kernel-common-56c451f4b583ccdf80c9e676179c9cb49de86745.zip
[SCSI] block: fix the partial mappings with struct rq_map_data
This fixes bio_copy_user_iov to properly handle the partial mappings with struct rq_map_data (which only sg uses for now but st and osst will shortly). It adds the offset member to struct rq_map_data and changes blk_rq_map_user to update it so that bio_copy_user_iov can add an appropriate page frame via bio_add_pc_page(). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'block/blk-map.c')
-rw-r--r--block/blk-map.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/blk-map.c b/block/blk-map.c
index 2990447f45e..c7e55b23a2b 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -150,6 +150,9 @@ int blk_rq_map_user(struct request_queue *q, struct request *rq,
150 bio = rq->bio; 150 bio = rq->bio;
151 bytes_read += ret; 151 bytes_read += ret;
152 ubuf += ret; 152 ubuf += ret;
153
154 if (map_data)
155 map_data->offset += ret;
153 } 156 }
154 157
155 if (!bio_flagged(bio, BIO_USER_MAPPED)) 158 if (!bio_flagged(bio, BIO_USER_MAPPED))