summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/journal_io.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-02-19 01:18:18 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:24 -0400
commit72b7d6332b0a769b0b76c78b372aa733a3715c42 (patch)
treeb8d477ea130b40b0fb30145ac137f91a101a88cf /fs/bcachefs/journal_io.h
parenta9de137bf63107245b43e9046cddc1acc447221a (diff)
downloadlinux-stable-72b7d6332b0a769b0b76c78b372aa733a3715c42.tar.gz
linux-stable-72b7d6332b0a769b0b76c78b372aa733a3715c42.tar.bz2
linux-stable-72b7d6332b0a769b0b76c78b372aa733a3715c42.zip
bcachefs: Store logical location of journal entries
When viewing what's in the journal, it's more useful to have the logical location - journal bucket and offset within that bucket - than just the offset on that device. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/journal_io.h')
-rw-r--r--fs/bcachefs/journal_io.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/bcachefs/journal_io.h b/fs/bcachefs/journal_io.h
index d8425fe0d67b..f2001835e43e 100644
--- a/fs/bcachefs/journal_io.h
+++ b/fs/bcachefs/journal_io.h
@@ -8,7 +8,12 @@
*/
struct journal_replay {
struct list_head list;
- struct bch_extent_ptr ptrs[BCH_REPLICAS_MAX];
+ 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: */
@@ -45,6 +50,9 @@ int bch2_journal_entry_validate(struct bch_fs *, const char *,
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 *, struct list_head *, u64 *, u64 *);
void bch2_journal_write(struct closure *);