Skip to content

Commit a43c383

Browse files
josefbacikkdave
authored andcommitted
btrfs: add space reservation tracepoint for reserved bytes
I noticed when folding the trace_btrfs_space_reservation() tracepoint into the btrfs_space_info_update_* helpers that we didn't emit a tracepoint when doing btrfs_add_reserved_bytes(). I know this is because we were swapping bytes_may_use for bytes_reserved, so in my mind there was no reason to have the tracepoint there. But now there is because we always emit the unreserve for the bytes_may_use side, and this would have broken if compression was on anyway. Add a tracepoint to cover the bytes_reserved counter so the math still comes out right. Signed-off-by: Josef Bacik <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent f3e75e3 commit a43c383

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/block-group.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,6 +2758,8 @@ int btrfs_add_reserved_bytes(struct btrfs_block_group_cache *cache,
27582758
} else {
27592759
cache->reserved += num_bytes;
27602760
space_info->bytes_reserved += num_bytes;
2761+
trace_btrfs_space_reservation(cache->fs_info, "space_info",
2762+
space_info->flags, num_bytes, 1);
27612763
btrfs_space_info_update_bytes_may_use(cache->fs_info,
27622764
space_info, -ram_bytes);
27632765
if (delalloc)

0 commit comments

Comments
 (0)