summaryrefslogtreecommitdiff
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorDennis Zhou <dennis@kernel.org>2019-12-13 16:22:21 -0800
committerDavid Sterba <dsterba@suse.com>2020-01-20 16:40:59 +0100
commit5dc7c10b87474c98116d3438739743cd77263e9f (patch)
tree3636b859f5228c8df8d777b2b5a4ec9559510978 /fs/btrfs/ctree.h
parentdfb79ddb130e0a239e3e90aaf5f5b908555f52bb (diff)
downloadlwn-5dc7c10b87474c98116d3438739743cd77263e9f.tar.gz
lwn-5dc7c10b87474c98116d3438739743cd77263e9f.zip
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 <dennis@kernel.org> Reviewed-by: David Sterba <dsterba@suse.com> [ update changelog ] Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 533c5ea0e8c0..7c1c236d13ae 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -467,6 +467,7 @@ struct btrfs_discard_ctl {
struct btrfs_block_group *block_group;
struct list_head discard_list[BTRFS_NR_DISCARD_LISTS];
atomic_t discardable_extents;
+ atomic64_t discardable_bytes;
};
/* delayed seq elem */