summaryrefslogtreecommitdiff
path: root/fs/bcachefs/buckets_types.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-02-14 00:07:38 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-06-20 22:52:02 -0400
commit04d94103c45421f2c44a14bf6dc3bedd83886509 (patch)
tree6fc3bffb23045104d52865d9a0742aec4e5b51d3 /fs/bcachefs/buckets_types.h
parenta93a75d5887143a7e6c39d2a48f7e9bb6f26d9de (diff)
bcachefs: Kill struct bucket_mark
This switches struct bucket to using a lock, instead of cmpxchg. And now that the protected members no longer need to fit into a u64, we can expand the sector counts to 32 bits. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets_types.h')
-rw-r--r--fs/bcachefs/buckets_types.h30
1 files changed, 8 insertions, 22 deletions
diff --git a/fs/bcachefs/buckets_types.h b/fs/bcachefs/buckets_types.h
index f7bf5c1d732f..e79a33795bf9 100644
--- a/fs/bcachefs/buckets_types.h
+++ b/fs/bcachefs/buckets_types.h
@@ -7,29 +7,15 @@
#define BUCKET_JOURNAL_SEQ_BITS 16
-struct bucket_mark {
- union {
- atomic64_t v;
-
- struct {
- u8 gen;
- u8 data_type:3,
- stripe:1;
- u16 dirty_sectors;
- u16 cached_sectors;
- };
- };
-};
-
struct bucket {
- union {
- struct bucket_mark _mark;
- const struct bucket_mark mark;
- };
-
- unsigned gen_valid:1;
- u8 stripe_redundancy;
- u32 stripe;
+ u8 lock;
+ u8 gen_valid:1;
+ u8 data_type:7;
+ u8 gen;
+ u8 stripe_redundancy;
+ u32 stripe;
+ u32 dirty_sectors;
+ u32 cached_sectors;
};
struct bucket_array {