]> www.infradead.org Git - linux.git/commitdiff
xfs: rename metadata inode predicates
authorDarrick J. Wong <djwong@kernel.org>
Mon, 4 Nov 2024 04:18:48 +0000 (20:18 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 5 Nov 2024 21:38:30 +0000 (13:38 -0800)
The predicate xfs_internal_inum tells us if an inumber refers to one of
the inodes rooted in the superblock.  Soon we're going to have internal
inodes in a metadata directory tree, so this helper should be renamed
to capture its limited scope.

Ondisk inodes will soon have a flag to indicate that they're metadata
inodes.  Head off some confusion by renaming the xfs_is_metadata_inode
predicate to xfs_is_internal_inode.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_types.c
fs/xfs/libxfs/xfs_types.h
fs/xfs/scrub/common.c
fs/xfs/scrub/inode.c
fs/xfs/scrub/inode_repair.c
fs/xfs/scrub/orphanage.c
fs/xfs/scrub/parent.c
fs/xfs/scrub/refcount_repair.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_inode.h
fs/xfs/xfs_itable.c

index c91db4f51407437342696e8e114d6b5248a8ac48..1cbfe57e971d5cb9cefe31b42ba59e7da23a3a25 100644 (file)
@@ -111,7 +111,7 @@ xfs_verify_ino(
 
 /* Is this an internal inode number? */
 inline bool
-xfs_internal_inum(
+xfs_is_sb_inum(
        struct xfs_mount        *mp,
        xfs_ino_t               ino)
 {
@@ -129,7 +129,7 @@ xfs_verify_dir_ino(
        struct xfs_mount        *mp,
        xfs_ino_t               ino)
 {
-       if (xfs_internal_inum(mp, ino))
+       if (xfs_is_sb_inum(mp, ino))
                return false;
        return xfs_verify_ino(mp, ino);
 }
index d3cb6ff3b913014c3b0817d6189804168969388f..25053a66c225ed257e099a1e7f26f00bc6827f1c 100644 (file)
@@ -230,7 +230,7 @@ bool xfs_verify_fsbext(struct xfs_mount *mp, xfs_fsblock_t fsbno,
                xfs_fsblock_t len);
 
 bool xfs_verify_ino(struct xfs_mount *mp, xfs_ino_t ino);
-bool xfs_internal_inum(struct xfs_mount *mp, xfs_ino_t ino);
+bool xfs_is_sb_inum(struct xfs_mount *mp, xfs_ino_t ino);
 bool xfs_verify_dir_ino(struct xfs_mount *mp, xfs_ino_t ino);
 bool xfs_verify_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno);
 bool xfs_verify_rtbext(struct xfs_mount *mp, xfs_rtblock_t rtbno,
index e8b5e73bab60d30f0bfd65e9594b3e40f3d90a53..777959f8ec724b031215103b948d172f7c6bc1fe 100644 (file)
@@ -948,7 +948,7 @@ xchk_iget_for_scrubbing(
                return xchk_install_live_inode(sc, ip_in);
 
        /* Reject internal metadata files and obviously bad inode numbers. */
-       if (xfs_internal_inum(mp, sc->sm->sm_ino))
+       if (xfs_is_sb_inum(mp, sc->sm->sm_ino))
                return -ENOENT;
        if (!xfs_verify_ino(sc->mp, sc->sm->sm_ino))
                return -ENOENT;
index d32716fb2fecf7419b1c6b5f3a63a67e8ba7e02b..4a8637afb0e29be0cb5b2e89785e7812b09bc17a 100644 (file)
@@ -95,7 +95,7 @@ xchk_setup_inode(
        }
 
        /* Reject internal metadata files and obviously bad inode numbers. */
-       if (xfs_internal_inum(mp, sc->sm->sm_ino))
+       if (xfs_is_sb_inum(mp, sc->sm->sm_ino))
                return -ENOENT;
        if (!xfs_verify_ino(sc->mp, sc->sm->sm_ino))
                return -ENOENT;
index 5da9e1a387a8bbc70416751ab8eeeaa3124ea352..9085d6d11aebcd03f769469f74db92ca8bde67c8 100644 (file)
@@ -1762,7 +1762,7 @@ xrep_inode_pptr(
         * Metadata inodes are rooted in the superblock and do not have any
         * parents.
         */
-       if (xfs_is_metadata_inode(ip))
+       if (xfs_is_internal_inode(ip))
                return 0;
 
        /* Inode already has an attr fork; no further work possible here. */
index 7148d8362db8330306dcbd5c46ffacfae4de1c80..5f0d4239260862c2d20d461a865932fe7e486be0 100644 (file)
@@ -295,7 +295,7 @@ xrep_orphanage_can_adopt(
                return false;
        if (sc->ip == sc->orphanage)
                return false;
-       if (xfs_internal_inum(sc->mp, sc->ip->i_ino))
+       if (xfs_is_sb_inum(sc->mp, sc->ip->i_ino))
                return false;
        return true;
 }
index 91e7b51ce0680bc891206255afd4fe20f5f78739..20711a68a874824ae57492d2c5fdad3aa389445e 100644 (file)
@@ -910,7 +910,7 @@ xchk_pptr_looks_zapped(
         * any parents.  Hence the attr fork will not be initialized, but
         * there are no parent pointers that might have been zapped.
         */
-       if (xfs_is_metadata_inode(ip))
+       if (xfs_is_internal_inode(ip))
                return false;
 
        /*
index 4240fff459cb1d4f837b5ae5842f8b5b86b3d64e..4e572b81c98669e38ee349fc32f06058d197c0d9 100644 (file)
@@ -215,7 +215,7 @@ xrep_refc_rmap_shareable(
                return false;
 
        /* Metadata in files are never shareable */
-       if (xfs_internal_inum(mp, rmap->rm_owner))
+       if (xfs_is_sb_inum(mp, rmap->rm_owner))
                return false;
 
        /* Metadata and unwritten file blocks are not shareable. */
index a8430f30d6df29b8614a8396539a1299577edca2..0465546010554a6deeacbf46c7007522e3c4e308 100644 (file)
@@ -1295,7 +1295,7 @@ xfs_inode_needs_inactive(
                return false;
 
        /* Metadata inodes require explicit resource cleanup. */
-       if (xfs_is_metadata_inode(ip))
+       if (xfs_is_internal_inode(ip))
                return false;
 
        /* Want to clean out the cow blocks if there are any. */
@@ -1388,7 +1388,7 @@ xfs_inactive(
                goto out;
 
        /* Metadata inodes require explicit resource cleanup. */
-       if (xfs_is_metadata_inode(ip))
+       if (xfs_is_internal_inode(ip))
                goto out;
 
        /* Try to clean out the cow blocks if there are any. */
index 41444a557576c12f8e190771b9ad00437f5aac7d..df7262f4674f7813fa4f90fcc83c8016aebf8a37 100644 (file)
@@ -276,7 +276,7 @@ static inline bool xfs_is_reflink_inode(const struct xfs_inode *ip)
        return ip->i_diflags2 & XFS_DIFLAG2_REFLINK;
 }
 
-static inline bool xfs_is_metadata_inode(const struct xfs_inode *ip)
+static inline bool xfs_is_internal_inode(const struct xfs_inode *ip)
 {
        struct xfs_mount        *mp = ip->i_mount;
 
index c0757ab994957ba2d14d43df9c4faebaf31e0aad..37c2b50d877e42f4b34c5004028687f78df9de7b 100644 (file)
@@ -69,7 +69,7 @@ xfs_bulkstat_one_int(
        vfsuid_t                vfsuid;
        vfsgid_t                vfsgid;
 
-       if (xfs_internal_inum(mp, ino))
+       if (xfs_is_sb_inum(mp, ino))
                goto out_advance;
 
        error = xfs_iget(mp, tp, ino,