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>
This commit is contained in:
@@ -7777,6 +7777,7 @@ static void btrfs_retry_endio_nocsum(struct bio *bio)
|
||||
struct bio_vec *bvec;
|
||||
struct extent_io_tree *io_tree, *failure_tree;
|
||||
int i;
|
||||
struct bvec_iter_all iter_all;
|
||||
|
||||
if (bio->bi_status)
|
||||
goto end;
|
||||
@@ -7788,7 +7789,7 @@ static void btrfs_retry_endio_nocsum(struct bio *bio)
|
||||
|
||||
done->uptodate = 1;
|
||||
ASSERT(!bio_flagged(bio, BIO_CLONED));
|
||||
bio_for_each_segment_all(bvec, bio, i)
|
||||
bio_for_each_segment_all(bvec, bio, i, iter_all)
|
||||
clean_io_failure(BTRFS_I(inode)->root->fs_info, failure_tree,
|
||||
io_tree, done->start, bvec->bv_page,
|
||||
btrfs_ino(BTRFS_I(inode)), 0);
|
||||
@@ -7867,6 +7868,7 @@ static void btrfs_retry_endio(struct bio *bio)
|
||||
int uptodate;
|
||||
int ret;
|
||||
int i;
|
||||
struct bvec_iter_all iter_all;
|
||||
|
||||
if (bio->bi_status)
|
||||
goto end;
|
||||
@@ -7880,7 +7882,7 @@ static void btrfs_retry_endio(struct bio *bio)
|
||||
failure_tree = &BTRFS_I(inode)->io_failure_tree;
|
||||
|
||||
ASSERT(!bio_flagged(bio, BIO_CLONED));
|
||||
bio_for_each_segment_all(bvec, bio, i) {
|
||||
bio_for_each_segment_all(bvec, bio, i, iter_all) {
|
||||
ret = __readpage_endio_check(inode, io_bio, i, bvec->bv_page,
|
||||
bvec->bv_offset, done->start,
|
||||
bvec->bv_len);
|
||||
|
Reference in New Issue
Block a user