projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
44a43cf
)
bcachefs: Set bucket needs discard, inc gen on empty -> nonempty transition
author
Kent Overstreet
<kent.overstreet@linux.dev>
Sun, 8 Dec 2024 01:43:07 +0000
(20:43 -0500)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Sat, 21 Dec 2024 06:36:22 +0000
(
01:36
-0500)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_background.c
patch
|
blob
|
history
diff --git
a/fs/bcachefs/alloc_background.c
b/fs/bcachefs/alloc_background.c
index
b2d5704
..
6206923
100644
(file)
--- a/
fs/bcachefs/alloc_background.c
+++ b/
fs/bcachefs/alloc_background.c
@@
-856,7
+856,10
@@
int bch2_trigger_alloc(struct btree_trans *trans,
if (flags & BTREE_TRIGGER_transactional) {
alloc_data_type_set(new_a, new_a->data_type);
- if (bch2_bucket_sectors_total(*new_a) > bch2_bucket_sectors_total(*old_a)) {
+ int is_empty_delta = (int) data_type_is_empty(new_a->data_type) -
+ (int) data_type_is_empty(old_a->data_type);
+
+ if (is_empty_delta < 0) {
new_a->io_time[READ] = bch2_current_io_time(c, READ);
new_a->io_time[WRITE]= bch2_current_io_time(c, WRITE);
SET_BCH_ALLOC_V4_NEED_INC_GEN(new_a, true);