|
@@ -3073,10 +3073,10 @@ static int __btrfs_mod_ref(struct btrfs_trans_handle *trans,
|
|
|
int (*process_func)(struct btrfs_trans_handle *, struct btrfs_root *,
|
|
|
u64, u64, u64, u64, u64, u64, int);
|
|
|
|
|
|
-#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
|
|
|
- if (unlikely(test_bit(BTRFS_ROOT_DUMMY_ROOT, &root->state)))
|
|
|
+
|
|
|
+ if (btrfs_test_is_dummy_root(root))
|
|
|
return 0;
|
|
|
-#endif
|
|
|
+
|
|
|
ref_root = btrfs_header_owner(buf);
|
|
|
nritems = btrfs_header_nritems(buf);
|
|
|
level = btrfs_header_level(buf);
|
|
@@ -6264,10 +6264,9 @@ int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root *root,
|
|
|
int ret;
|
|
|
struct btrfs_fs_info *fs_info = root->fs_info;
|
|
|
|
|
|
-#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
|
|
|
- if (unlikely(test_bit(BTRFS_ROOT_DUMMY_ROOT, &root->state)))
|
|
|
+ if (btrfs_test_is_dummy_root(root))
|
|
|
return 0;
|
|
|
-#endif
|
|
|
+
|
|
|
add_pinned_bytes(root->fs_info, num_bytes, owner, root_objectid);
|
|
|
|
|
|
/*
|
|
@@ -7336,15 +7335,14 @@ struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
|
|
|
bool skinny_metadata = btrfs_fs_incompat(root->fs_info,
|
|
|
SKINNY_METADATA);
|
|
|
|
|
|
-#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
|
|
|
- if (unlikely(test_bit(BTRFS_ROOT_DUMMY_ROOT, &root->state))) {
|
|
|
+ if (btrfs_test_is_dummy_root(root)) {
|
|
|
buf = btrfs_init_new_buffer(trans, root, root->alloc_bytenr,
|
|
|
blocksize, level);
|
|
|
if (!IS_ERR(buf))
|
|
|
root->alloc_bytenr += blocksize;
|
|
|
return buf;
|
|
|
}
|
|
|
-#endif
|
|
|
+
|
|
|
block_rsv = use_block_rsv(trans, root, blocksize);
|
|
|
if (IS_ERR(block_rsv))
|
|
|
return ERR_CAST(block_rsv);
|