]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: mark xfs_dir_isempty static
authorChristoph Hellwig <hch@lst.de>
Mon, 6 Jan 2025 09:50:29 +0000 (10:50 +0100)
committerCarlos Maiolino <cem@kernel.org>
Wed, 8 Jan 2025 13:46:55 +0000 (14:46 +0100)
And return bool instead of a boolean condition as int.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/libxfs/xfs_dir2.c
fs/xfs/libxfs/xfs_dir2.h

index 202468223bf9437a61a43472ca27f0fc6a9ba975..81aaef2f495ed607409a3e33b2ba03f399e0bf98 100644 (file)
@@ -197,7 +197,7 @@ xfs_da_unmount(
 /*
  * Return 1 if directory contains only "." and "..".
  */
-int
+static bool
 xfs_dir_isempty(
        xfs_inode_t     *dp)
 {
@@ -205,9 +205,9 @@ xfs_dir_isempty(
 
        ASSERT(S_ISDIR(VFS_I(dp)->i_mode));
        if (dp->i_disk_size == 0)       /* might happen during shutdown. */
-               return 1;
+               return true;
        if (dp->i_disk_size > xfs_inode_data_fork_size(dp))
-               return 0;
+               return false;
        sfp = dp->i_df.if_data;
        return !sfp->count;
 }
index 576068ed81fac275feb60eaa67a4cd2d45cb46ae..a6594a5a941d9f394eb9aa66f45bc2d5ac4a363a 100644 (file)
@@ -58,7 +58,6 @@ extern void xfs_dir_startup(void);
 extern int xfs_da_mount(struct xfs_mount *mp);
 extern void xfs_da_unmount(struct xfs_mount *mp);
 
-extern int xfs_dir_isempty(struct xfs_inode *dp);
 extern int xfs_dir_init(struct xfs_trans *tp, struct xfs_inode *dp,
                                struct xfs_inode *pdp);
 extern int xfs_dir_createname(struct xfs_trans *tp, struct xfs_inode *dp,