bcachefs: Use a genradix for reading journal entries
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 21 Mar 2022 04:15:53 +0000 (00:15 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:30 +0000 (17:09 -0400)
commitce6201c456571d919e722eec3c17f868f0575b05
treefa7281175f4d7d823da49cff85596b2d7b53e92f
parent95752a02cb5d38bc97d76625de2607510ac94e69
bcachefs: Use a genradix for reading journal entries

Previously, the journal read path used a linked list for storing the
journal entries we read from disk. But there's been a bug that's been
causing journal_flush_delay to incorrectly be set to 0, leading to far
more journal entries than is normal being written out, which then means
filesystems are no longer able to start due to the O(n^2) behaviour of
inserting into/searching that linked list.

Fix this by switching to a radix tree.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/bcachefs.h
fs/bcachefs/journal.c
fs/bcachefs/journal.h
fs/bcachefs/journal_io.c
fs/bcachefs/journal_io.h
fs/bcachefs/recovery.c
fs/bcachefs/recovery.h
fs/bcachefs/super.c