]> git.ipfire.org Git - thirdparty/kernel/stable.git/blob - fs/bcachefs/super_types.h
KVM: Harden copying of userspace-array against overflow
[thirdparty/kernel/stable.git] / fs / bcachefs / 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 #endif /* _BCACHEFS_SUPER_TYPES_H */