aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rtalloc.c
diff options
context:
space:
mode:
authorDarrick J. Wong <[email protected]>2024-11-21 00:20:53 +0000
committerDarrick J. Wong <[email protected]>2024-12-23 21:06:11 +0000
commitbf0b99411335db18a9ed4fcef278ce9e313f6076 (patch)
tree689bc485eee4ce2c73af290945b2881e7496ed5f /fs/xfs/xfs_rtalloc.c
parentxfs: add realtime refcount btree inode to metadata directory (diff)
downloadkernel-bf0b99411335db18a9ed4fcef278ce9e313f6076.tar.gz
kernel-bf0b99411335db18a9ed4fcef278ce9e313f6076.zip
xfs: add metadata reservations for realtime refcount btree
Reserve some free blocks so that we will always have enough free blocks in the data volume to handle expansion of the realtime refcount btree. Signed-off-by: "Darrick J. Wong" <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
-rw-r--r--fs/xfs/xfs_rtalloc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index a69967f9d88e..294aa0739be3 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -31,6 +31,7 @@
#include "xfs_rtgroup.h"
#include "xfs_error.h"
#include "xfs_trace.h"
+#include "xfs_rtrefcount_btree.h"
/*
* Return whether there are any free extents in the size range given
@@ -1547,6 +1548,11 @@ xfs_rt_resv_init(
err2 = xfs_metafile_resv_init(rtg_rmap(rtg), ask);
if (err2 && !error)
error = err2;
+
+ ask = xfs_rtrefcountbt_calc_reserves(mp);
+ err2 = xfs_metafile_resv_init(rtg_refcount(rtg), ask);
+ if (err2 && !error)
+ error = err2;
}
return error;