aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_icache.c
diff options
context:
space:
mode:
authorGravatar Darrick J. Wong <djwong@kernel.org> 2021-08-06 11:05:39 -0700
committerGravatar Darrick J. Wong <djwong@kernel.org> 2021-08-06 11:05:39 -0700
commit62af7d54a0ec0b6f99d7d55ebeb9ecbb3371bc67 (patch)
tree6f84614bb99e565466b9e83943bace936c3d1f25 /fs/xfs/xfs_icache.c
parentxfs: move xfs_inactive call to xfs_inode_mark_reclaimable (diff)
downloadlinux-62af7d54a0ec0b6f99d7d55ebeb9ecbb3371bc67.tar.gz
linux-62af7d54a0ec0b6f99d7d55ebeb9ecbb3371bc67.tar.bz2
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.c8
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);