diff options
| author | Ming Lei <ming.lei@redhat.com> | 2019-02-15 06:13:19 -0500 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2019-02-15 10:40:11 -0500 |
| commit | 6dc4f100c175dd0511ae8674786e7c9006cdfbfa (patch) | |
| tree | b8e5204ca6eec1275187496f2d6c069643e478dc /drivers/md/bcache | |
| parent | 2e1f4f4d2481d8bf111904c3e45fc0c4c94bf76e (diff) | |
block: allow bio_for_each_segment_all() to iterate over multi-page bvec
This patch introduces one extra iterator variable to bio_for_each_segment_all(),
then we can allow bio_for_each_segment_all() to iterate over multi-page bvec.
Given it is just one mechannical & simple change on all bio_for_each_segment_all()
users, this patch does tree-wide change in one single patch, so that we can
avoid to use a temporary helper for this conversion.
Reviewed-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache')
| -rw-r--r-- | drivers/md/bcache/btree.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index 23cb1dc7296b..64def336f053 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c | |||
| @@ -432,8 +432,9 @@ static void do_btree_node_write(struct btree *b) | |||
| 432 | int j; | 432 | int j; |
| 433 | struct bio_vec *bv; | 433 | struct bio_vec *bv; |
| 434 | void *base = (void *) ((unsigned long) i & ~(PAGE_SIZE - 1)); | 434 | void *base = (void *) ((unsigned long) i & ~(PAGE_SIZE - 1)); |
| 435 | struct bvec_iter_all iter_all; | ||
| 435 | 436 | ||
| 436 | bio_for_each_segment_all(bv, b->bio, j) | 437 | bio_for_each_segment_all(bv, b->bio, j, iter_all) |
| 437 | memcpy(page_address(bv->bv_page), | 438 | memcpy(page_address(bv->bv_page), |
| 438 | base + j * PAGE_SIZE, PAGE_SIZE); | 439 | base + j * PAGE_SIZE, PAGE_SIZE); |
| 439 | 440 | ||
