xfs: rename metadata inode predicates

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>
This commit is contained in:
Darrick J. Wong 2024-11-03 20:18:48 -08:00
parent fdf5703b61
commit 4d272929a5
11 changed files with 13 additions and 13 deletions

View File

@ -111,7 +111,7 @@ xfs_verify_ino(
/* Is this an internal inode number? */ /* Is this an internal inode number? */
inline bool inline bool
xfs_internal_inum( xfs_is_sb_inum(
struct xfs_mount *mp, struct xfs_mount *mp,
xfs_ino_t ino) xfs_ino_t ino)
{ {
@ -129,7 +129,7 @@ xfs_verify_dir_ino(
struct xfs_mount *mp, struct xfs_mount *mp,
xfs_ino_t ino) xfs_ino_t ino)
{ {
if (xfs_internal_inum(mp, ino)) if (xfs_is_sb_inum(mp, ino))
return false; return false;
return xfs_verify_ino(mp, ino); return xfs_verify_ino(mp, ino);
} }

View File

@ -230,7 +230,7 @@ bool xfs_verify_fsbext(struct xfs_mount *mp, xfs_fsblock_t fsbno,
xfs_fsblock_t len); xfs_fsblock_t len);
bool xfs_verify_ino(struct xfs_mount *mp, xfs_ino_t ino); 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_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_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno);
bool xfs_verify_rtbext(struct xfs_mount *mp, xfs_rtblock_t rtbno, bool xfs_verify_rtbext(struct xfs_mount *mp, xfs_rtblock_t rtbno,

View File

@ -948,7 +948,7 @@ xchk_iget_for_scrubbing(
return xchk_install_live_inode(sc, ip_in); return xchk_install_live_inode(sc, ip_in);
/* Reject internal metadata files and obviously bad inode numbers. */ /* 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; return -ENOENT;
if (!xfs_verify_ino(sc->mp, sc->sm->sm_ino)) if (!xfs_verify_ino(sc->mp, sc->sm->sm_ino))
return -ENOENT; return -ENOENT;

View File

@ -95,7 +95,7 @@ xchk_setup_inode(
} }
/* Reject internal metadata files and obviously bad inode numbers. */ /* 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; return -ENOENT;
if (!xfs_verify_ino(sc->mp, sc->sm->sm_ino)) if (!xfs_verify_ino(sc->mp, sc->sm->sm_ino))
return -ENOENT; return -ENOENT;

View File

@ -1762,7 +1762,7 @@ xrep_inode_pptr(
* Metadata inodes are rooted in the superblock and do not have any * Metadata inodes are rooted in the superblock and do not have any
* parents. * parents.
*/ */
if (xfs_is_metadata_inode(ip)) if (xfs_is_internal_inode(ip))
return 0; return 0;
/* Inode already has an attr fork; no further work possible here. */ /* Inode already has an attr fork; no further work possible here. */

View File

@ -295,7 +295,7 @@ xrep_orphanage_can_adopt(
return false; return false;
if (sc->ip == sc->orphanage) if (sc->ip == sc->orphanage)
return false; 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 false;
return true; return true;
} }

View File

@ -910,7 +910,7 @@ xchk_pptr_looks_zapped(
* any parents. Hence the attr fork will not be initialized, but * any parents. Hence the attr fork will not be initialized, but
* there are no parent pointers that might have been zapped. * there are no parent pointers that might have been zapped.
*/ */
if (xfs_is_metadata_inode(ip)) if (xfs_is_internal_inode(ip))
return false; return false;
/* /*

View File

@ -215,7 +215,7 @@ xrep_refc_rmap_shareable(
return false; return false;
/* Metadata in files are never shareable */ /* 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; return false;
/* Metadata and unwritten file blocks are not shareable. */ /* Metadata and unwritten file blocks are not shareable. */

View File

@ -1295,7 +1295,7 @@ xfs_inode_needs_inactive(
return false; return false;
/* Metadata inodes require explicit resource cleanup. */ /* Metadata inodes require explicit resource cleanup. */
if (xfs_is_metadata_inode(ip)) if (xfs_is_internal_inode(ip))
return false; return false;
/* Want to clean out the cow blocks if there are any. */ /* Want to clean out the cow blocks if there are any. */
@ -1388,7 +1388,7 @@ xfs_inactive(
goto out; goto out;
/* Metadata inodes require explicit resource cleanup. */ /* Metadata inodes require explicit resource cleanup. */
if (xfs_is_metadata_inode(ip)) if (xfs_is_internal_inode(ip))
goto out; goto out;
/* Try to clean out the cow blocks if there are any. */ /* Try to clean out the cow blocks if there are any. */

View File

@ -276,7 +276,7 @@ static inline bool xfs_is_reflink_inode(const struct xfs_inode *ip)
return ip->i_diflags2 & XFS_DIFLAG2_REFLINK; 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; struct xfs_mount *mp = ip->i_mount;

View File

@ -69,7 +69,7 @@ xfs_bulkstat_one_int(
vfsuid_t vfsuid; vfsuid_t vfsuid;
vfsgid_t vfsgid; vfsgid_t vfsgid;
if (xfs_internal_inum(mp, ino)) if (xfs_is_sb_inum(mp, ino))
goto out_advance; goto out_advance;
error = xfs_iget(mp, tp, ino, error = xfs_iget(mp, tp, ino,