btrfs: delayed-ref: pass delayed_refs directly to btrfs_delayed_ref_lock
authorLu Fengqi <lufq.fnst@cn.fujitsu.com>
Thu, 11 Oct 2018 05:40:34 +0000 (13:40 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 15 Oct 2018 15:23:41 +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_delayed_ref_lock().

No functional change.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.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 59a8c0565a244ad14daf17516bc90be97a29c8b6..5d8f6d505d5a03b5ef1b4fa1e0cd9000165b2765 100644 (file)
@@ -204,12 +204,9 @@ static struct btrfs_delayed_ref_head* find_ref_head(
        return NULL;
 }
 
-int btrfs_delayed_ref_lock(struct btrfs_trans_handle *trans,
+int btrfs_delayed_ref_lock(struct btrfs_delayed_ref_root *delayed_refs,
                           struct btrfs_delayed_ref_head *head)
 {
-       struct btrfs_delayed_ref_root *delayed_refs;
-
-       delayed_refs = &trans->transaction->delayed_refs;
        lockdep_assert_held(&delayed_refs->lock);
        if (mutex_trylock(&head->mutex))
                return 0;
index d664c99ce7164940b5f328fa37652f2786f69683..8e20c5cb5404dbbea77edab1c6ef16ead2348ed4 100644 (file)
@@ -255,7 +255,7 @@ void btrfs_merge_delayed_refs(struct btrfs_trans_handle *trans,
 struct btrfs_delayed_ref_head *
 btrfs_find_delayed_ref_head(struct btrfs_delayed_ref_root *delayed_refs,
                            u64 bytenr);
-int btrfs_delayed_ref_lock(struct btrfs_trans_handle *trans,
+int btrfs_delayed_ref_lock(struct btrfs_delayed_ref_root *delayed_refs,
                           struct btrfs_delayed_ref_head *head);
 static inline void btrfs_delayed_ref_unlock(struct btrfs_delayed_ref_head *head)
 {
index 5141fe67680bdd35c4cd18dcaeab57d89800c0df..3ee5d84cd817124c0c47898ab840651a4d85a4ab 100644 (file)
@@ -2521,7 +2521,7 @@ static struct btrfs_delayed_ref_head *btrfs_obtain_ref_head(
         * Grab the lock that says we are going to process all the refs for
         * this head
         */
-       ret = btrfs_delayed_ref_lock(trans, head);
+       ret = btrfs_delayed_ref_lock(delayed_refs, head);
        spin_unlock(&delayed_refs->lock);
 
        /*