summaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-03-10 23:49:03 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:27 +0300
commitf6c92ebbb8f84ad9b993691b02d5b38736b7a922 (patch)
tree50111eae443e39002194c35c012401f5b1723fbc /fs/bcachefs/journal.c
parentd5d3be7dc5d09f9cf8d12b3e3cefbcd8020cddae (diff)
downloadlinux-f6c92ebbb8f84ad9b993691b02d5b38736b7a922.tar.xz
bcachefs: Allocate journal buckets sequentially
This tweaks __bch2_set_nr_journal_buckets() so that we aren't reversing their order in the jorunal anymore - nice for rotating disks. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/journal.c')
-rw-r--r--fs/bcachefs/journal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c
index 9d16b9d30ad7..11b44467aeab 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -837,7 +837,7 @@ static int __bch2_set_nr_journal_buckets(struct bch_dev *ca, unsigned nr,
* superblock before inserting into the journal array
*/
- pos = ja->nr ? (ja->cur_idx + 1) % ja->nr : 0;
+ pos = ja->discard_idx ?: ja->nr;
__array_insert_item(ja->buckets, ja->nr, pos);
__array_insert_item(ja->bucket_seq, ja->nr, pos);
__array_insert_item(journal_buckets->buckets, ja->nr, pos);