]> Gentwo Git Trees - linux/.git/commit
xfs: use a lockref for the xfs_dquot reference count
authorChristoph Hellwig <hch@lst.de>
Mon, 10 Nov 2025 13:22:57 +0000 (14:22 +0100)
committerCarlos Maiolino <cem@kernel.org>
Tue, 11 Nov 2025 10:45:57 +0000 (11:45 +0100)
commit0c5e80bd579f7bec3704bad6c1f72b13b0d73b53
tree51be9ec5f30da3d0229e243bc9b7e79d8f1f122d
parent6129b088e1f10938b86f44948ad698b39dd19faa
xfs: use a lockref for the xfs_dquot reference count

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>
fs/xfs/libxfs/xfs_quota_defs.h
fs/xfs/xfs_dquot.c
fs/xfs/xfs_dquot.h
fs/xfs/xfs_qm.c
fs/xfs/xfs_trace.h