]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: introduce in-core global counter of allocbt blocks
authorBrian Foster <bfoster@redhat.com>
Wed, 30 Jun 2021 22:38:58 +0000 (18:38 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 30 Jun 2021 22:38:58 +0000 (18:38 -0400)
commit92c76be52246a0249d980fd3f210c80338342399
treefe3f9a01c62373eb4c67ebfc205471ac96264f0d
parent3a3e33840c63347afa8aaa5bd8dd90f8ca2d5bec
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>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
include/atomic.h
include/xfs_mount.h
libxfs/xfs_alloc.c
libxfs/xfs_alloc_btree.c