btrfs: Remove fs_info from btrfs_add_delayed_data_ref
authorNikolay Borisov <nborisov@suse.com>
Wed, 20 Jun 2018 12:48:54 +0000 (15:48 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:34 +0000 (13:12 +0200)
This function is always called with a valid transaction handle from
where fs_info can be referenced. No functional changes.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-ref.c
fs/btrfs/delayed-ref.h
fs/btrfs/extent-tree.c

index 82ac127..6eb00eb 100644 (file)
@@ -791,13 +791,13 @@ free_ref:
 /*
  * add a delayed data ref. it's similar to btrfs_add_delayed_tree_ref.
  */
-int btrfs_add_delayed_data_ref(struct btrfs_fs_info *fs_info,
-                              struct btrfs_trans_handle *trans,
+int btrfs_add_delayed_data_ref(struct btrfs_trans_handle *trans,
                               u64 bytenr, u64 num_bytes,
                               u64 parent, u64 ref_root,
                               u64 owner, u64 offset, u64 reserved, int action,
                               int *old_ref_mod, int *new_ref_mod)
 {
+       struct btrfs_fs_info *fs_info = trans->fs_info;
        struct btrfs_delayed_data_ref *ref;
        struct btrfs_delayed_ref_head *head_ref;
        struct btrfs_delayed_ref_root *delayed_refs;
index 3172930..d9f2a4e 100644 (file)
@@ -239,8 +239,7 @@ int btrfs_add_delayed_tree_ref(struct btrfs_trans_handle *trans,
                               u64 ref_root, int level, int action,
                               struct btrfs_delayed_extent_op *extent_op,
                               int *old_ref_mod, int *new_ref_mod);
-int btrfs_add_delayed_data_ref(struct btrfs_fs_info *fs_info,
-                              struct btrfs_trans_handle *trans,
+int btrfs_add_delayed_data_ref(struct btrfs_trans_handle *trans,
                               u64 bytenr, u64 num_bytes,
                               u64 parent, u64 ref_root,
                               u64 owner, u64 offset, u64 reserved, int action,
index 6b74ffc..1058668 100644 (file)
@@ -2182,7 +2182,7 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
                                                 BTRFS_ADD_DELAYED_REF, NULL,
                                                 &old_ref_mod, &new_ref_mod);
        } else {
-               ret = btrfs_add_delayed_data_ref(fs_info, trans, bytenr,
+               ret = btrfs_add_delayed_data_ref(trans, bytenr,
                                                 num_bytes, parent,
                                                 root_objectid, owner, offset,
                                                 0, BTRFS_ADD_DELAYED_REF,
@@ -7281,7 +7281,7 @@ int btrfs_free_extent(struct btrfs_trans_handle *trans,
                                                 BTRFS_DROP_DELAYED_REF, NULL,
                                                 &old_ref_mod, &new_ref_mod);
        } else {
-               ret = btrfs_add_delayed_data_ref(fs_info, trans, bytenr,
+               ret = btrfs_add_delayed_data_ref(trans, bytenr,
                                                 num_bytes, parent,
                                                 root_objectid, owner, offset,
                                                 0, BTRFS_DROP_DELAYED_REF,
@@ -8255,7 +8255,6 @@ int btrfs_alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
                                     u64 offset, u64 ram_bytes,
                                     struct btrfs_key *ins)
 {
-       struct btrfs_fs_info *fs_info = root->fs_info;
        int ret;
 
        BUG_ON(root->root_key.objectid == BTRFS_TREE_LOG_OBJECTID);
@@ -8264,7 +8263,7 @@ int btrfs_alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
                           root->root_key.objectid, owner, offset,
                           BTRFS_ADD_DELAYED_EXTENT);
 
-       ret = btrfs_add_delayed_data_ref(fs_info, trans, ins->objectid,
+       ret = btrfs_add_delayed_data_ref(trans, ins->objectid,
                                         ins->offset, 0,
                                         root->root_key.objectid, owner,
                                         offset, ram_bytes,