drm/atomic-helper: document drm_atomic_helper_check() restrictions
[drm/drm-misc.git] / fs / bcachefs / buckets_types.h
blob28bd09a253c83e6bc1e5ac0c73550c3bc2414e8d
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BUCKETS_TYPES_H
3 #define _BUCKETS_TYPES_H
5 #include "bcachefs_format.h"
6 #include "util.h"
8 #define BUCKET_JOURNAL_SEQ_BITS 16
10 struct bucket {
11 u8 lock;
12 u8 gen_valid:1;
13 u8 data_type:7;
14 u8 gen;
15 u8 stripe_redundancy;
16 u32 stripe;
17 u32 dirty_sectors;
18 u32 cached_sectors;
19 u32 stripe_sectors;
20 } __aligned(sizeof(long));
22 struct bucket_gens {
23 struct rcu_head rcu;
24 u16 first_bucket;
25 size_t nbuckets;
26 size_t nbuckets_minus_first;
27 u8 b[];
30 struct bch_dev_usage {
31 struct bch_dev_usage_type {
32 u64 buckets;
33 u64 sectors; /* _compressed_ sectors: */
35 * XXX
36 * Why do we have this? Isn't it just buckets * bucket_size -
37 * sectors?
39 u64 fragmented;
40 } d[BCH_DATA_NR];
43 struct bch_fs_usage_base {
44 u64 hidden;
45 u64 btree;
46 u64 data;
47 u64 cached;
48 u64 reserved;
49 u64 nr_inodes;
52 struct bch_fs_usage_short {
53 u64 capacity;
54 u64 used;
55 u64 free;
56 u64 nr_inodes;
60 * A reservation for space on disk:
62 struct disk_reservation {
63 u64 sectors;
64 u32 gen;
65 unsigned nr_replicas;
68 #endif /* _BUCKETS_TYPES_H */