diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-08-06 20:05:39 +0200 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-08-06 20:05:39 +0200 |
commit | 62af7d54a0ec0b6f99d7d55ebeb9ecbb3371bc67 (patch) | |
tree | 6f84614bb99e565466b9e83943bace936c3d1f25 /fs/xfs/xfs_icache.c | |
parent | xfs: move xfs_inactive call to xfs_inode_mark_reclaimable (diff) | |
download | linux-62af7d54a0ec0b6f99d7d55ebeb9ecbb3371bc67.tar.xz linux-62af7d54a0ec0b6f99d7d55ebeb9ecbb3371bc67.zip |
xfs: detach dquots from inode if we don't need to inactivate it
If we don't need to inactivate an inode, we can detach the dquots and
move on to reclamation. This isn't strictly required here; it's a
preparation patch for deferred inactivation per reviewer request[1] to
move the creation of xfs_inode_needs_inactivation into a separate
change. Eventually this !need_inactive chunk will turn into the code
path for inodes that skip xfs_inactive and go straight to memory
reclaim.
[1] https://lore.kernel.org/linux-xfs/20210609012838.GW2945738@locust/T/#mca6d958521cb88bbc1bfe1a30767203328d410b5
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_icache.c')
-rw-r--r-- | fs/xfs/xfs_icache.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index f0e77ed0b8bb..b9214733d0c3 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -1752,8 +1752,14 @@ xfs_inode_mark_reclaimable( { struct xfs_mount *mp = ip->i_mount; struct xfs_perag *pag; + bool need_inactive = xfs_inode_needs_inactive(ip); - xfs_inactive(ip); + if (!need_inactive) { + /* Going straight to reclaim, so drop the dquots. */ + xfs_qm_dqdetach(ip); + } else { + xfs_inactive(ip); + } if (!XFS_FORCED_SHUTDOWN(mp) && ip->i_delayed_blks) { xfs_check_delalloc(ip, XFS_DATA_FORK); |