]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: introduce in-core global counter of allocbt blocks libxfs-5.13-sync_2021-05-21
authorBrian Foster <bfoster@redhat.com>
Wed, 5 May 2021 16:11:33 +0000 (09:11 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 21 May 2021 15:31:36 +0000 (08:31 -0700)
commit03f7483ae5729b28a25b50865e0750fdcb83d4a8
tree0d9a4444de4d3fb491cb3b2496c915134fffe3ee
parenta2edde27612722e4fa18ae4e1327e852dab8fb58
xfs: introduce in-core global counter of allocbt blocks

Source kernel commit: 16eaab839a9273ed156ebfccbd40c15d1e72f3d8

Introduce an in-core counter to track the sum of all allocbt blocks
used by the filesystem. This value is currently tracked per-ag via
the ->agf_btreeblks field in the AGF, which also happens to include
rmapbt blocks. A global, in-core count of allocbt blocks is required
to identify the subset of global ->m_fdblocks that consists of
unavailable blocks currently used for allocation btrees. To support
this calculation at block reservation time, construct a similar
global counter for allocbt blocks, populate it on first read of each
AGF and update it as allocbt blocks are used and released.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
include/atomic.h
include/xfs_mount.h
libxfs/xfs_alloc.c
libxfs/xfs_alloc_btree.c