Commit 42c9d0b5 authored by David Sterba's avatar David Sterba

btrfs: simplify parameters of btrfs_set_disk_extent_flags

All callers pass extent buffer start and length so the extent buffer
itself should work fine.
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent c4ac7541
...@@ -925,9 +925,7 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans, ...@@ -925,9 +925,7 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans,
if (new_flags != 0) { if (new_flags != 0) {
int level = btrfs_header_level(buf); int level = btrfs_header_level(buf);
ret = btrfs_set_disk_extent_flags(trans, ret = btrfs_set_disk_extent_flags(trans, buf,
buf->start,
buf->len,
new_flags, level, 0); new_flags, level, 0);
if (ret) if (ret)
return ret; return ret;
......
...@@ -2482,7 +2482,7 @@ int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, ...@@ -2482,7 +2482,7 @@ int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
int btrfs_dec_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, int btrfs_dec_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
struct extent_buffer *buf, int full_backref); struct extent_buffer *buf, int full_backref);
int btrfs_set_disk_extent_flags(struct btrfs_trans_handle *trans, int btrfs_set_disk_extent_flags(struct btrfs_trans_handle *trans,
u64 bytenr, u64 num_bytes, u64 flags, struct extent_buffer *eb, u64 flags,
int level, int is_data); int level, int is_data);
int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_ref *ref); int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_ref *ref);
......
...@@ -2231,7 +2231,7 @@ int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, ...@@ -2231,7 +2231,7 @@ int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,
} }
int btrfs_set_disk_extent_flags(struct btrfs_trans_handle *trans, int btrfs_set_disk_extent_flags(struct btrfs_trans_handle *trans,
u64 bytenr, u64 num_bytes, u64 flags, struct extent_buffer *eb, u64 flags,
int level, int is_data) int level, int is_data)
{ {
struct btrfs_delayed_extent_op *extent_op; struct btrfs_delayed_extent_op *extent_op;
...@@ -2247,7 +2247,7 @@ int btrfs_set_disk_extent_flags(struct btrfs_trans_handle *trans, ...@@ -2247,7 +2247,7 @@ int btrfs_set_disk_extent_flags(struct btrfs_trans_handle *trans,
extent_op->is_data = is_data ? true : false; extent_op->is_data = is_data ? true : false;
extent_op->level = level; extent_op->level = level;
ret = btrfs_add_delayed_extent_op(trans, bytenr, num_bytes, extent_op); ret = btrfs_add_delayed_extent_op(trans, eb->start, eb->len, extent_op);
if (ret) if (ret)
btrfs_free_delayed_extent_op(extent_op); btrfs_free_delayed_extent_op(extent_op);
return ret; return ret;
...@@ -4741,8 +4741,7 @@ static noinline int walk_down_proc(struct btrfs_trans_handle *trans, ...@@ -4741,8 +4741,7 @@ static noinline int walk_down_proc(struct btrfs_trans_handle *trans,
BUG_ON(ret); /* -ENOMEM */ BUG_ON(ret); /* -ENOMEM */
ret = btrfs_dec_ref(trans, root, eb, 0); ret = btrfs_dec_ref(trans, root, eb, 0);
BUG_ON(ret); /* -ENOMEM */ BUG_ON(ret); /* -ENOMEM */
ret = btrfs_set_disk_extent_flags(trans, eb->start, ret = btrfs_set_disk_extent_flags(trans, eb, flag,
eb->len, flag,
btrfs_header_level(eb), 0); btrfs_header_level(eb), 0);
BUG_ON(ret); /* -ENOMEM */ BUG_ON(ret); /* -ENOMEM */
wc->flags[level] |= flag; wc->flags[level] |= flag;
......
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