From 5dc7c10b87474c98116d3438739743cd77263e9f Mon Sep 17 00:00:00 2001 From: Dennis Zhou Date: Fri, 13 Dec 2019 16:22:21 -0800 Subject: btrfs: keep track of discardable_bytes for async discard Keep track of this metric so that we can understand how ahead or behind we are in discarding rate. This uses the same accounting method as discardable_extents, deltas between previous/current values and propagating them up. Signed-off-by: Dennis Zhou Reviewed-by: David Sterba [ update changelog ] Signed-off-by: David Sterba --- fs/btrfs/free-space-cache.h | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/btrfs/free-space-cache.h') diff --git a/fs/btrfs/free-space-cache.h b/fs/btrfs/free-space-cache.h index bd1e7a542271..5018190a49a3 100644 --- a/fs/btrfs/free-space-cache.h +++ b/fs/btrfs/free-space-cache.h @@ -52,6 +52,7 @@ struct btrfs_free_space_ctl { int unit; u64 start; s32 discardable_extents[BTRFS_STAT_NR_ENTRIES]; + s64 discardable_bytes[BTRFS_STAT_NR_ENTRIES]; const struct btrfs_free_space_op *op; void *private; struct mutex cache_writeout_mutex; -- cgit v1.2.1