aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/extent-tree.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 2c17b621a661..9aa64f1aa413 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -6246,6 +6246,9 @@ static int update_block_group(struct btrfs_trans_handle *trans,
6246 spin_unlock(&cache->lock); 6246 spin_unlock(&cache->lock);
6247 spin_unlock(&cache->space_info->lock); 6247 spin_unlock(&cache->space_info->lock);
6248 6248
6249 trace_btrfs_space_reservation(root->fs_info, "pinned",
6250 cache->space_info->flags,
6251 num_bytes, 1);
6249 set_extent_dirty(info->pinned_extents, 6252 set_extent_dirty(info->pinned_extents,
6250 bytenr, bytenr + num_bytes - 1, 6253 bytenr, bytenr + num_bytes - 1,
6251 GFP_NOFS | __GFP_NOFAIL); 6254 GFP_NOFS | __GFP_NOFAIL);
@@ -6320,6 +6323,8 @@ static int pin_down_extent(struct btrfs_root *root,
6320 spin_unlock(&cache->lock); 6323 spin_unlock(&cache->lock);
6321 spin_unlock(&cache->space_info->lock); 6324 spin_unlock(&cache->space_info->lock);
6322 6325
6326 trace_btrfs_space_reservation(root->fs_info, "pinned",
6327 cache->space_info->flags, num_bytes, 1);
6323 set_extent_dirty(root->fs_info->pinned_extents, bytenr, 6328 set_extent_dirty(root->fs_info->pinned_extents, bytenr,
6324 bytenr + num_bytes - 1, GFP_NOFS | __GFP_NOFAIL); 6329 bytenr + num_bytes - 1, GFP_NOFS | __GFP_NOFAIL);
6325 if (reserved) 6330 if (reserved)
@@ -6678,6 +6683,9 @@ static int unpin_extent_range(struct btrfs_root *root, u64 start, u64 end,
6678 spin_lock(&cache->lock); 6683 spin_lock(&cache->lock);
6679 cache->pinned -= len; 6684 cache->pinned -= len;
6680 space_info->bytes_pinned -= len; 6685 space_info->bytes_pinned -= len;
6686
6687 trace_btrfs_space_reservation(fs_info, "pinned",
6688 space_info->flags, len, 0);
6681 space_info->max_extent_size = 0; 6689 space_info->max_extent_size = 0;
6682 percpu_counter_add(&space_info->total_bytes_pinned, -len); 6690 percpu_counter_add(&space_info->total_bytes_pinned, -len);
6683 if (cache->ro) { 6691 if (cache->ro) {