summaryrefslogtreecommitdiff
path: root/fs/bcachefs/super-io.h
diff options
context:
space:
mode:
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)