X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libbcachefs%2Fsuper_types.h;h=ab83ade959e42403e59ffcb1b2f30e4efaeb6f31;hb=bb6f4111fbfe2550eb7b583586e732a473ba62f0;hp=69c747de65fb9c1ec04efaa9d768fe2c8ce90807;hpb=5ec39af8eaba49aee7bafa44c661da39e2f40dc3;p=bcachefs-tools-debian diff --git a/libbcachefs/super_types.h b/libbcachefs/super_types.h index 69c747d..ab83ade 100644 --- a/libbcachefs/super_types.h +++ b/libbcachefs/super_types.h @@ -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 */