btrfs: Remove fs_info from btrfs_add_delayed_tree_ref
authorNikolay Borisov <nborisov@suse.com>
Wed, 20 Jun 2018 12:48:53 +0000 (15:48 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:33 +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 03dec673d12abc4b5d753f1cc8ae585f4e6978f6..82ac1273c65faab7e60e08a0f2758bbb031495d2 100644 (file)
@@ -709,13 +709,13 @@ static void init_delayed_ref_common(struct btrfs_fs_info *fs_info,
  * to make sure the delayed ref is eventually processed before this
  * transaction commits.
  */
-int btrfs_add_delayed_tree_ref(struct btrfs_fs_info *fs_info,
-                              struct btrfs_trans_handle *trans,
+int btrfs_add_delayed_tree_ref(struct btrfs_trans_handle *trans,
                               u64 bytenr, u64 num_bytes, u64 parent,
                               u64 ref_root,  int level, int action,
                               struct btrfs_delayed_extent_op *extent_op,
                               int *old_ref_mod, int *new_ref_mod)
 {
+       struct btrfs_fs_info *fs_info = trans->fs_info;
        struct btrfs_delayed_tree_ref *ref;
        struct btrfs_delayed_ref_head *head_ref;
        struct btrfs_delayed_ref_root *delayed_refs;
index ea1aecb6a50dd977c471d1cf58611406b347954c..31729302c82718a0e8e48ec6de764ab650483c8b 100644 (file)
@@ -234,8 +234,7 @@ static inline void btrfs_put_delayed_ref_head(struct btrfs_delayed_ref_head *hea
                kmem_cache_free(btrfs_delayed_ref_head_cachep, head);
 }
 
-int btrfs_add_delayed_tree_ref(struct btrfs_fs_info *fs_info,
-                              struct btrfs_trans_handle *trans,
+int btrfs_add_delayed_tree_ref(struct btrfs_trans_handle *trans,
                               u64 bytenr, u64 num_bytes, u64 parent,
                               u64 ref_root, int level, int action,
                               struct btrfs_delayed_extent_op *extent_op,
index 19239ad3c6d1e30081e18e724cc78a30663eb787..6b74ffc47ae420e573e270050e732ef559e785ca 100644 (file)
@@ -2176,7 +2176,7 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
                           owner, offset, BTRFS_ADD_DELAYED_REF);
 
        if (owner < BTRFS_FIRST_FREE_OBJECTID) {
-               ret = btrfs_add_delayed_tree_ref(fs_info, trans, bytenr,
+               ret = btrfs_add_delayed_tree_ref(trans, bytenr,
                                                 num_bytes, parent,
                                                 root_objectid, (int)owner,
                                                 BTRFS_ADD_DELAYED_REF, NULL,
@@ -7196,7 +7196,7 @@ void btrfs_free_tree_block(struct btrfs_trans_handle *trans,
                                   root->root_key.objectid,
                                   btrfs_header_level(buf), 0,
                                   BTRFS_DROP_DELAYED_REF);
-               ret = btrfs_add_delayed_tree_ref(fs_info, trans, buf->start,
+               ret = btrfs_add_delayed_tree_ref(trans, buf->start,
                                                 buf->len, parent,
                                                 root->root_key.objectid,
                                                 btrfs_header_level(buf),
@@ -7275,7 +7275,7 @@ int btrfs_free_extent(struct btrfs_trans_handle *trans,
                old_ref_mod = new_ref_mod = 0;
                ret = 0;
        } else if (owner < BTRFS_FIRST_FREE_OBJECTID) {
-               ret = btrfs_add_delayed_tree_ref(fs_info, trans, bytenr,
+               ret = btrfs_add_delayed_tree_ref(trans, bytenr,
                                                 num_bytes, parent,
                                                 root_objectid, (int)owner,
                                                 BTRFS_DROP_DELAYED_REF, NULL,
@@ -8491,7 +8491,7 @@ struct extent_buffer *btrfs_alloc_tree_block(struct btrfs_trans_handle *trans,
                btrfs_ref_tree_mod(root, ins.objectid, ins.offset, parent,
                                   root_objectid, level, 0,
                                   BTRFS_ADD_DELAYED_EXTENT);
-               ret = btrfs_add_delayed_tree_ref(fs_info, trans, ins.objectid,
+               ret = btrfs_add_delayed_tree_ref(trans, ins.objectid,
                                                 ins.offset, parent,
                                                 root_objectid, level,
                                                 BTRFS_ADD_DELAYED_EXTENT,