]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - fs/gfs2/lops.c
block: allow bio_for_each_segment_all() to iterate over multi-page bvec
[thirdparty/kernel/linux.git] / fs / gfs2 / lops.c
index 94dcab655bc0211ddffd934886850e3c808903c3..15deefeaafd0d68f912c4b4733aa5dee936da43d 100644 (file)
@@ -170,7 +170,8 @@ u64 gfs2_log_bmap(struct gfs2_sbd *sdp)
  * that is pinned in the pagecache.
  */
 
-static void gfs2_end_log_write_bh(struct gfs2_sbd *sdp, struct bio_vec *bvec,
+static void gfs2_end_log_write_bh(struct gfs2_sbd *sdp,
+                                 struct bio_vec *bvec,
                                  blk_status_t error)
 {
        struct buffer_head *bh, *next;
@@ -208,6 +209,7 @@ static void gfs2_end_log_write(struct bio *bio)
        struct bio_vec *bvec;
        struct page *page;
        int i;
+       struct bvec_iter_all iter_all;
 
        if (bio->bi_status) {
                fs_err(sdp, "Error %d writing to journal, jid=%u\n",
@@ -215,7 +217,7 @@ static void gfs2_end_log_write(struct bio *bio)
                wake_up(&sdp->sd_logd_waitq);
        }
 
-       bio_for_each_segment_all(bvec, bio, i) {
+       bio_for_each_segment_all(bvec, bio, i, iter_all) {
                page = bvec->bv_page;
                if (page_has_buffers(page))
                        gfs2_end_log_write_bh(sdp, bvec, bio->bi_status);
@@ -388,8 +390,9 @@ static void gfs2_end_log_read(struct bio *bio)
        struct page *page;
        struct bio_vec *bvec;
        int i;
+       struct bvec_iter_all iter_all;
 
-       bio_for_each_segment_all(bvec, bio, i) {
+       bio_for_each_segment_all(bvec, bio, i, iter_all) {
                page = bvec->bv_page;
                if (bio->bi_status) {
                        int err = blk_status_to_errno(bio->bi_status);