summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-03-10 15:49:03 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2022-03-12 20:14:14 -0500
commitfc37db01da75e02e4c3fb717e2b2547717c4104b (patch)
treeb104ceaed8c095d3d63ecf07cbde8b2f8e44fc70
parentb6cc6d965a3c38a329beb7ddf4e8f06fa3261fd7 (diff)
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>
-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 4151be494888..eb556ecc511f 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -838,7 +838,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);