diff options
author | Josef Bacik <josef@toxicpanda.com> | 2017-09-29 15:43:55 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-10-30 07:28:00 -0400 |
commit | 1ce7a5ec44c8b148c4600e25c696a135319734db (patch) | |
tree | 01d1f912bff08b19df61021244803305d5a1c0b6 | |
parent | 194ab0bc21cc99c5b804040aa785e0bdcc214656 (diff) |
btrfs: move ref_mod modification into the if (ref) logic
We only use this logic if our ref isn't a ref_head, so move it up into
the if (ref) case since we know that this is a normal ref and not a
delayed ref head.
Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/extent-tree.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 5e61e9287b0e..0dcbbeacaadc 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -2744,10 +2744,6 @@ static noinline int __btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, | |||
2744 | list_del(&ref->list); | 2744 | list_del(&ref->list); |
2745 | if (!list_empty(&ref->add_list)) | 2745 | if (!list_empty(&ref->add_list)) |
2746 | list_del(&ref->add_list); | 2746 | list_del(&ref->add_list); |
2747 | } | ||
2748 | atomic_dec(&delayed_refs->num_entries); | ||
2749 | |||
2750 | if (!btrfs_delayed_ref_is_head(ref)) { | ||
2751 | /* | 2747 | /* |
2752 | * when we play the delayed ref, also correct the | 2748 | * when we play the delayed ref, also correct the |
2753 | * ref_mod on head | 2749 | * ref_mod on head |
@@ -2764,6 +2760,8 @@ static noinline int __btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, | |||
2764 | WARN_ON(1); | 2760 | WARN_ON(1); |
2765 | } | 2761 | } |
2766 | } | 2762 | } |
2763 | atomic_dec(&delayed_refs->num_entries); | ||
2764 | |||
2767 | /* | 2765 | /* |
2768 | * Record the must-insert_reserved flag before we drop the spin | 2766 | * Record the must-insert_reserved flag before we drop the spin |
2769 | * lock. | 2767 | * lock. |