]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: teach buftargs to maintain their own buffer hashtable
authorDarrick J. Wong <djwong@kernel.org>
Mon, 22 Apr 2024 17:01:10 +0000 (10:01 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 3 Jun 2024 18:37:40 +0000 (11:37 -0700)
commitb944a053482684915db67612f29337ba85f6a86d
tree7f203995e457ee2a1cb984c7071de0f36670d0f4
parentd9bbcebf2456e1f302ca9b637c76e9201ddad4b4
xfs: teach buftargs to maintain their own buffer hashtable

Source kernel commit: e7b58f7c1be20550d4f51cec6307b811e7555f52

Currently, cached buffers are indexed by per-AG hashtables.  This works
great for the data device, but won't work for in-memory btrees.  To
handle that use case, buftargs will need to be able to index buffers
independently of other data structures.

We accomplish this by hoisting the rhashtable and its lock into a
separate xfs_buf_cache structure, make the buftarg point to the
_buf_cache structure, and rework various functions to use it.  This
will enable the in-memory buftarg to come up with its own _buf_cache.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
libxfs/libxfs_priv.h
libxfs/xfs_ag.c
libxfs/xfs_ag.h