diff options
author | Ming Lin <ming.l@ssi.samsung.com> | 2016-03-22 08:24:44 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-04-12 21:13:23 +0200 |
commit | 37e58237a16b94fcd2c2d1b7e9c6e1ca661c231b (patch) | |
tree | 0225607142a78e0f110831626c033386e3c1694c /block | |
parent | writeback: Fix performance regression in wb_over_bg_thresh() (diff) | |
download | linux-37e58237a16b94fcd2c2d1b7e9c6e1ca661c231b.tar.xz linux-37e58237a16b94fcd2c2d1b7e9c6e1ca661c231b.zip |
block: add offset in blk_add_request_payload()
We could kmalloc() the payload, so need the offset in page.
Signed-off-by: Ming Lin <ming.l@ssi.samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-core.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index b60537b2c35b..c50227796a26 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1523,6 +1523,7 @@ EXPORT_SYMBOL(blk_put_request); * blk_add_request_payload - add a payload to a request * @rq: request to update * @page: page backing the payload + * @offset: offset in page * @len: length of the payload. * * This allows to later add a payload to an already submitted request by @@ -1533,12 +1534,12 @@ EXPORT_SYMBOL(blk_put_request); * discard requests should ever use it. */ void blk_add_request_payload(struct request *rq, struct page *page, - unsigned int len) + int offset, unsigned int len) { struct bio *bio = rq->bio; bio->bi_io_vec->bv_page = page; - bio->bi_io_vec->bv_offset = 0; + bio->bi_io_vec->bv_offset = offset; bio->bi_io_vec->bv_len = len; bio->bi_iter.bi_size = len; |