Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

btrfs: Pass btrfs_delayed_extent_op to alloc_reserved_tree_block



Instead of taking only specific member of this structure, which results
in 2 extra arguments, just take the delayed_extent_op struct and
reference the arguments inside the functions. No functional changes.

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 4e6bd4e0
Loading
Loading
Loading
Loading
+5 −6
Original line number Original line Diff line number Diff line
@@ -67,7 +67,7 @@ static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
				      struct btrfs_key *ins, int ref_mod);
				      struct btrfs_key *ins, int ref_mod);
static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
				     struct btrfs_delayed_ref_node *node,
				     struct btrfs_delayed_ref_node *node,
				     u64 flags, struct btrfs_disk_key *key);
				     struct btrfs_delayed_extent_op *extent_op);
static int do_chunk_alloc(struct btrfs_trans_handle *trans,
static int do_chunk_alloc(struct btrfs_trans_handle *trans,
			  struct btrfs_fs_info *fs_info, u64 flags,
			  struct btrfs_fs_info *fs_info, u64 flags,
			  int force);
			  int force);
@@ -2448,9 +2448,7 @@ static int run_delayed_tree_ref(struct btrfs_trans_handle *trans,
	}
	}
	if (node->action == BTRFS_ADD_DELAYED_REF && insert_reserved) {
	if (node->action == BTRFS_ADD_DELAYED_REF && insert_reserved) {
		BUG_ON(!extent_op || !extent_op->update_flags);
		BUG_ON(!extent_op || !extent_op->update_flags);
		ret = alloc_reserved_tree_block(trans, node,
		ret = alloc_reserved_tree_block(trans, node, extent_op);
						extent_op->flags_to_set,
						&extent_op->key);
	} else if (node->action == BTRFS_ADD_DELAYED_REF) {
	} else if (node->action == BTRFS_ADD_DELAYED_REF) {
		ret = __btrfs_inc_extent_ref(trans, fs_info, node,
		ret = __btrfs_inc_extent_ref(trans, fs_info, node,
					     parent, ref_root,
					     parent, ref_root,
@@ -8132,7 +8130,7 @@ static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans,


static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
				     struct btrfs_delayed_ref_node *node,
				     struct btrfs_delayed_ref_node *node,
				     u64 flags, struct btrfs_disk_key *key)
				     struct btrfs_delayed_extent_op *extent_op)
{
{
	struct btrfs_fs_info *fs_info = trans->fs_info;
	struct btrfs_fs_info *fs_info = trans->fs_info;
	int ret;
	int ret;
@@ -8146,6 +8144,7 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
	u32 size = sizeof(*extent_item) + sizeof(*iref);
	u32 size = sizeof(*extent_item) + sizeof(*iref);
	u64 num_bytes;
	u64 num_bytes;
	u64 parent;
	u64 parent;
	u64 flags = extent_op->flags_to_set;
	bool skinny_metadata = btrfs_fs_incompat(fs_info, SKINNY_METADATA);
	bool skinny_metadata = btrfs_fs_incompat(fs_info, SKINNY_METADATA);


	ref = btrfs_delayed_node_to_tree_ref(node);
	ref = btrfs_delayed_node_to_tree_ref(node);
@@ -8198,7 +8197,7 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
		iref = (struct btrfs_extent_inline_ref *)(extent_item + 1);
		iref = (struct btrfs_extent_inline_ref *)(extent_item + 1);
	} else {
	} else {
		block_info = (struct btrfs_tree_block_info *)(extent_item + 1);
		block_info = (struct btrfs_tree_block_info *)(extent_item + 1);
		btrfs_set_tree_block_key(leaf, block_info, key);
		btrfs_set_tree_block_key(leaf, block_info, &extent_op->key);
		btrfs_set_tree_block_level(leaf, block_info, ref->level);
		btrfs_set_tree_block_level(leaf, block_info, ref->level);
		iref = (struct btrfs_extent_inline_ref *)(block_info + 1);
		iref = (struct btrfs_extent_inline_ref *)(block_info + 1);
	}
	}