]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/super_types.h
Update bcachefs sources to f70a3402188e bcachefs: Fix ca->oldest_gen allocation
[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         struct bio              *bio;
9         void                    *holder;
10         size_t                  buffer_size;
11         blk_mode_t              mode;
12         unsigned                have_layout:1;
13         unsigned                have_bio:1;
14         unsigned                fs_sb:1;
15         u64                     seq;
16 };
17
18 struct bch_devs_mask {
19         unsigned long d[BITS_TO_LONGS(BCH_SB_MEMBERS_MAX)];
20 };
21
22 struct bch_devs_list {
23         u8                      nr;
24         u8                      devs[BCH_BKEY_PTRS_MAX];
25 };
26
27 struct bch_member_cpu {
28         u64                     nbuckets;       /* device size */
29         u16                     first_bucket;   /* index of first bucket used */
30         u16                     bucket_size;    /* sectors */
31         u16                     group;
32         u8                      state;
33         u8                      discard;
34         u8                      data_allowed;
35         u8                      durability;
36         u8                      freespace_initialized;
37         u8                      valid;
38 };
39
40 struct bch_disk_group_cpu {
41         bool                            deleted;
42         u16                             parent;
43         struct bch_devs_mask            devs;
44 };
45
46 struct bch_disk_groups_cpu {
47         struct rcu_head                 rcu;
48         unsigned                        nr;
49         struct bch_disk_group_cpu       entries[] __counted_by(nr);
50 };
51
52 #endif /* _BCACHEFS_SUPER_TYPES_H */