aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2019-02-15 06:13:19 -0500
committerJens Axboe <axboe@kernel.dk>2019-02-15 10:40:11 -0500
commit6dc4f100c175dd0511ae8674786e7c9006cdfbfa (patch)
treeb8e5204ca6eec1275187496f2d6c069643e478dc /fs/gfs2
parent2e1f4f4d2481d8bf111904c3e45fc0c4c94bf76e (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 'fs/gfs2')
-rw-r--r--fs/gfs2/lops.c9
-rw-r--r--fs/gfs2/meta_io.c3
2 files changed, 8 insertions, 4 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index 94dcab655bc0..15deefeaafd0 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -170,7 +170,8 @@ u64 gfs2_log_bmap(struct gfs2_sbd *sdp)
170 * that is pinned in the pagecache. 170 * that is pinned in the pagecache.
171 */ 171 */
172 172
173static void gfs2_end_log_write_bh(struct gfs2_sbd *sdp, struct bio_vec *bvec, 173static void gfs2_end_log_write_bh(struct gfs2_sbd *sdp,
174 struct bio_vec *bvec,
174 blk_status_t error) 175 blk_status_t error)
175{ 176{
176 struct buffer_head *bh, *next; 177 struct buffer_head *bh, *next;
@@ -208,6 +209,7 @@ static void gfs2_end_log_write(struct bio *bio)
208 struct bio_vec *bvec; 209 struct bio_vec *bvec;
209 struct page *page; 210 struct page *page;
210 int i; 211 int i;
212 struct bvec_iter_all iter_all;
211 213
212 if (bio->bi_status) { 214 if (bio->bi_status) {
213 fs_err(sdp, "Error %d writing to journal, jid=%u\n", 215 fs_err(sdp, "Error %d writing to journal, jid=%u\n",
@@ -215,7 +217,7 @@ static void gfs2_end_log_write(struct bio *bio)
215 wake_up(&sdp->sd_logd_waitq); 217 wake_up(&sdp->sd_logd_waitq);
216 } 218 }
217 219
218 bio_for_each_segment_all(bvec, bio, i) { 220 bio_for_each_segment_all(bvec, bio, i, iter_all) {
219 page = bvec->bv_page; 221 page = bvec->bv_page;
220 if (page_has_buffers(page)) 222 if (page_has_buffers(page))
221 gfs2_end_log_write_bh(sdp, bvec, bio->bi_status); 223 gfs2_end_log_write_bh(sdp, bvec, bio->bi_status);
@@ -388,8 +390,9 @@ static void gfs2_end_log_read(struct bio *bio)
388 struct page *page; 390 struct page *page;
389 struct bio_vec *bvec; 391 struct bio_vec *bvec;
390 int i; 392 int i;
393 struct bvec_iter_all iter_all;
391 394
392 bio_for_each_segment_all(bvec, bio, i) { 395 bio_for_each_segment_all(bvec, bio, i, iter_all) {
393 page = bvec->bv_page; 396 page = bvec->bv_page;
394 if (bio->bi_status) { 397 if (bio->bi_status) {
395 int err = blk_status_to_errno(bio->bi_status); 398 int err = blk_status_to_errno(bio->bi_status);
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index be9c0bf697fe..3201342404a7 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -190,8 +190,9 @@ static void gfs2_meta_read_endio(struct bio *bio)
190{ 190{
191 struct bio_vec *bvec; 191 struct bio_vec *bvec;
192 int i; 192 int i;
193 struct bvec_iter_all iter_all;
193 194
194 bio_for_each_segment_all(bvec, bio, i) { 195 bio_for_each_segment_all(bvec, bio, i, iter_all) {
195 struct page *page = bvec->bv_page; 196 struct page *page = bvec->bv_page;
196 struct buffer_head *bh = page_buffers(page); 197 struct buffer_head *bh = page_buffers(page);
197 unsigned int len = bvec->bv_len; 198 unsigned int len = bvec->bv_len;