Commit 88b2d088 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba

btrfs: remove refs_to_add argument from __btrfs_inc_extent_ref()

Currently the 'refs_to_add' argument of __btrfs_inc_extent_ref() always
matches the value of node->ref_mod, so remove the argument and use
node->ref_mod at __btrfs_inc_extent_ref().
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent abff279e
...@@ -1465,8 +1465,6 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans, ...@@ -1465,8 +1465,6 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
* always passed as 0. For data extents it is the fileoffset * always passed as 0. For data extents it is the fileoffset
* this extent belongs to. * this extent belongs to.
* *
* @refs_to_add Number of references to add
*
* @extent_op Pointer to a structure, holding information necessary when * @extent_op Pointer to a structure, holding information necessary when
* updating a tree block's flags * updating a tree block's flags
* *
...@@ -1474,7 +1472,7 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans, ...@@ -1474,7 +1472,7 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans, static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
struct btrfs_delayed_ref_node *node, struct btrfs_delayed_ref_node *node,
u64 parent, u64 root_objectid, u64 parent, u64 root_objectid,
u64 owner, u64 offset, int refs_to_add, u64 owner, u64 offset,
struct btrfs_delayed_extent_op *extent_op) struct btrfs_delayed_extent_op *extent_op)
{ {
struct btrfs_path *path; struct btrfs_path *path;
...@@ -1484,6 +1482,7 @@ static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans, ...@@ -1484,6 +1482,7 @@ static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
u64 bytenr = node->bytenr; u64 bytenr = node->bytenr;
u64 num_bytes = node->num_bytes; u64 num_bytes = node->num_bytes;
u64 refs; u64 refs;
int refs_to_add = node->ref_mod;
int ret; int ret;
path = btrfs_alloc_path(); path = btrfs_alloc_path();
...@@ -1562,7 +1561,7 @@ static int run_delayed_data_ref(struct btrfs_trans_handle *trans, ...@@ -1562,7 +1561,7 @@ static int run_delayed_data_ref(struct btrfs_trans_handle *trans,
} else if (node->action == BTRFS_ADD_DELAYED_REF) { } else if (node->action == BTRFS_ADD_DELAYED_REF) {
ret = __btrfs_inc_extent_ref(trans, node, parent, ref_root, ret = __btrfs_inc_extent_ref(trans, node, parent, ref_root,
ref->objectid, ref->offset, ref->objectid, ref->offset,
node->ref_mod, extent_op); extent_op);
} else if (node->action == BTRFS_DROP_DELAYED_REF) { } else if (node->action == BTRFS_DROP_DELAYED_REF) {
ret = __btrfs_free_extent(trans, node, parent, ret = __btrfs_free_extent(trans, node, parent,
ref_root, ref->objectid, ref_root, ref->objectid,
...@@ -1713,7 +1712,7 @@ static int run_delayed_tree_ref(struct btrfs_trans_handle *trans, ...@@ -1713,7 +1712,7 @@ static int run_delayed_tree_ref(struct btrfs_trans_handle *trans,
ret = alloc_reserved_tree_block(trans, node, extent_op); ret = alloc_reserved_tree_block(trans, node, extent_op);
} else if (node->action == BTRFS_ADD_DELAYED_REF) { } else if (node->action == BTRFS_ADD_DELAYED_REF) {
ret = __btrfs_inc_extent_ref(trans, node, parent, ref_root, ret = __btrfs_inc_extent_ref(trans, node, parent, ref_root,
ref->level, 0, 1, extent_op); ref->level, 0, extent_op);
} else if (node->action == BTRFS_DROP_DELAYED_REF) { } else if (node->action == BTRFS_DROP_DELAYED_REF) {
ret = __btrfs_free_extent(trans, node, parent, ref_root, ret = __btrfs_free_extent(trans, node, parent, ref_root,
ref->level, 0, 1, extent_op); ref->level, 0, 1, extent_op);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment