@@ -343,7 +343,8 @@ static int clear_uuid_tree(struct btrfs_fs_info *fs_info)
ret = btrfs_clear_buffer_dirty(uuid_root->node);
if (ret < 0)
goto out;
- ret = btrfs_free_tree_block(trans, uuid_root, uuid_root->node, 0, 1);
+ ret = btrfs_free_tree_block(trans, btrfs_root_id(uuid_root),
+ uuid_root->node, 0, 1);
if (ret < 0)
goto out;
free_extent_buffer(uuid_root->node);
@@ -870,10 +870,8 @@ int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
struct extent_buffer *buf, int record_parent);
int btrfs_dec_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
struct extent_buffer *buf, int record_parent);
-int btrfs_free_tree_block(struct btrfs_trans_handle *trans,
- struct btrfs_root *root,
- struct extent_buffer *buf,
- u64 parent, int last_ref);
+int btrfs_free_tree_block(struct btrfs_trans_handle *trans, u64 root_id,
+ struct extent_buffer *buf, u64 parent, int last_ref);
int btrfs_free_extent(struct btrfs_trans_handle *trans,
u64 bytenr, u64 num_bytes, u64 parent,
u64 root_objectid, u64 owner, u64 offset);
@@ -2301,7 +2301,7 @@ int btrfs_delete_and_free_root(struct btrfs_trans_handle *trans,
ret = btrfs_clear_buffer_dirty(root->node);
if (ret)
return ret;
- ret = btrfs_free_tree_block(trans, root, root->node, 0, 1);
+ ret = btrfs_free_tree_block(trans, btrfs_root_id(root), root->node, 0, 1);
if (ret)
return ret;
if (is_global_root(root))
@@ -2140,13 +2140,10 @@ fail:
return ret;
}
-int btrfs_free_tree_block(struct btrfs_trans_handle *trans,
- struct btrfs_root *root,
- struct extent_buffer *buf,
- u64 parent, int last_ref)
+int btrfs_free_tree_block(struct btrfs_trans_handle *trans, u64 root_id,
+ struct extent_buffer *buf, u64 parent, int last_ref)
{
- return btrfs_free_extent(trans, buf->start, buf->len, parent,
- root->root_key.objectid,
+ return btrfs_free_extent(trans, buf->start, buf->len, parent, root_id,
btrfs_header_level(buf), 0);
}
In the kernel we pass in the root_id for btrfs_free_tree_block instead of the root itself. Update the btrfs-progs version of the helper to match what we do in the kernel. Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- cmds/rescue.c | 3 ++- kernel-shared/ctree.h | 6 ++---- kernel-shared/disk-io.c | 2 +- kernel-shared/extent-tree.c | 9 +++------ 4 files changed, 8 insertions(+), 12 deletions(-)