]> git.ipfire.org Git - thirdparty/linux.git/commit
xfs: use a lockref for the buffer reference count
authorChristoph Hellwig <hch@lst.de>
Mon, 23 Mar 2026 07:50:52 +0000 (08:50 +0100)
committerCarlos Maiolino <cem@kernel.org>
Mon, 30 Mar 2026 14:34:05 +0000 (16:34 +0200)
commitd02ee47bbeedd10d36cc408f92e645447cf5495d
tree8d36b773c95cf11bb757f050af0eb58dcb0d2128
parent67fe4303972eb6f911f62e2fe6ac7628b17d95c0
xfs: use a lockref for the buffer reference count

The lockref structure allows incrementing/decrementing counters like
an atomic_t for the fast path, while still allowing complex slow path
operations as if the counter was protected by a lock.  The only slow
path operations that actually need to take the lock are the final
put, LRU evictions and marking a buffer stale.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_buf.c
fs/xfs/xfs_buf.h
fs/xfs/xfs_trace.h