summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/fscounters.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-09-01 11:18:02 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-10-22 16:41:05 -0700
commit152c188d84f14c7e1681c30a8f96f231aa448dc1 (patch)
tree647f268e3e55c4d4d78f6d9b077d3fae865357ef /fs/xfs/scrub/fscounters.c
parent67a47d42707371e7eae75a257ea5f252f3ae9689 (diff)
xfs: create a noalloc mode for allocation groups
Create a new noalloc state for the per-AG structure that will disable block allocation in this AG. We accomplish this by subtracting from fdblocks all the free blocks in this AG, hiding those blocks from the allocator, and preventing freed blocks from updating fdblocks until we're ready to lift noalloc mode. Note that we reduce the free block count of the filesystem so that we can prevent transactions from entering the allocator looking for "free" space that we've turned off incore. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/scrub/fscounters.c')
-rw-r--r--fs/xfs/scrub/fscounters.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/scrub/fscounters.c b/fs/xfs/scrub/fscounters.c
index 22bb734fb81a..7fa2d1fdcc1b 100644
--- a/fs/xfs/scrub/fscounters.c
+++ b/fs/xfs/scrub/fscounters.c
@@ -240,7 +240,8 @@ retry:
*/
fsc->fdblocks -= pag->pag_meta_resv.ar_reserved;
fsc->fdblocks -= pag->pag_rmapbt_resv.ar_orig_reserved;
-
+ if (pag->pagf_noalloc)
+ fsc->fdblocks -= xfs_ag_fdblocks(pag);
}
if (pag)
xfs_perag_put(pag);