btrfs: keep track of discard reuse stats
authorDennis Zhou <dennis@kernel.org>
Thu, 2 Jan 2020 21:26:41 +0000 (16:26 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 20 Jan 2020 15:41:00 +0000 (16:41 +0100)
commit9ddf648f9c2a492cef4e41e31c50515a817d0562
tree64ecae153d63e8392660d0e73e5d99391010795b
parent5cb0724e1b4653629c508906ca6098bae77d2f95
btrfs: keep track of discard reuse stats

Keep track of how much we are discarding and how often we are reusing
with async discard. The discard_*_bytes values don't need any special
protection because the work item provides the single threaded access.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Dennis Zhou <dennis@kernel.org>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/discard.c
fs/btrfs/free-space-cache.c
fs/btrfs/sysfs.c