summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/discard.c
diff options
context:
space:
mode:
authorDennis Zhou <dennis@kernel.org>2020-01-02 16:26:38 -0500
committerDavid Sterba <dsterba@suse.com>2020-01-20 16:40:59 +0100
commit19b2a2c71979f849cadc33af3577f739cc95e1f0 (patch)
treed39430f1c2faac2d4bb1a5207ff05f0b73a541c6 /fs/btrfs/discard.c
parent4aa9ad520398bf9cef70fc9c363567da44312045 (diff)
downloadlinux-19b2a2c71979f849cadc33af3577f739cc95e1f0.tar.gz
linux-19b2a2c71979f849cadc33af3577f739cc95e1f0.tar.bz2
linux-19b2a2c71979f849cadc33af3577f739cc95e1f0.zip
btrfs: make max async discard size tunable
Expose max_discard_size as a tunable via sysfs and switch the current fixed maximum to the default value. Signed-off-by: Dennis Zhou <dennis@kernel.org> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/discard.c')
-rw-r--r--fs/btrfs/discard.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/discard.c b/fs/btrfs/discard.c
index 565931f9a9aa..5fdd82c356a4 100644
--- a/fs/btrfs/discard.c
+++ b/fs/btrfs/discard.c
@@ -527,6 +527,7 @@ void btrfs_discard_init(struct btrfs_fs_info *fs_info)
discard_ctl->prev_discard = 0;
atomic_set(&discard_ctl->discardable_extents, 0);
atomic64_set(&discard_ctl->discardable_bytes, 0);
+ discard_ctl->max_discard_size = BTRFS_ASYNC_DISCARD_DEFAULT_MAX_SIZE;
discard_ctl->delay = BTRFS_DISCARD_MAX_DELAY_MSEC;
discard_ctl->iops_limit = BTRFS_DISCARD_MAX_IOPS;
discard_ctl->kbps_limit = 0;