]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfs: make metabtree reservations global
authorChristoph Hellwig <hch@lst.de>
Sat, 15 Feb 2025 06:48:28 +0000 (07:48 +0100)
committerChristoph Hellwig <hch@lst.de>
Mon, 3 Mar 2025 15:16:43 +0000 (08:16 -0700)
commit1df8d75030b787a9fae270b59b93eef809dd2011
tree8a2b25701ffc454e0242c4415c94444165fd0916
parentc0bd736d33844fa0c2f9c5b401b51d5908530b4e
xfs: make metabtree reservations global

Currently each metabtree inode has it's own space reservation to ensure
it can be expanded to the maximum size, mirroring what is done for the
AG-based btrees.  But unlike the AG-based btrees the metabtree inodes
aren't restricted to allocate from a single AG but can use free space
form the entire file system.  And unlike AG-based btrees where the
required reservation shrinks with the available free space due to this,
the metabtree reservations for the rtrmap and rtfreflink trees are not
bound in any way by the data device free space as they track RT extent
allocations.  This is not very efficient as it requires a large number
of blocks to be set aside that can't be used at all by other btrees.

Switch to a model that uses a global pool instead in preparation for
reducing the amount of reserved space, which now also removes the
overloading of the i_nblocks field for metabtree inodes, which would
create problems if metabtree inodes ever had a big enough xattr fork
to require xattr blocks outside the inode.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
fs/xfs/libxfs/xfs_metafile.c
fs/xfs/libxfs/xfs_metafile.h
fs/xfs/scrub/repair.c
fs/xfs/xfs_fsops.c
fs/xfs/xfs_inode.h
fs/xfs/xfs_mount.h
fs/xfs/xfs_reflink.c
fs/xfs/xfs_rtalloc.c
fs/xfs/xfs_rtalloc.h
fs/xfs/xfs_super.c
fs/xfs/xfs_trace.h