Skip to content

Commit

Permalink
btrfs: delayed-ref: pass delayed_refs directly to btrfs_delayed_ref_lock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lu Fengqi authored and David Sterba committed Oct 15, 2018
1 parent 5637c74 commit 9e920a6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions fs/btrfs/delayed-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/delayed-ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*
Expand Down

0 comments on commit 9e920a6

Please sign in to comment.