summaryrefslogtreecommitdiff
path: root/fs/btrfs/block-rsv.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-11-05 16:45:45 -0400
committerDavid Sterba <dsterba@suse.com>2022-01-03 15:09:49 +0100
commit29cbcf401793f4e2c871c846edc2191731df2c41 (patch)
tree7209de0f3bb79a2516def19bbef0934c85753d63 /fs/btrfs/block-rsv.c
parent2e608bd1dd51ee962bded788caee4aa812729e87 (diff)
btrfs: stop accessing ->extent_root directly
When we start having multiple extent roots we'll need to use a helper to get to the correct extent_root. Rename fs_info->extent_root to _extent_root and convert all of the users of the extent root to using the btrfs_extent_root() helper. This will allow us to easily clean up the remaining direct accesses in the future. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/block-rsv.c')
-rw-r--r--fs/btrfs/block-rsv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/block-rsv.c b/fs/btrfs/block-rsv.c
index 454f3c629dd8..b216c4c7292a 100644
--- a/fs/btrfs/block-rsv.c
+++ b/fs/btrfs/block-rsv.c
@@ -6,6 +6,7 @@
#include "space-info.h"
#include "transaction.h"
#include "block-group.h"
+#include "disk-io.h"
/*
* HOW DO BLOCK RESERVES WORK
@@ -351,6 +352,7 @@ void btrfs_update_global_block_rsv(struct btrfs_fs_info *fs_info)
{
struct btrfs_block_rsv *block_rsv = &fs_info->global_block_rsv;
struct btrfs_space_info *sinfo = block_rsv->space_info;
+ struct btrfs_root *extent_root = btrfs_extent_root(fs_info, 0);
u64 num_bytes;
unsigned min_items;
@@ -359,7 +361,7 @@ void btrfs_update_global_block_rsv(struct btrfs_fs_info *fs_info)
* checksum tree and the root tree. If the fs is empty we want to set
* it to a minimal amount for safety.
*/
- num_bytes = btrfs_root_used(&fs_info->extent_root->root_item) +
+ num_bytes = btrfs_root_used(&extent_root->root_item) +
btrfs_root_used(&fs_info->csum_root->root_item) +
btrfs_root_used(&fs_info->tree_root->root_item);