summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-05-21 20:10:39 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:33 +0300
commit30525f68633740e071c0960c11c4380f1f6851af (patch)
tree161d8051b6025babe27c0e81d7a71babaafa9d86 /fs/bcachefs/recovery.h
parent11f5e595bf7cd11c395f0041cdd6448f238a5614 (diff)
downloadlinux-30525f68633740e071c0960c11c4380f1f6851af.tar.xz
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);