diff options
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 1d7f043152b0..3b26f0980946 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -2698,13 +2698,9 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans, | |||
2698 | /* if metadata always pin */ | 2698 | /* if metadata always pin */ |
2699 | if (owner_objectid < BTRFS_FIRST_FREE_OBJECTID) { | 2699 | if (owner_objectid < BTRFS_FIRST_FREE_OBJECTID) { |
2700 | if (root->root_key.objectid == BTRFS_TREE_LOG_OBJECTID) { | 2700 | if (root->root_key.objectid == BTRFS_TREE_LOG_OBJECTID) { |
2701 | struct btrfs_block_group_cache *cache; | 2701 | mutex_lock(&root->fs_info->pinned_mutex); |
2702 | 2702 | btrfs_update_pinned_extents(root, bytenr, num_bytes, 1); | |
2703 | /* btrfs_free_reserved_extent */ | 2703 | mutex_unlock(&root->fs_info->pinned_mutex); |
2704 | cache = btrfs_lookup_block_group(root->fs_info, bytenr); | ||
2705 | BUG_ON(!cache); | ||
2706 | btrfs_add_free_space(cache, bytenr, num_bytes); | ||
2707 | put_block_group(cache); | ||
2708 | update_reserved_extents(root, bytenr, num_bytes, 0); | 2704 | update_reserved_extents(root, bytenr, num_bytes, 0); |
2709 | return 0; | 2705 | return 0; |
2710 | } | 2706 | } |