]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/journal_io.h
rust: Fix ptr casting in Fs::open()
[bcachefs-tools-debian] / libbcachefs / journal_io.h
index d8425fe0d67b6826c2de50196d3af23d95f16d55..a32c2876f2a65075e5803ce01c18aa9f29793aec 100644 (file)
@@ -7,12 +7,16 @@
  * during cache_registration
  */
 struct journal_replay {
-       struct list_head        list;
-       struct bch_extent_ptr   ptrs[BCH_REPLICAS_MAX];
+       struct journal_ptr {
+               bool            csum_good;
+               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                    csum_good;
        bool                    ignore;
        /* must be last: */
        struct jset             j;
@@ -40,12 +44,15 @@ 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_entry_validate(struct bch_fs *, const char *,
+int bch2_journal_entry_validate(struct bch_fs *, struct jset *,
                                struct jset_entry *, unsigned, int, int);
 void bch2_journal_entry_to_text(struct printbuf *, struct bch_fs *,
                                struct jset_entry *);
 
-int bch2_journal_read(struct bch_fs *, struct list_head *, u64 *, u64 *);
+void bch2_journal_ptrs_to_text(struct printbuf *, struct bch_fs *,
+                              struct journal_replay *);
+
+int bch2_journal_read(struct bch_fs *, u64 *, u64 *, u64 *);
 
 void bch2_journal_write(struct closure *);