]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
xfs: remove XFS_FSB_SANITY_CHECK
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 8 Jan 2018 18:51:00 +0000 (10:51 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 8 Jan 2018 18:54:45 +0000 (10:54 -0800)
We already have a function to verify fsb pointers, so get rid of the
last users of the (less robust) macro.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_bmap_btree.c
fs/xfs/libxfs/xfs_btree.c
fs/xfs/libxfs/xfs_btree.h

index 1bddbba6b80c960bdcc10c9a30210c119e1b2f77..140744700b07e8cc16d5f8dba8c932e71093dbcf 100644 (file)
@@ -400,7 +400,7 @@ xfs_bmap_check_leaf_extents(
                pp = XFS_BMBT_PTR_ADDR(mp, block, 1, mp->m_bmap_dmxr[1]);
                bno = be64_to_cpu(*pp);
                XFS_WANT_CORRUPTED_GOTO(mp,
-                                       XFS_FSB_SANITY_CHECK(mp, bno), error0);
+                                       xfs_verify_fsbno(mp, bno), error0);
                if (bp_release) {
                        bp_release = 0;
                        xfs_trans_brelse(NULL, bp);
@@ -1220,7 +1220,7 @@ xfs_iread_extents(
                pp = XFS_BMBT_PTR_ADDR(mp, block, 1, mp->m_bmap_dmxr[1]);
                bno = be64_to_cpu(*pp);
                XFS_WANT_CORRUPTED_GOTO(mp,
-                       XFS_FSB_SANITY_CHECK(mp, bno), out_brelse);
+                       xfs_verify_fsbno(mp, bno), out_brelse);
                xfs_trans_brelse(tp, bp);
        }
 
index c10aecaaae441866013ef88a769f7dc06070837d..00472e184e7c550056e22e5acef94d76b9d2523c 100644 (file)
@@ -470,11 +470,11 @@ xfs_bmbt_verify(
        /* sibling pointer verification */
        if (!block->bb_u.l.bb_leftsib ||
            (block->bb_u.l.bb_leftsib != cpu_to_be64(NULLFSBLOCK) &&
-            !XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_u.l.bb_leftsib))))
+            !xfs_verify_fsbno(mp, be64_to_cpu(block->bb_u.l.bb_leftsib))))
                return false;
        if (!block->bb_u.l.bb_rightsib ||
            (block->bb_u.l.bb_rightsib != cpu_to_be64(NULLFSBLOCK) &&
-            !XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_u.l.bb_rightsib))))
+            !xfs_verify_fsbno(mp, be64_to_cpu(block->bb_u.l.bb_rightsib))))
                return false;
 
        return true;
index 5f33adf8eecb91f0a49c2b3081921404be00230d..54c0a927a0fab5f4d0fa8d4b69031e713cb197c1 100644 (file)
@@ -853,7 +853,7 @@ xfs_btree_read_bufl(
        xfs_daddr_t             d;              /* real disk block address */
        int                     error;
 
-       if (!XFS_FSB_SANITY_CHECK(mp, fsbno))
+       if (!xfs_verify_fsbno(mp, fsbno))
                return -EFSCORRUPTED;
        d = XFS_FSB_TO_DADDR(mp, fsbno);
        error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d,
index b57501c6f71ded2c611ed1024793186dcecc4f93..b495381b629f4316dffa26aa60f56bbe29796045 100644 (file)
@@ -473,10 +473,6 @@ static inline int xfs_btree_get_level(struct xfs_btree_block *block)
 #define        XFS_FILBLKS_MIN(a,b)    min_t(xfs_filblks_t, (a), (b))
 #define        XFS_FILBLKS_MAX(a,b)    max_t(xfs_filblks_t, (a), (b))
 
-#define        XFS_FSB_SANITY_CHECK(mp,fsb)    \
-       (fsb && XFS_FSB_TO_AGNO(mp, fsb) < mp->m_sb.sb_agcount && \
-               XFS_FSB_TO_AGBNO(mp, fsb) < mp->m_sb.sb_agblocks)
-
 /*
  * Trace hooks.  Currently not implemented as they need to be ported
  * over to the generic tracing functionality, which is some effort.