aboutsummaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.h
diff options
context:
space:
mode:
authorGravatar Kent Overstreet <kent.overstreet@gmail.com> 2022-05-21 13:10:39 -0400
committerGravatar Kent Overstreet <kent.overstreet@linux.dev> 2023-10-22 17:09:33 -0400
commit30525f68633740e071c0960c11c4380f1f6851af (patch)
tree161d8051b6025babe27c0e81d7a71babaafa9d86 /fs/bcachefs/recovery.h
parentbcachefs: Always print when doing journal replay in fsck (diff)
downloadlinux-30525f68633740e071c0960c11c4380f1f6851af.tar.gz
linux-30525f68633740e071c0960c11c4380f1f6851af.tar.bz2
linux-30525f68633740e071c0960c11c4380f1f6851af.zip
bcachefs: Fix journal_keys_search() overhead
Previously, on every btree_iter_peek() operation we were searching the journal keys, doing a full binary search - which was slow. This patch fixes that by saving our position in the journal keys, so that we only do a full binary search when moving our position backwards or a large jump forwards. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/recovery.h')
-rw-r--r--fs/bcachefs/recovery.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/bcachefs/recovery.h b/fs/bcachefs/recovery.h
index e05aac64185d..52db06b29310 100644
--- a/fs/bcachefs/recovery.h
+++ b/fs/bcachefs/recovery.h
@@ -28,10 +28,8 @@ struct btree_and_journal_iter {
} last;
};
-size_t bch2_journal_key_search(struct journal_keys *, enum btree_id,
- unsigned, struct bpos);
struct bkey_i *bch2_journal_keys_peek_upto(struct bch_fs *, enum btree_id,
- unsigned, struct bpos, struct bpos);
+ unsigned, struct bpos, struct bpos, size_t *);
struct bkey_i *bch2_journal_keys_peek_slot(struct bch_fs *, enum btree_id,
unsigned, struct bpos);