summaryrefslogtreecommitdiff
path: root/fs/bcachefs/super-io.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-10-25 22:51:16 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-11-02 04:11:08 +0300
commitf5d26fa31ed2e260589f0bc8af010bb742f1231e (patch)
tree3d80b5c4ea7ac0a01bf1dba58a104d84d5a70e9b /fs/bcachefs/super-io.h
parent94119eeb02d114aa1f78dcfaabdca50b9b626790 (diff)
downloadlinux-f5d26fa31ed2e260589f0bc8af010bb742f1231e.tar.xz
bcachefs: bch_sb_field_errors
Add a new superblock section to keep counts of errors seen since filesystem creation: we'll be addingcounters for every distinct fsck error. The new superblock section has entries of the for [ id, count, time_of_last_error ]; this is intended to let us see what errors are occuring - and getting fixed - via show-super output. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super-io.h')
-rw-r--r--fs/bcachefs/super-io.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/super-io.h b/fs/bcachefs/super-io.h
index 5d079dd12f95..f5abd102bff7 100644
--- a/fs/bcachefs/super-io.h
+++ b/fs/bcachefs/super-io.h
@@ -23,6 +23,11 @@ u64 bch2_upgrade_recovery_passes(struct bch_fs *c,
unsigned,
unsigned);
+static inline size_t bch2_sb_field_bytes(struct bch_sb_field *f)
+{
+ return le32_to_cpu(f->u64s) * sizeof(u64);
+}
+
#define field_to_type(_f, _name) \
container_of_or_null(_f, struct bch_sb_field_##_name, field)