]> Gentwo Git Trees - linux/.git/commitdiff
gfs2: Kill gfs2_io_error_bh_wd
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 5 Aug 2025 22:08:42 +0000 (00:08 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 26 Nov 2025 23:52:26 +0000 (23:52 +0000)
All callers of gfs2_io_error_bh() call gfs2_withdraw() as well, so
change gfs2_io_error_bh() to call gfs2_withdraw() directly.  This also
brings it in line with other similar error reporting functions.

With that, gfs2_io_error_bh() is the same as gfs2_io_error_bh_wd(), so
remove the latter.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/log.c
fs/gfs2/lops.c
fs/gfs2/meta_io.c
fs/gfs2/util.c
fs/gfs2/util.h

index 69734e18b23d97c548bd7637babd5ff5feb39650..8312cd2cdae47171eabcbe0ba148385a12ad89eb 100644 (file)
@@ -112,10 +112,8 @@ __acquires(&sdp->sd_ail_lock)
                                          &tr->tr_ail2_list);
                                continue;
                        }
-                       if (!cmpxchg(&sdp->sd_log_error, 0, -EIO)) {
+                       if (!cmpxchg(&sdp->sd_log_error, 0, -EIO))
                                gfs2_io_error_bh(sdp, bh);
-                               gfs2_withdraw(sdp);
-                       }
                }
 
                if (gfs2_withdrawn(sdp)) {
@@ -324,10 +322,8 @@ static int gfs2_ail1_empty_one(struct gfs2_sbd *sdp, struct gfs2_trans *tr,
                        continue;
                }
                if (!buffer_uptodate(bh) &&
-                   !cmpxchg(&sdp->sd_log_error, 0, -EIO)) {
+                   !cmpxchg(&sdp->sd_log_error, 0, -EIO))
                        gfs2_io_error_bh(sdp, bh);
-                       gfs2_withdraw(sdp);
-               }
                /*
                 * If we have space for revokes and the bd is no longer on any
                 * buf list, we can just add a revoke for it immediately and
index 9f80a37e8b7f91dd4d76f91d54981f5a4cff590f..c7ee4c16d1eba388624c17f34f77f8d090d24689 100644 (file)
@@ -49,7 +49,7 @@ void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh)
        if (test_set_buffer_pinned(bh))
                gfs2_assert_withdraw(sdp, 0);
        if (!buffer_uptodate(bh))
-               gfs2_io_error_bh_wd(sdp, bh);
+               gfs2_io_error_bh(sdp, bh);
        bd = bh->b_private;
        /* If this buffer is in the AIL and it has already been written
         * to in-place disk block, remove it from the AIL.
index 3ee90a4452b9d0e723303afc50cc551889a16ba3..c680d5a226bfc9a6d73a2444935824cafc0f23ae 100644 (file)
@@ -303,7 +303,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
        if (unlikely(!buffer_uptodate(bh))) {
                struct gfs2_trans *tr = current->journal_info;
                if (tr && test_bit(TR_TOUCHED, &tr->tr_flags))
-                       gfs2_io_error_bh_wd(sdp, bh);
+                       gfs2_io_error_bh(sdp, bh);
                brelse(bh);
                *bhp = NULL;
                return -EIO;
@@ -331,7 +331,7 @@ int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh)
        if (!buffer_uptodate(bh)) {
                struct gfs2_trans *tr = current->journal_info;
                if (tr && test_bit(TR_TOUCHED, &tr->tr_flags))
-                       gfs2_io_error_bh_wd(sdp, bh);
+                       gfs2_io_error_bh(sdp, bh);
                return -EIO;
        }
        if (gfs2_withdrawn(sdp) &&
index 4c3b44eafc9f789550c824642466da05c8fab447..d0c1345421fc421cf5bbf4ce891a19ab0522d462 100644 (file)
@@ -516,13 +516,11 @@ void gfs2_io_error_i(struct gfs2_sbd *sdp, const char *function, char *file,
 }
 
 /*
- * gfs2_io_error_bh_i - Flag a buffer I/O error
- * @withdraw: withdraw the filesystem
+ * gfs2_io_error_bh_i - Flag a buffer I/O error and withdraw
  */
 
 void gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh,
-                       const char *function, char *file, unsigned int line,
-                       bool withdraw)
+                       const char *function, char *file, unsigned int line)
 {
        if (gfs2_withdrawn(sdp))
                return;
@@ -531,7 +529,5 @@ void gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh,
               "block = %llu, "
               "function = %s, file = %s, line = %u\n",
               (unsigned long long)bh->b_blocknr, function, file, line);
-       if (withdraw)
-               gfs2_withdraw(sdp);
+       gfs2_withdraw(sdp);
 }
-
index 832c6c6eef4144311695416938e408608d410c96..d30e6a8ba8af0ff348682688009fcff9d6d6f501 100644 (file)
@@ -151,14 +151,10 @@ gfs2_io_error_i((sdp), __func__, __FILE__, __LINE__)
 
 
 void gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh,
-                       const char *function, char *file, unsigned int line,
-                       bool withdraw);
-
-#define gfs2_io_error_bh_wd(sdp, bh) \
-gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__, true)
+                       const char *function, char *file, unsigned int line);
 
 #define gfs2_io_error_bh(sdp, bh) \
-gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__, false)
+gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__)
 
 
 extern struct kmem_cache *gfs2_glock_cachep;