diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-02-10 04:32:19 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:29 -0400 |
commit | 59cc38b8d43b529d91c249c2eef35c8c3fc9fbd8 (patch) | |
tree | c67cba1b5df87df0606070046a2a0420e0f60d29 /fs/bcachefs/opts.h | |
parent | f25d8215f499418c17dfde0b3158a66e03c758dc (diff) | |
download | linux-stable-59cc38b8d43b529d91c249c2eef35c8c3fc9fbd8.tar.gz linux-stable-59cc38b8d43b529d91c249c2eef35c8c3fc9fbd8.tar.bz2 linux-stable-59cc38b8d43b529d91c249c2eef35c8c3fc9fbd8.zip |
bcachefs: New discard implementation
In the old allocator code, buckets would be discarded just prior to
being used - this made sense in bcache where we were discarding buckets
just after invalidating the cached data they contain, but in a
filesystem where we typically have more free space we want to be
discarding buckets when they become empty.
This patch implements the new behaviour - it checks the need_discard
btree for buckets awaiting discards, and then clears the appropriate
bit in the alloc btree, which moves the buckets to the freespace btree.
Additionally, discards are now enabled by default.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/opts.h')
-rw-r--r-- | fs/bcachefs/opts.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/opts.h b/fs/bcachefs/opts.h index b45740ec3c67..ce79e1a12bd0 100644 --- a/fs/bcachefs/opts.h +++ b/fs/bcachefs/opts.h @@ -266,7 +266,7 @@ enum opt_type { x(discard, u8, \ OPT_FS|OPT_MOUNT|OPT_DEVICE, \ OPT_BOOL(), \ - BCH2_NO_SB_OPT, false, \ + BCH2_NO_SB_OPT, true, \ NULL, "Enable discard/TRIM support") \ x(verbose, u8, \ OPT_FS|OPT_MOUNT, \ |