]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
btrfs: simplify parameters of btrfs_set_disk_extent_flags
authorDavid Sterba <dsterba@suse.com>
Wed, 20 Mar 2019 10:54:13 +0000 (11:54 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:45 +0000 (17:01 +0100)
All callers pass extent buffer start and length so the extent buffer
itself should work fine.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c

index b62721ac5ee8806fc4ae638bd4f69526d55d1ede..f948435e87df285a3c50e3f667a48d2ce254b020 100644 (file)
@@ -925,9 +925,7 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans,
                if (new_flags != 0) {
                        int level = btrfs_header_level(buf);
 
-                       ret = btrfs_set_disk_extent_flags(trans,
-                                                         buf->start,
-                                                         buf->len,
+                       ret = btrfs_set_disk_extent_flags(trans, buf,
                                                          new_flags, level, 0);
                        if (ret)
                                return ret;
index 1cde3f1d8f205c718ec50d15e6bb466a53ab306c..ea5d0675465ae613f4685dd91af5363297837dc6 100644 (file)
@@ -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,
                  struct extent_buffer *buf, int full_backref);
 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 btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_ref *ref);
 
index 9dcd70cc3ca32ca95ae548d1f63b74fc3b575c80..161274118853f9669e87bc1df6067302ffa4d22f 100644 (file)
@@ -2231,7 +2231,7 @@ out:
 }
 
 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)
 {
        struct btrfs_delayed_extent_op *extent_op;
@@ -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->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)
                btrfs_free_delayed_extent_op(extent_op);
        return ret;
@@ -4741,8 +4741,7 @@ static noinline int walk_down_proc(struct btrfs_trans_handle *trans,
                BUG_ON(ret); /* -ENOMEM */
                ret = btrfs_dec_ref(trans, root, eb, 0);
                BUG_ON(ret); /* -ENOMEM */
-               ret = btrfs_set_disk_extent_flags(trans, eb->start,
-                                                 eb->len, flag,
+               ret = btrfs_set_disk_extent_flags(trans, eb, flag,
                                                  btrfs_header_level(eb), 0);
                BUG_ON(ret); /* -ENOMEM */
                wc->flags[level] |= flag;