]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/super_types.h
Update bcachefs sources to 9abf628c70 bcachefs: Fix a spurious error in fsck
[bcachefs-tools-debian] / libbcachefs / super_types.h
index 69c747de65fb9c1ec04efaa9d768fe2c8ce90807..ab83ade959e42403e59ffcb1b2f30e4efaeb6f31 100644 (file)
@@ -1,12 +1,61 @@
-#ifndef _BCACHE_SUPER_TYPES_H
-#define _BCACHE_SUPER_TYPES_H
+#ifndef _BCACHEFS_SUPER_TYPES_H
+#define _BCACHEFS_SUPER_TYPES_H
 
-struct bcache_superblock {
+struct bch_sb_handle {
        struct bch_sb           *sb;
        struct block_device     *bdev;
        struct bio              *bio;
        unsigned                page_order;
        fmode_t                 mode;
+       unsigned                have_layout:1;
+       unsigned                have_bio:1;
+       unsigned                fs_sb:1;
 };
 
-#endif /* _BCACHE_SUPER_TYPES_H */
+struct bch_devs_mask {
+       unsigned long d[BITS_TO_LONGS(BCH_SB_MEMBERS_MAX)];
+};
+
+struct bch_devs_list {
+       u8                      nr;
+       u8                      devs[BCH_REPLICAS_MAX + 1];
+};
+
+struct bch_member_cpu {
+       u64                     nbuckets;       /* device size */
+       u16                     first_bucket;   /* index of first bucket used */
+       u16                     bucket_size;    /* sectors */
+       u16                     group;
+       u8                      state;
+       u8                      replacement;
+       u8                      discard;
+       u8                      data_allowed;
+       u8                      durability;
+       u8                      valid;
+};
+
+struct bch_replicas_cpu_entry {
+       u8                      data_type;
+       u8                      devs[BCH_SB_MEMBERS_MAX / 8];
+};
+
+struct bch_replicas_cpu {
+       struct rcu_head         rcu;
+       unsigned                nr;
+       unsigned                entry_size;
+       struct bch_replicas_cpu_entry entries[];
+};
+
+struct bch_disk_group_cpu {
+       bool                            deleted;
+       u16                             parent;
+       struct bch_devs_mask            devs;
+};
+
+struct bch_disk_groups_cpu {
+       struct rcu_head                 rcu;
+       unsigned                        nr;
+       struct bch_disk_group_cpu       entries[];
+};
+
+#endif /* _BCACHEFS_SUPER_TYPES_H */