]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/super_types.h
87d159b9b8cd663fcaa8d2218a2f64190bdea490
[bcachefs-tools-debian] / libbcachefs / super_types.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_SUPER_TYPES_H
3 #define _BCACHEFS_SUPER_TYPES_H
4
5 struct bch_sb_handle {
6         struct bch_sb           *sb;
7         struct block_device     *bdev;
8         char                    *sb_name;
9         struct bio              *bio;
10         void                    *holder;
11         size_t                  buffer_size;
12         blk_mode_t              mode;
13         unsigned                have_layout:1;
14         unsigned                have_bio:1;
15         unsigned                fs_sb:1;
16         u64                     seq;
17 };
18
19 struct bch_devs_mask {
20         unsigned long d[BITS_TO_LONGS(BCH_SB_MEMBERS_MAX)];
21 };
22
23 struct bch_devs_list {
24         u8                      nr;
25         u8                      data[BCH_BKEY_PTRS_MAX];
26 };
27
28 struct bch_member_cpu {
29         u64                     nbuckets;       /* device size */
30         u16                     first_bucket;   /* index of first bucket used */
31         u16                     bucket_size;    /* sectors */
32         u16                     group;
33         u8                      state;
34         u8                      discard;
35         u8                      data_allowed;
36         u8                      durability;
37         u8                      freespace_initialized;
38         u8                      valid;
39 };
40
41 #endif /* _BCACHEFS_SUPER_TYPES_H */