summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-04-12 05:39:39 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:20 +0300
commitd07343561e263fcbbdb8042f35ca29a602190e18 (patch)
tree5dbc1590f373699e01b1f319c072e14d6688d751 /fs/bcachefs/recovery.h
parent644d180b055fa47be7e6ca8b684f45e2350dfafd (diff)
downloadlinux-d07343561e263fcbbdb8042f35ca29a602190e18.tar.xz
bcachefs: Deduplicate keys in the journal before replay
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.h')
-rw-r--r--fs/bcachefs/recovery.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/bcachefs/recovery.h b/fs/bcachefs/recovery.h
index 912929117c37..a69260d6165a 100644
--- a/fs/bcachefs/recovery.h
+++ b/fs/bcachefs/recovery.h
@@ -2,6 +2,22 @@
#ifndef _BCACHEFS_RECOVERY_H
#define _BCACHEFS_RECOVERY_H
+struct journal_keys {
+ struct journal_key {
+ enum btree_id btree_id:8;
+ unsigned allocated:1;
+ struct bpos pos;
+ struct bkey_i *k;
+ u32 journal_seq;
+ u32 journal_offset;
+ } *d;
+ size_t nr;
+ u64 journal_seq_base;
+};
+
+#define for_each_journal_key(keys, i) \
+ for (i = (keys).d; i < (keys).d + (keys).nr; (i)++)
+
int bch2_fs_recovery(struct bch_fs *);
int bch2_fs_initialize(struct bch_fs *);