Merge tag 'xfs-5.14-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[linux-2.6-microblaze.git] / fs / xfs / scrub / common.c
index be38c96..8558ca0 100644 (file)
@@ -12,7 +12,6 @@
 #include "xfs_btree.h"
 #include "xfs_log_format.h"
 #include "xfs_trans.h"
-#include "xfs_sb.h"
 #include "xfs_inode.h"
 #include "xfs_icache.h"
 #include "xfs_alloc.h"
@@ -26,6 +25,7 @@
 #include "xfs_trans_priv.h"
 #include "xfs_attr.h"
 #include "xfs_reflink.h"
+#include "xfs_ag.h"
 #include "scrub/scrub.h"
 #include "scrub/common.h"
 #include "scrub/trace.h"
@@ -83,7 +83,7 @@ __xchk_process_error(
                /* Note the badness but don't abort. */
                sc->sm->sm_flags |= errflag;
                *error = 0;
-               /* fall through */
+               fallthrough;
        default:
                trace_xchk_op_error(sc, agno, bno, *error,
                                ret_ip);
@@ -136,7 +136,7 @@ __xchk_fblock_process_error(
                /* Note the badness but don't abort. */
                sc->sm->sm_flags |= errflag;
                *error = 0;
-               /* fall through */
+               fallthrough;
        default:
                trace_xchk_file_op_error(sc, whichfork, offset, *error,
                                ret_ip);
@@ -460,49 +460,48 @@ xchk_ag_btcur_init(
        struct xchk_ag          *sa)
 {
        struct xfs_mount        *mp = sc->mp;
-       xfs_agnumber_t          agno = sa->agno;
 
        xchk_perag_get(sc->mp, sa);
        if (sa->agf_bp &&
            xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_BNO)) {
                /* Set up a bnobt cursor for cross-referencing. */
                sa->bno_cur = xfs_allocbt_init_cursor(mp, sc->tp, sa->agf_bp,
-                               agno, XFS_BTNUM_BNO);
+                               sa->pag, XFS_BTNUM_BNO);
        }
 
        if (sa->agf_bp &&
            xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_CNT)) {
                /* Set up a cntbt cursor for cross-referencing. */
                sa->cnt_cur = xfs_allocbt_init_cursor(mp, sc->tp, sa->agf_bp,
-                               agno, XFS_BTNUM_CNT);
+                               sa->pag, XFS_BTNUM_CNT);
        }
 
        /* Set up a inobt cursor for cross-referencing. */
        if (sa->agi_bp &&
            xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_INO)) {
                sa->ino_cur = xfs_inobt_init_cursor(mp, sc->tp, sa->agi_bp,
-                                       agno, XFS_BTNUM_INO);
+                               sa->pag, XFS_BTNUM_INO);
        }
 
        /* Set up a finobt cursor for cross-referencing. */
        if (sa->agi_bp && xfs_sb_version_hasfinobt(&mp->m_sb) &&
            xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_FINO)) {
                sa->fino_cur = xfs_inobt_init_cursor(mp, sc->tp, sa->agi_bp,
-                               agno, XFS_BTNUM_FINO);
+                               sa->pag, XFS_BTNUM_FINO);
        }
 
        /* Set up a rmapbt cursor for cross-referencing. */
        if (sa->agf_bp && xfs_sb_version_hasrmapbt(&mp->m_sb) &&
            xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_RMAP)) {
                sa->rmap_cur = xfs_rmapbt_init_cursor(mp, sc->tp, sa->agf_bp,
-                               agno);
+                               sa->pag);
        }
 
        /* Set up a refcountbt cursor for cross-referencing. */
        if (sa->agf_bp && xfs_sb_version_hasreflink(&mp->m_sb) &&
            xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_REFC)) {
                sa->refc_cur = xfs_refcountbt_init_cursor(mp, sc->tp,
-                               sa->agf_bp, agno);
+                               sa->agf_bp, sa->pag);
        }
 }
 
@@ -696,7 +695,7 @@ xchk_get_inode(
                if (error)
                        return -ENOENT;
                error = -EFSCORRUPTED;
-               /* fall through */
+               fallthrough;
        default:
                trace_xchk_op_error(sc,
                                XFS_INO_TO_AGNO(mp, sc->sm->sm_ino),