aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-map.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-02-19 05:36:35 -0500
committerJens Axboe <jens.axboe@oracle.com>2008-02-19 05:36:35 -0500
commit6b00769fe1502b4ad97bb327ef7ac971b208bfb5 (patch)
tree2ffc51176437ebf4f8a4ab13de59a32431043f15 /block/blk-map.c
parent40b01b9bbdf51ae543a04744283bf2d56c4a6afa (diff)
block: add request->raw_data_len
With padding and draining moved into it, block layer now may extend requests as directed by queue parameters, so now a request has two sizes - the original request size and the extended size which matches the size of area pointed to by bios and later by sgs. The latter size is what lower layers are primarily interested in when allocating, filling up DMA tables and setting up the controller. Both padding and draining extend the data area to accomodate controller characteristics. As any controller which speaks SCSI can handle underflows, feeding larger data area is safe. So, this patch makes the primary data length field, request->data_len, indicate the size of full data area and add a separate length field, request->raw_data_len, for the unmodified request size. The latter is used to report to higher layer (userland) and where the original request size should be fed to the controller or device. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-map.c')
-rw-r--r--block/blk-map.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-map.c b/block/blk-map.c
index a7cf63ccb5cf..09f7fd0bcb73 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -19,6 +19,7 @@ int blk_rq_append_bio(struct request_queue *q, struct request *rq,
19 rq->biotail->bi_next = bio; 19 rq->biotail->bi_next = bio;
20 rq->biotail = bio; 20 rq->biotail = bio;
21 21
22 rq->raw_data_len += bio->bi_size;
22 rq->data_len += bio->bi_size; 23 rq->data_len += bio->bi_size;
23 } 24 }
24 return 0; 25 return 0;
@@ -154,6 +155,7 @@ int blk_rq_map_user(struct request_queue *q, struct request *rq,
154 155
155 bio->bi_io_vec[bio->bi_vcnt - 1].bv_len += pad_len; 156 bio->bi_io_vec[bio->bi_vcnt - 1].bv_len += pad_len;
156 bio->bi_size += pad_len; 157 bio->bi_size += pad_len;
158 rq->data_len += pad_len;
157 } 159 }
158 160
159 rq->buffer = rq->data = NULL; 161 rq->buffer = rq->data = NULL;