bcachefs: Run bch2_check_backpointers_to_extents() in multiple passes if necessary
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 10 Oct 2022 02:18:06 +0000 (22:18 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:51 +0000 (17:09 -0400)
commit23792a712d29ee8adc6f5c165e61e8624838169d
treeb83ae0224548b541ad999bc128bb2a38a5884c92
parent15949c549993a2383ebacf6c563b85722278fba3
bcachefs: Run bch2_check_backpointers_to_extents() in multiple passes if necessary

When the extents + reflink btrees don't fit into memory this fsck pass
becomes _much_ slower, since we're doing random lookups.

This patch changes this pass to check how much of the relevant btrees
will fit into memory, and run in multiple passes if needed.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/backpointers.c
fs/bcachefs/bbpos.h [new file with mode: 0644]