Commit d20d5edc authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: clean up inode state flag tests in xfs_blockgc_igrab

Clean up the definition of which inode states are not eligible for
speculative preallocation garbage collecting by creating a private
#define.  The deferred inactivation patchset will add two new entries to
the set of flags-to-ignore, so we want the definition not to end up a
cluttered mess.
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent f427cf5c
...@@ -1533,6 +1533,10 @@ xfs_blockgc_start( ...@@ -1533,6 +1533,10 @@ xfs_blockgc_start(
xfs_blockgc_queue(pag); xfs_blockgc_queue(pag);
} }
/* Don't try to run block gc on an inode that's in any of these states. */
#define XFS_BLOCKGC_NOGRAB_IFLAGS (XFS_INEW | \
XFS_IRECLAIMABLE | \
XFS_IRECLAIM)
/* /*
* Decide if the given @ip is eligible for garbage collection of speculative * Decide if the given @ip is eligible for garbage collection of speculative
* preallocations, and grab it if so. Returns true if it's ready to go or * preallocations, and grab it if so. Returns true if it's ready to go or
...@@ -1551,8 +1555,7 @@ xfs_blockgc_igrab( ...@@ -1551,8 +1555,7 @@ xfs_blockgc_igrab(
if (!ip->i_ino) if (!ip->i_ino)
goto out_unlock_noent; goto out_unlock_noent;
/* avoid new or reclaimable inodes. Leave for reclaim code to flush */ if (ip->i_flags & XFS_BLOCKGC_NOGRAB_IFLAGS)
if (__xfs_iflags_test(ip, XFS_INEW | XFS_IRECLAIMABLE | XFS_IRECLAIM))
goto out_unlock_noent; goto out_unlock_noent;
spin_unlock(&ip->i_flags_lock); spin_unlock(&ip->i_flags_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment