Commit d55b9e68 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba
Browse files

btrfs: rely on owning_root field in btrfs_add_delayed_tree_ref to detect CHUNK_ROOT



The real_root field is going to be used only by ref-verify tool so limit
its use outside of it. Blocks belonging to the chunk root will always
have it as an owner so the check is equivalent.

Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 113479d5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -906,7 +906,7 @@ int btrfs_add_delayed_tree_ref(struct btrfs_trans_handle *trans,
	u64 parent = generic_ref->parent;
	u8 ref_type;

	is_system = (generic_ref->real_root == BTRFS_CHUNK_TREE_OBJECTID);
	is_system = (generic_ref->tree_ref.owning_root == BTRFS_CHUNK_TREE_OBJECTID);

	ASSERT(generic_ref->type == BTRFS_REF_METADATA && generic_ref->action);
	BUG_ON(extent_op && extent_op->is_data);