diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-08-07 17:26:21 -0400 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-24 01:33:49 -0500 |
commit | 4550dd6c6b062fc5e5b647296d55da22616123c3 (patch) | |
tree | 9ca83cc0283151980b7c2f18c0e928aa34a2a0d9 /drivers/block | |
parent | 7988613b0e5b2638caf6cd493cc78e9595eba19c (diff) |
block: Immutable bio vecs
This adds a mechanism by which we can advance a bio by an arbitrary
number of bytes without modifying the biovec: bio->bi_iter.bi_bvec_done
indicates the number of bytes completed in the current bvec.
Various driver code still needs to be updated to not refer to the bvec
directly before we can use this for interesting things, like efficient
bio splitting.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Lars Ellenberg <drbd-dev@lists.linbit.com>
Cc: Paul Clements <Paul.Clements@steeleye.com>
Cc: drbd-user@lists.linbit.com
Cc: nbd-general@lists.sourceforge.net
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 4 | ||||
-rw-r--r-- | drivers/block/nbd.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index f4e5440aba05..929468e1512a 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -1546,7 +1546,7 @@ static int _drbd_send_bio(struct drbd_conf *mdev, struct bio *bio) | |||
1546 | 1546 | ||
1547 | err = _drbd_no_send_page(mdev, bvec.bv_page, | 1547 | err = _drbd_no_send_page(mdev, bvec.bv_page, |
1548 | bvec.bv_offset, bvec.bv_len, | 1548 | bvec.bv_offset, bvec.bv_len, |
1549 | bio_iter_last(bio, iter) | 1549 | bio_iter_last(bvec, iter) |
1550 | ? 0 : MSG_MORE); | 1550 | ? 0 : MSG_MORE); |
1551 | if (err) | 1551 | if (err) |
1552 | return err; | 1552 | return err; |
@@ -1565,7 +1565,7 @@ static int _drbd_send_zc_bio(struct drbd_conf *mdev, struct bio *bio) | |||
1565 | 1565 | ||
1566 | err = _drbd_send_page(mdev, bvec.bv_page, | 1566 | err = _drbd_send_page(mdev, bvec.bv_page, |
1567 | bvec.bv_offset, bvec.bv_len, | 1567 | bvec.bv_offset, bvec.bv_len, |
1568 | bio_iter_last(bio, iter) ? 0 : MSG_MORE); | 1568 | bio_iter_last(bvec, iter) ? 0 : MSG_MORE); |
1569 | if (err) | 1569 | if (err) |
1570 | return err; | 1570 | return err; |
1571 | } | 1571 | } |
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index aa362f493216..55298db36b2d 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -278,7 +278,7 @@ static int nbd_send_req(struct nbd_device *nbd, struct request *req) | |||
278 | */ | 278 | */ |
279 | rq_for_each_segment(bvec, req, iter) { | 279 | rq_for_each_segment(bvec, req, iter) { |
280 | flags = 0; | 280 | flags = 0; |
281 | if (!rq_iter_last(req, iter)) | 281 | if (!rq_iter_last(bvec, iter)) |
282 | flags = MSG_MORE; | 282 | flags = MSG_MORE; |
283 | dprintk(DBG_TX, "%s: request %p: sending %d bytes data\n", | 283 | dprintk(DBG_TX, "%s: request %p: sending %d bytes data\n", |
284 | nbd->disk->disk_name, req, bvec.bv_len); | 284 | nbd->disk->disk_name, req, bvec.bv_len); |