]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/journal_io.h
Update bcachefs sources to a03225a783 bcachefs: Put some repair messages behind opts...
[bcachefs-tools-debian] / libbcachefs / journal_io.h
index 4236b7fc37ff1f37787be02302d0917044ebb3a7..30e995c81fc4d72e97efc1ea77977e681ec02fc7 100644 (file)
@@ -1,16 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 #ifndef _BCACHEFS_JOURNAL_IO_H
 #define _BCACHEFS_JOURNAL_IO_H
 
-struct bkey_i *bch2_journal_find_btree_root(struct bch_fs *, struct jset *,
-                                           enum btree_id, unsigned *);
-
 /*
  * Only used for holding the journal entries we read in btree_journal_read()
  * during cache_registration
  */
 struct journal_replay {
-       struct list_head        list;
-       struct bch_devs_list    devs;
+       struct journal_ptr {
+               u8              dev;
+               u32             bucket;
+               u32             bucket_offset;
+               u64             sector;
+       }                       ptrs[BCH_REPLICAS_MAX];
+       unsigned                nr_ptrs;
+
+       /* checksum error, but we may want to try using it anyways: */
+       bool                    bad;
+       bool                    ignore;
        /* must be last: */
        struct jset             j;
 };
@@ -37,9 +44,16 @@ static inline struct jset_entry *__jset_entry_type_next(struct jset *jset,
        for_each_jset_entry_type(entry, jset, BCH_JSET_ENTRY_btree_keys)        \
                vstruct_for_each_safe(entry, k, _n)
 
-int bch2_journal_read(struct bch_fs *, struct list_head *);
+int bch2_journal_entry_validate(struct bch_fs *, const char *,
+                               struct jset_entry *, unsigned, int, int);
+void bch2_journal_entry_to_text(struct printbuf *, struct bch_fs *,
+                               struct jset_entry *);
+
+void bch2_journal_ptrs_to_text(struct printbuf *, struct bch_fs *,
+                              struct journal_replay *);
+
+int bch2_journal_read(struct bch_fs *, u64 *, u64 *);
 
-int bch2_journal_entry_sectors(struct journal *);
 void bch2_journal_write(struct closure *);
 
 #endif /* _BCACHEFS_JOURNAL_IO_H */