gfs2: Remove unnecessary gfs2_meta_check_ii argument
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 27 Feb 2024 21:57:08 +0000 (22:57 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 9 Apr 2024 16:35:57 +0000 (18:35 +0200)
The type argument of gfs2_meta_check_ii() is always set to "magic
number", so remove that argument and hardcode the string in
gfs2_meta_check_ii().  Change the string to "bad magic number" to
emphasize that the problem is the incorrect magic number.

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

index fd65a2e3410214f27626e47f070f61dcd991323a..963d77c4ca215bdcd843e4774d2aab827e520cab 100644 (file)
@@ -488,16 +488,16 @@ void gfs2_consist_rgrpd_i(struct gfs2_rgrpd *rgd,
  */
 
 int gfs2_meta_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
-                      const char *type, const char *function, char *file,
+                      const char *function, char *file,
                       unsigned int line)
 {
        int me;
 
        gfs2_lm(sdp,
                "fatal: invalid metadata block - "
-               "bh = %llu (%s), "
+               "bh = %llu (bad magic number), "
                "function = %s, file = %s, line = %u\n",
-               (unsigned long long)bh->b_blocknr, type,
+               (unsigned long long)bh->b_blocknr,
                function, file, line);
        me = gfs2_withdraw(sdp);
        return (me) ? -1 : -2;
index ba071998461fd462b3a57c991d87858a09377500..d8d62bf0424d5985d6e1b4192ca270d83ce73834 100644 (file)
@@ -92,7 +92,7 @@ gfs2_consist_rgrpd_i((rgd), __func__, __FILE__, __LINE__)
 
 
 int gfs2_meta_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
-                      const char *type, const char *function,
+                      const char *function,
                       char *file, unsigned int line);
 
 static inline int gfs2_meta_check(struct gfs2_sbd *sdp,
@@ -123,7 +123,7 @@ static inline int gfs2_metatype_check_i(struct gfs2_sbd *sdp,
        u32 magic = be32_to_cpu(mh->mh_magic);
        u16 t = be32_to_cpu(mh->mh_type);
        if (unlikely(magic != GFS2_MAGIC))
-               return gfs2_meta_check_ii(sdp, bh, "magic number", function,
+               return gfs2_meta_check_ii(sdp, bh, function,
                                          file, line);
         if (unlikely(t != type))
                return gfs2_metatype_check_ii(sdp, bh, type, t, function,