diff options
author | Christoph Hellwig <hch@lst.de> | 2019-04-25 03:03:00 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-04-30 11:26:13 -0400 |
commit | 2b070cfe582b8e99fec6ada57d2e59e194aae202 (patch) | |
tree | 354961c24c2cc77cdaa66128c5f2a0997bc746e8 /fs | |
parent | f936b06ae53815a7633b30ffd8cf5661ac826b3a (diff) |
block: remove the i argument to bio_for_each_segment_all
We only have two callers that need the integer loop iterator, and they
can easily maintain it themselves.
Suggested-by: Matthew Wilcox <willy@infradead.org>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: David Sterba <dsterba@suse.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Acked-by: Coly Li <colyli@suse.de>
Reviewed-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/block_dev.c | 6 | ||||
-rw-r--r-- | fs/btrfs/compression.c | 3 | ||||
-rw-r--r-- | fs/btrfs/disk-io.c | 4 | ||||
-rw-r--r-- | fs/btrfs/extent_io.c | 10 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 8 | ||||
-rw-r--r-- | fs/btrfs/raid56.c | 3 | ||||
-rw-r--r-- | fs/crypto/bio.c | 3 | ||||
-rw-r--r-- | fs/direct-io.c | 3 | ||||
-rw-r--r-- | fs/ext4/page-io.c | 3 | ||||
-rw-r--r-- | fs/ext4/readpage.c | 3 | ||||
-rw-r--r-- | fs/f2fs/data.c | 9 | ||||
-rw-r--r-- | fs/gfs2/lops.c | 3 | ||||
-rw-r--r-- | fs/gfs2/meta_io.c | 3 | ||||
-rw-r--r-- | fs/iomap.c | 6 | ||||
-rw-r--r-- | fs/mpage.c | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_aops.c | 3 |
16 files changed, 27 insertions, 46 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 24615c76c1d0..8abc6570d29f 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -210,7 +210,6 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter, | |||
210 | struct bio bio; | 210 | struct bio bio; |
211 | ssize_t ret; | 211 | ssize_t ret; |
212 | blk_qc_t qc; | 212 | blk_qc_t qc; |
213 | int i; | ||
214 | struct bvec_iter_all iter_all; | 213 | struct bvec_iter_all iter_all; |
215 | 214 | ||
216 | if ((pos | iov_iter_alignment(iter)) & | 215 | if ((pos | iov_iter_alignment(iter)) & |
@@ -261,7 +260,7 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter, | |||
261 | } | 260 | } |
262 | __set_current_state(TASK_RUNNING); | 261 | __set_current_state(TASK_RUNNING); |
263 | 262 | ||
264 | bio_for_each_segment_all(bvec, &bio, i, iter_all) { | 263 | bio_for_each_segment_all(bvec, &bio, iter_all) { |
265 | if (should_dirty && !PageCompound(bvec->bv_page)) | 264 | if (should_dirty && !PageCompound(bvec->bv_page)) |
266 | set_page_dirty_lock(bvec->bv_page); | 265 | set_page_dirty_lock(bvec->bv_page); |
267 | put_page(bvec->bv_page); | 266 | put_page(bvec->bv_page); |
@@ -339,9 +338,8 @@ static void blkdev_bio_end_io(struct bio *bio) | |||
339 | if (!bio_flagged(bio, BIO_NO_PAGE_REF)) { | 338 | if (!bio_flagged(bio, BIO_NO_PAGE_REF)) { |
340 | struct bvec_iter_all iter_all; | 339 | struct bvec_iter_all iter_all; |
341 | struct bio_vec *bvec; | 340 | struct bio_vec *bvec; |
342 | int i; | ||
343 | 341 | ||
344 | bio_for_each_segment_all(bvec, bio, i, iter_all) | 342 | bio_for_each_segment_all(bvec, bio, iter_all) |
345 | put_page(bvec->bv_page); | 343 | put_page(bvec->bv_page); |
346 | } | 344 | } |
347 | bio_put(bio); | 345 | bio_put(bio); |
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 4f2a8ae0aa42..6313dc65209e 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c | |||
@@ -160,7 +160,6 @@ csum_failed: | |||
160 | if (cb->errors) { | 160 | if (cb->errors) { |
161 | bio_io_error(cb->orig_bio); | 161 | bio_io_error(cb->orig_bio); |
162 | } else { | 162 | } else { |
163 | int i; | ||
164 | struct bio_vec *bvec; | 163 | struct bio_vec *bvec; |
165 | struct bvec_iter_all iter_all; | 164 | struct bvec_iter_all iter_all; |
166 | 165 | ||
@@ -169,7 +168,7 @@ csum_failed: | |||
169 | * checked so the end_io handlers know about it | 168 | * checked so the end_io handlers know about it |
170 | */ | 169 | */ |
171 | ASSERT(!bio_flagged(bio, BIO_CLONED)); | 170 | ASSERT(!bio_flagged(bio, BIO_CLONED)); |
172 | bio_for_each_segment_all(bvec, cb->orig_bio, i, iter_all) | 171 | bio_for_each_segment_all(bvec, cb->orig_bio, iter_all) |
173 | SetPageChecked(bvec->bv_page); | 172 | SetPageChecked(bvec->bv_page); |
174 | 173 | ||
175 | bio_endio(cb->orig_bio); | 174 | bio_endio(cb->orig_bio); |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 6fe9197f6ee4..c333e79408ff 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -832,11 +832,11 @@ static blk_status_t btree_csum_one_bio(struct bio *bio) | |||
832 | { | 832 | { |
833 | struct bio_vec *bvec; | 833 | struct bio_vec *bvec; |
834 | struct btrfs_root *root; | 834 | struct btrfs_root *root; |
835 | int i, ret = 0; | 835 | int ret = 0; |
836 | struct bvec_iter_all iter_all; | 836 | struct bvec_iter_all iter_all; |
837 | 837 | ||
838 | ASSERT(!bio_flagged(bio, BIO_CLONED)); | 838 | ASSERT(!bio_flagged(bio, BIO_CLONED)); |
839 | bio_for_each_segment_all(bvec, bio, i, iter_all) { | 839 | bio_for_each_segment_all(bvec, bio, iter_all) { |
840 | root = BTRFS_I(bvec->bv_page->mapping->host)->root; | 840 | root = BTRFS_I(bvec->bv_page->mapping->host)->root; |
841 | ret = csum_dirty_buffer(root->fs_info, bvec->bv_page); | 841 | ret = csum_dirty_buffer(root->fs_info, bvec->bv_page); |
842 | if (ret) | 842 | if (ret) |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index ca8b8e785cf3..c85505c36fa6 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2451,11 +2451,10 @@ static void end_bio_extent_writepage(struct bio *bio) | |||
2451 | struct bio_vec *bvec; | 2451 | struct bio_vec *bvec; |
2452 | u64 start; | 2452 | u64 start; |
2453 | u64 end; | 2453 | u64 end; |
2454 | int i; | ||
2455 | struct bvec_iter_all iter_all; | 2454 | struct bvec_iter_all iter_all; |
2456 | 2455 | ||
2457 | ASSERT(!bio_flagged(bio, BIO_CLONED)); | 2456 | ASSERT(!bio_flagged(bio, BIO_CLONED)); |
2458 | bio_for_each_segment_all(bvec, bio, i, iter_all) { | 2457 | bio_for_each_segment_all(bvec, bio, iter_all) { |
2459 | struct page *page = bvec->bv_page; | 2458 | struct page *page = bvec->bv_page; |
2460 | struct inode *inode = page->mapping->host; | 2459 | struct inode *inode = page->mapping->host; |
2461 | struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); | 2460 | struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); |
@@ -2523,11 +2522,10 @@ static void end_bio_extent_readpage(struct bio *bio) | |||
2523 | u64 extent_len = 0; | 2522 | u64 extent_len = 0; |
2524 | int mirror; | 2523 | int mirror; |
2525 | int ret; | 2524 | int ret; |
2526 | int i; | ||
2527 | struct bvec_iter_all iter_all; | 2525 | struct bvec_iter_all iter_all; |
2528 | 2526 | ||
2529 | ASSERT(!bio_flagged(bio, BIO_CLONED)); | 2527 | ASSERT(!bio_flagged(bio, BIO_CLONED)); |
2530 | bio_for_each_segment_all(bvec, bio, i, iter_all) { | 2528 | bio_for_each_segment_all(bvec, bio, iter_all) { |
2531 | struct page *page = bvec->bv_page; | 2529 | struct page *page = bvec->bv_page; |
2532 | struct inode *inode = page->mapping->host; | 2530 | struct inode *inode = page->mapping->host; |
2533 | struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); | 2531 | struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); |
@@ -3643,11 +3641,11 @@ static void end_bio_extent_buffer_writepage(struct bio *bio) | |||
3643 | { | 3641 | { |
3644 | struct bio_vec *bvec; | 3642 | struct bio_vec *bvec; |
3645 | struct extent_buffer *eb; | 3643 | struct extent_buffer *eb; |
3646 | int i, done; | 3644 | int done; |
3647 | struct bvec_iter_all iter_all; | 3645 | struct bvec_iter_all iter_all; |
3648 | 3646 | ||
3649 | ASSERT(!bio_flagged(bio, BIO_CLONED)); | 3647 | ASSERT(!bio_flagged(bio, BIO_CLONED)); |
3650 | bio_for_each_segment_all(bvec, bio, i, iter_all) { | 3648 | bio_for_each_segment_all(bvec, bio, iter_all) { |
3651 | struct page *page = bvec->bv_page; | 3649 | struct page *page = bvec->bv_page; |
3652 | 3650 | ||
3653 | eb = (struct extent_buffer *)page->private; | 3651 | eb = (struct extent_buffer *)page->private; |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 82fdda8ff5ab..10a8d08d3d29 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -7828,7 +7828,6 @@ static void btrfs_retry_endio_nocsum(struct bio *bio) | |||
7828 | struct inode *inode = done->inode; | 7828 | struct inode *inode = done->inode; |
7829 | struct bio_vec *bvec; | 7829 | struct bio_vec *bvec; |
7830 | struct extent_io_tree *io_tree, *failure_tree; | 7830 | struct extent_io_tree *io_tree, *failure_tree; |
7831 | int i; | ||
7832 | struct bvec_iter_all iter_all; | 7831 | struct bvec_iter_all iter_all; |
7833 | 7832 | ||
7834 | if (bio->bi_status) | 7833 | if (bio->bi_status) |
@@ -7841,7 +7840,7 @@ static void btrfs_retry_endio_nocsum(struct bio *bio) | |||
7841 | 7840 | ||
7842 | done->uptodate = 1; | 7841 | done->uptodate = 1; |
7843 | ASSERT(!bio_flagged(bio, BIO_CLONED)); | 7842 | ASSERT(!bio_flagged(bio, BIO_CLONED)); |
7844 | bio_for_each_segment_all(bvec, bio, i, iter_all) | 7843 | bio_for_each_segment_all(bvec, bio, iter_all) |
7845 | clean_io_failure(BTRFS_I(inode)->root->fs_info, failure_tree, | 7844 | clean_io_failure(BTRFS_I(inode)->root->fs_info, failure_tree, |
7846 | io_tree, done->start, bvec->bv_page, | 7845 | io_tree, done->start, bvec->bv_page, |
7847 | btrfs_ino(BTRFS_I(inode)), 0); | 7846 | btrfs_ino(BTRFS_I(inode)), 0); |
@@ -7919,7 +7918,7 @@ static void btrfs_retry_endio(struct bio *bio) | |||
7919 | struct bio_vec *bvec; | 7918 | struct bio_vec *bvec; |
7920 | int uptodate; | 7919 | int uptodate; |
7921 | int ret; | 7920 | int ret; |
7922 | int i; | 7921 | int i = 0; |
7923 | struct bvec_iter_all iter_all; | 7922 | struct bvec_iter_all iter_all; |
7924 | 7923 | ||
7925 | if (bio->bi_status) | 7924 | if (bio->bi_status) |
@@ -7934,7 +7933,7 @@ static void btrfs_retry_endio(struct bio *bio) | |||
7934 | failure_tree = &BTRFS_I(inode)->io_failure_tree; | 7933 | failure_tree = &BTRFS_I(inode)->io_failure_tree; |
7935 | 7934 | ||
7936 | ASSERT(!bio_flagged(bio, BIO_CLONED)); | 7935 | ASSERT(!bio_flagged(bio, BIO_CLONED)); |
7937 | bio_for_each_segment_all(bvec, bio, i, iter_all) { | 7936 | bio_for_each_segment_all(bvec, bio, iter_all) { |
7938 | ret = __readpage_endio_check(inode, io_bio, i, bvec->bv_page, | 7937 | ret = __readpage_endio_check(inode, io_bio, i, bvec->bv_page, |
7939 | bvec->bv_offset, done->start, | 7938 | bvec->bv_offset, done->start, |
7940 | bvec->bv_len); | 7939 | bvec->bv_len); |
@@ -7946,6 +7945,7 @@ static void btrfs_retry_endio(struct bio *bio) | |||
7946 | bvec->bv_offset); | 7945 | bvec->bv_offset); |
7947 | else | 7946 | else |
7948 | uptodate = 0; | 7947 | uptodate = 0; |
7948 | i++; | ||
7949 | } | 7949 | } |
7950 | 7950 | ||
7951 | done->uptodate = uptodate; | 7951 | done->uptodate = uptodate; |
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 67a6f7d47402..f3d0576dd327 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c | |||
@@ -1442,12 +1442,11 @@ static int fail_bio_stripe(struct btrfs_raid_bio *rbio, | |||
1442 | static void set_bio_pages_uptodate(struct bio *bio) | 1442 | static void set_bio_pages_uptodate(struct bio *bio) |
1443 | { | 1443 | { |
1444 | struct bio_vec *bvec; | 1444 | struct bio_vec *bvec; |
1445 | int i; | ||
1446 | struct bvec_iter_all iter_all; | 1445 | struct bvec_iter_all iter_all; |
1447 | 1446 | ||
1448 | ASSERT(!bio_flagged(bio, BIO_CLONED)); | 1447 | ASSERT(!bio_flagged(bio, BIO_CLONED)); |
1449 | 1448 | ||
1450 | bio_for_each_segment_all(bvec, bio, i, iter_all) | 1449 | bio_for_each_segment_all(bvec, bio, iter_all) |
1451 | SetPageUptodate(bvec->bv_page); | 1450 | SetPageUptodate(bvec->bv_page); |
1452 | } | 1451 | } |
1453 | 1452 | ||
diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c index 5759bcd018cd..8f3a8bc15d98 100644 --- a/fs/crypto/bio.c +++ b/fs/crypto/bio.c | |||
@@ -29,10 +29,9 @@ | |||
29 | static void __fscrypt_decrypt_bio(struct bio *bio, bool done) | 29 | static void __fscrypt_decrypt_bio(struct bio *bio, bool done) |
30 | { | 30 | { |
31 | struct bio_vec *bv; | 31 | struct bio_vec *bv; |
32 | int i; | ||
33 | struct bvec_iter_all iter_all; | 32 | struct bvec_iter_all iter_all; |
34 | 33 | ||
35 | bio_for_each_segment_all(bv, bio, i, iter_all) { | 34 | bio_for_each_segment_all(bv, bio, iter_all) { |
36 | struct page *page = bv->bv_page; | 35 | struct page *page = bv->bv_page; |
37 | int ret = fscrypt_decrypt_page(page->mapping->host, page, | 36 | int ret = fscrypt_decrypt_page(page->mapping->host, page, |
38 | PAGE_SIZE, 0, page->index); | 37 | PAGE_SIZE, 0, page->index); |
diff --git a/fs/direct-io.c b/fs/direct-io.c index 9bb015bc4a83..fbe885d68035 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c | |||
@@ -538,7 +538,6 @@ static struct bio *dio_await_one(struct dio *dio) | |||
538 | static blk_status_t dio_bio_complete(struct dio *dio, struct bio *bio) | 538 | static blk_status_t dio_bio_complete(struct dio *dio, struct bio *bio) |
539 | { | 539 | { |
540 | struct bio_vec *bvec; | 540 | struct bio_vec *bvec; |
541 | unsigned i; | ||
542 | blk_status_t err = bio->bi_status; | 541 | blk_status_t err = bio->bi_status; |
543 | 542 | ||
544 | if (err) { | 543 | if (err) { |
@@ -553,7 +552,7 @@ static blk_status_t dio_bio_complete(struct dio *dio, struct bio *bio) | |||
553 | } else { | 552 | } else { |
554 | struct bvec_iter_all iter_all; | 553 | struct bvec_iter_all iter_all; |
555 | 554 | ||
556 | bio_for_each_segment_all(bvec, bio, i, iter_all) { | 555 | bio_for_each_segment_all(bvec, bio, iter_all) { |
557 | struct page *page = bvec->bv_page; | 556 | struct page *page = bvec->bv_page; |
558 | 557 | ||
559 | if (dio->op == REQ_OP_READ && !PageCompound(page) && | 558 | if (dio->op == REQ_OP_READ && !PageCompound(page) && |
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 3e9298e6a705..4690618a92e9 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c | |||
@@ -61,11 +61,10 @@ static void buffer_io_error(struct buffer_head *bh) | |||
61 | 61 | ||
62 | static void ext4_finish_bio(struct bio *bio) | 62 | static void ext4_finish_bio(struct bio *bio) |
63 | { | 63 | { |
64 | int i; | ||
65 | struct bio_vec *bvec; | 64 | struct bio_vec *bvec; |
66 | struct bvec_iter_all iter_all; | 65 | struct bvec_iter_all iter_all; |
67 | 66 | ||
68 | bio_for_each_segment_all(bvec, bio, i, iter_all) { | 67 | bio_for_each_segment_all(bvec, bio, iter_all) { |
69 | struct page *page = bvec->bv_page; | 68 | struct page *page = bvec->bv_page; |
70 | #ifdef CONFIG_FS_ENCRYPTION | 69 | #ifdef CONFIG_FS_ENCRYPTION |
71 | struct page *data_page = NULL; | 70 | struct page *data_page = NULL; |
diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c index 3adadf461825..3629a74b7f94 100644 --- a/fs/ext4/readpage.c +++ b/fs/ext4/readpage.c | |||
@@ -71,7 +71,6 @@ static inline bool ext4_bio_encrypted(struct bio *bio) | |||
71 | static void mpage_end_io(struct bio *bio) | 71 | static void mpage_end_io(struct bio *bio) |
72 | { | 72 | { |
73 | struct bio_vec *bv; | 73 | struct bio_vec *bv; |
74 | int i; | ||
75 | struct bvec_iter_all iter_all; | 74 | struct bvec_iter_all iter_all; |
76 | 75 | ||
77 | if (ext4_bio_encrypted(bio)) { | 76 | if (ext4_bio_encrypted(bio)) { |
@@ -82,7 +81,7 @@ static void mpage_end_io(struct bio *bio) | |||
82 | return; | 81 | return; |
83 | } | 82 | } |
84 | } | 83 | } |
85 | bio_for_each_segment_all(bv, bio, i, iter_all) { | 84 | bio_for_each_segment_all(bv, bio, iter_all) { |
86 | struct page *page = bv->bv_page; | 85 | struct page *page = bv->bv_page; |
87 | 86 | ||
88 | if (!bio->bi_status) { | 87 | if (!bio->bi_status) { |
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 9727944139f2..64040e998439 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -86,10 +86,9 @@ static void __read_end_io(struct bio *bio) | |||
86 | { | 86 | { |
87 | struct page *page; | 87 | struct page *page; |
88 | struct bio_vec *bv; | 88 | struct bio_vec *bv; |
89 | int i; | ||
90 | struct bvec_iter_all iter_all; | 89 | struct bvec_iter_all iter_all; |
91 | 90 | ||
92 | bio_for_each_segment_all(bv, bio, i, iter_all) { | 91 | bio_for_each_segment_all(bv, bio, iter_all) { |
93 | page = bv->bv_page; | 92 | page = bv->bv_page; |
94 | 93 | ||
95 | /* PG_error was set if any post_read step failed */ | 94 | /* PG_error was set if any post_read step failed */ |
@@ -164,7 +163,6 @@ static void f2fs_write_end_io(struct bio *bio) | |||
164 | { | 163 | { |
165 | struct f2fs_sb_info *sbi = bio->bi_private; | 164 | struct f2fs_sb_info *sbi = bio->bi_private; |
166 | struct bio_vec *bvec; | 165 | struct bio_vec *bvec; |
167 | int i; | ||
168 | struct bvec_iter_all iter_all; | 166 | struct bvec_iter_all iter_all; |
169 | 167 | ||
170 | if (time_to_inject(sbi, FAULT_WRITE_IO)) { | 168 | if (time_to_inject(sbi, FAULT_WRITE_IO)) { |
@@ -172,7 +170,7 @@ static void f2fs_write_end_io(struct bio *bio) | |||
172 | bio->bi_status = BLK_STS_IOERR; | 170 | bio->bi_status = BLK_STS_IOERR; |
173 | } | 171 | } |
174 | 172 | ||
175 | bio_for_each_segment_all(bvec, bio, i, iter_all) { | 173 | bio_for_each_segment_all(bvec, bio, iter_all) { |
176 | struct page *page = bvec->bv_page; | 174 | struct page *page = bvec->bv_page; |
177 | enum count_type type = WB_DATA_TYPE(page); | 175 | enum count_type type = WB_DATA_TYPE(page); |
178 | 176 | ||
@@ -349,7 +347,6 @@ static bool __has_merged_page(struct f2fs_bio_info *io, struct inode *inode, | |||
349 | { | 347 | { |
350 | struct bio_vec *bvec; | 348 | struct bio_vec *bvec; |
351 | struct page *target; | 349 | struct page *target; |
352 | int i; | ||
353 | struct bvec_iter_all iter_all; | 350 | struct bvec_iter_all iter_all; |
354 | 351 | ||
355 | if (!io->bio) | 352 | if (!io->bio) |
@@ -358,7 +355,7 @@ static bool __has_merged_page(struct f2fs_bio_info *io, struct inode *inode, | |||
358 | if (!inode && !page && !ino) | 355 | if (!inode && !page && !ino) |
359 | return true; | 356 | return true; |
360 | 357 | ||
361 | bio_for_each_segment_all(bvec, io->bio, i, iter_all) { | 358 | bio_for_each_segment_all(bvec, io->bio, iter_all) { |
362 | 359 | ||
363 | if (bvec->bv_page->mapping) | 360 | if (bvec->bv_page->mapping) |
364 | target = bvec->bv_page; | 361 | target = bvec->bv_page; |
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 8722c60b11fe..6f09b5e3dd6e 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c | |||
@@ -207,7 +207,6 @@ static void gfs2_end_log_write(struct bio *bio) | |||
207 | struct gfs2_sbd *sdp = bio->bi_private; | 207 | struct gfs2_sbd *sdp = bio->bi_private; |
208 | struct bio_vec *bvec; | 208 | struct bio_vec *bvec; |
209 | struct page *page; | 209 | struct page *page; |
210 | int i; | ||
211 | struct bvec_iter_all iter_all; | 210 | struct bvec_iter_all iter_all; |
212 | 211 | ||
213 | if (bio->bi_status) { | 212 | if (bio->bi_status) { |
@@ -216,7 +215,7 @@ static void gfs2_end_log_write(struct bio *bio) | |||
216 | wake_up(&sdp->sd_logd_waitq); | 215 | wake_up(&sdp->sd_logd_waitq); |
217 | } | 216 | } |
218 | 217 | ||
219 | bio_for_each_segment_all(bvec, bio, i, iter_all) { | 218 | bio_for_each_segment_all(bvec, bio, iter_all) { |
220 | page = bvec->bv_page; | 219 | page = bvec->bv_page; |
221 | if (page_has_buffers(page)) | 220 | if (page_has_buffers(page)) |
222 | gfs2_end_log_write_bh(sdp, bvec, bio->bi_status); | 221 | gfs2_end_log_write_bh(sdp, bvec, bio->bi_status); |
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index 3201342404a7..ff86e1d4f8ff 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c | |||
@@ -189,10 +189,9 @@ struct buffer_head *gfs2_meta_new(struct gfs2_glock *gl, u64 blkno) | |||
189 | static void gfs2_meta_read_endio(struct bio *bio) | 189 | static void gfs2_meta_read_endio(struct bio *bio) |
190 | { | 190 | { |
191 | struct bio_vec *bvec; | 191 | struct bio_vec *bvec; |
192 | int i; | ||
193 | struct bvec_iter_all iter_all; | 192 | struct bvec_iter_all iter_all; |
194 | 193 | ||
195 | bio_for_each_segment_all(bvec, bio, i, iter_all) { | 194 | bio_for_each_segment_all(bvec, bio, iter_all) { |
196 | struct page *page = bvec->bv_page; | 195 | struct page *page = bvec->bv_page; |
197 | struct buffer_head *bh = page_buffers(page); | 196 | struct buffer_head *bh = page_buffers(page); |
198 | unsigned int len = bvec->bv_len; | 197 | unsigned int len = bvec->bv_len; |
diff --git a/fs/iomap.c b/fs/iomap.c index abdd18e404f8..12a656271076 100644 --- a/fs/iomap.c +++ b/fs/iomap.c | |||
@@ -273,10 +273,9 @@ iomap_read_end_io(struct bio *bio) | |||
273 | { | 273 | { |
274 | int error = blk_status_to_errno(bio->bi_status); | 274 | int error = blk_status_to_errno(bio->bi_status); |
275 | struct bio_vec *bvec; | 275 | struct bio_vec *bvec; |
276 | int i; | ||
277 | struct bvec_iter_all iter_all; | 276 | struct bvec_iter_all iter_all; |
278 | 277 | ||
279 | bio_for_each_segment_all(bvec, bio, i, iter_all) | 278 | bio_for_each_segment_all(bvec, bio, iter_all) |
280 | iomap_read_page_end_io(bvec, error); | 279 | iomap_read_page_end_io(bvec, error); |
281 | bio_put(bio); | 280 | bio_put(bio); |
282 | } | 281 | } |
@@ -1592,9 +1591,8 @@ static void iomap_dio_bio_end_io(struct bio *bio) | |||
1592 | if (!bio_flagged(bio, BIO_NO_PAGE_REF)) { | 1591 | if (!bio_flagged(bio, BIO_NO_PAGE_REF)) { |
1593 | struct bvec_iter_all iter_all; | 1592 | struct bvec_iter_all iter_all; |
1594 | struct bio_vec *bvec; | 1593 | struct bio_vec *bvec; |
1595 | int i; | ||
1596 | 1594 | ||
1597 | bio_for_each_segment_all(bvec, bio, i, iter_all) | 1595 | bio_for_each_segment_all(bvec, bio, iter_all) |
1598 | put_page(bvec->bv_page); | 1596 | put_page(bvec->bv_page); |
1599 | } | 1597 | } |
1600 | bio_put(bio); | 1598 | bio_put(bio); |
diff --git a/fs/mpage.c b/fs/mpage.c index 3f19da75178b..436a85260394 100644 --- a/fs/mpage.c +++ b/fs/mpage.c | |||
@@ -47,10 +47,9 @@ | |||
47 | static void mpage_end_io(struct bio *bio) | 47 | static void mpage_end_io(struct bio *bio) |
48 | { | 48 | { |
49 | struct bio_vec *bv; | 49 | struct bio_vec *bv; |
50 | int i; | ||
51 | struct bvec_iter_all iter_all; | 50 | struct bvec_iter_all iter_all; |
52 | 51 | ||
53 | bio_for_each_segment_all(bv, bio, i, iter_all) { | 52 | bio_for_each_segment_all(bv, bio, iter_all) { |
54 | struct page *page = bv->bv_page; | 53 | struct page *page = bv->bv_page; |
55 | page_endio(page, bio_op(bio), | 54 | page_endio(page, bio_op(bio), |
56 | blk_status_to_errno(bio->bi_status)); | 55 | blk_status_to_errno(bio->bi_status)); |
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 3619e9e8d359..47941bbaac02 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c | |||
@@ -98,7 +98,6 @@ xfs_destroy_ioend( | |||
98 | 98 | ||
99 | for (bio = &ioend->io_inline_bio; bio; bio = next) { | 99 | for (bio = &ioend->io_inline_bio; bio; bio = next) { |
100 | struct bio_vec *bvec; | 100 | struct bio_vec *bvec; |
101 | int i; | ||
102 | struct bvec_iter_all iter_all; | 101 | struct bvec_iter_all iter_all; |
103 | 102 | ||
104 | /* | 103 | /* |
@@ -111,7 +110,7 @@ xfs_destroy_ioend( | |||
111 | next = bio->bi_private; | 110 | next = bio->bi_private; |
112 | 111 | ||
113 | /* walk each page on bio, ending page IO on them */ | 112 | /* walk each page on bio, ending page IO on them */ |
114 | bio_for_each_segment_all(bvec, bio, i, iter_all) | 113 | bio_for_each_segment_all(bvec, bio, iter_all) |
115 | xfs_finish_page_writeback(inode, bvec, error); | 114 | xfs_finish_page_writeback(inode, bvec, error); |
116 | bio_put(bio); | 115 | bio_put(bio); |
117 | } | 116 | } |