btrfs: delayed-ref: pass delayed_refs directly to btrfs_select_ref_head
authorLu Fengqi <lufq.fnst@cn.fujitsu.com>
Thu, 11 Oct 2018 05:40:33 +0000 (13:40 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 15 Oct 2018 15:23:40 +0000 (17:23 +0200)
Since trans is only used for referring to delayed_refs, there is no need
to pass it instead of delayed_refs to btrfs_select_ref_head().  No
functional change.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@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 7f567c944fece4c861386382bb491eec04bc8884..59a8c0565a244ad14daf17516bc90be97a29c8b6 100644 (file)
@@ -353,16 +353,13 @@ int btrfs_check_delayed_seq(struct btrfs_fs_info *fs_info, u64 seq)
        return ret;
 }
 
-struct btrfs_delayed_ref_head *
-btrfs_select_ref_head(struct btrfs_trans_handle *trans)
+struct btrfs_delayed_ref_head *btrfs_select_ref_head(
+               struct btrfs_delayed_ref_root *delayed_refs)
 {
-       struct btrfs_delayed_ref_root *delayed_refs;
        struct btrfs_delayed_ref_head *head;
        u64 start;
        bool loop = false;
 
-       delayed_refs = &trans->transaction->delayed_refs;
-
 again:
        start = delayed_refs->run_delayed_start;
        head = find_ref_head(delayed_refs, start, 1);
index c3e3486a126c234f5ffa4f91ddcde7775d715318..d664c99ce7164940b5f328fa37652f2786f69683 100644 (file)
@@ -263,8 +263,8 @@ static inline void btrfs_delayed_ref_unlock(struct btrfs_delayed_ref_head *head)
 }
 
 
-struct btrfs_delayed_ref_head *
-btrfs_select_ref_head(struct btrfs_trans_handle *trans);
+struct btrfs_delayed_ref_head *btrfs_select_ref_head(
+               struct btrfs_delayed_ref_root *delayed_refs);
 
 int btrfs_check_delayed_seq(struct btrfs_fs_info *fs_info, u64 seq);
 
index c4a1e8f028d3edf5f4821cce7c99680e9fe8262d..5141fe67680bdd35c4cd18dcaeab57d89800c0df 100644 (file)
@@ -2511,7 +2511,7 @@ static struct btrfs_delayed_ref_head *btrfs_obtain_ref_head(
        int ret;
 
        spin_lock(&delayed_refs->lock);
-       head = btrfs_select_ref_head(trans);
+       head = btrfs_select_ref_head(delayed_refs);
        if (!head) {
                spin_unlock(&delayed_refs->lock);
                return head;