]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs: use a lockref for the xfs_dquot reference count
authorChristoph Hellwig <hch@lst.de>
Sun, 22 Feb 2026 22:41:00 +0000 (14:41 -0800)
committerAndrey Albershteyn <aalbersh@kernel.org>
Mon, 2 Mar 2026 09:54:27 +0000 (10:54 +0100)
Source kernel commit: 0c5e80bd579f7bec3704bad6c1f72b13b0d73b53

The xfs_dquot structure currently uses the anti-pattern of using the
in-object lock that protects the content to also serialize reference
count updates for the structure, leading to a cumbersome free path.
This is partially papered over by the fact that we never free the dquot
directly but always through the LRU.  Switch to use a lockref instead and
move the reference counter manipulations out of q_qlock.

To make this work, xfs_qm_flush_one and xfs_qm_flush_one are converted to
acquire a dquot reference while flushing to integrate with the lockref
"get if not dead" scheme.

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

index 763d941a8420c5aefb5bf175edba737e80ee76cd..551d7ae46c5c21d7471ad3d4a5110b8a03fbaaa2 100644 (file)
@@ -29,11 +29,9 @@ typedef uint8_t              xfs_dqtype_t;
  * flags for q_flags field in the dquot.
  */
 #define XFS_DQFLAG_DIRTY       (1u << 0)       /* dquot is dirty */
-#define XFS_DQFLAG_FREEING     (1u << 1)       /* dquot is being torn down */
 
 #define XFS_DQFLAG_STRINGS \
-       { XFS_DQFLAG_DIRTY,     "DIRTY" }, \
-       { XFS_DQFLAG_FREEING,   "FREEING" }
+       { XFS_DQFLAG_DIRTY,     "DIRTY" }
 
 /*
  * We have the possibility of all three quota types being active at once, and