summaryrefslogtreecommitdiff
path: root/fs/bcachefs/bcachefs_format.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-06-28 02:02:17 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:10:05 +0300
commit2766876d5d118abd59d14fbe5b31e7e208ea11f2 (patch)
tree8b12ea230e8b3bb2a8c58e78b2d7bfdb9247458e /fs/bcachefs/bcachefs_format.h
parent4e1430a728499ce8088e1bdd0dd6467ce3447ca0 (diff)
downloadlinux-2766876d5d118abd59d14fbe5b31e7e208ea11f2.tar.xz
bcachefs: struct bch_extent_rebalance
This adds the extent entry for extents that rebalance needs to do something with. We're adding this ahead of the main rebalance_work patchset, because adding new extent entries can't be done in a forwards-compatible way. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs_format.h')
-rw-r--r--fs/bcachefs/bcachefs_format.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h
index a73f1de8e872..158cefb87684 100644
--- a/fs/bcachefs/bcachefs_format.h
+++ b/fs/bcachefs/bcachefs_format.h
@@ -488,8 +488,9 @@ struct bch_csum {
x(crc32, 1) \
x(crc64, 2) \
x(crc128, 3) \
- x(stripe_ptr, 4)
-#define BCH_EXTENT_ENTRY_MAX 5
+ x(stripe_ptr, 4) \
+ x(rebalance, 5)
+#define BCH_EXTENT_ENTRY_MAX 6
enum bch_extent_entry_type {
#define x(f, n) BCH_EXTENT_ENTRY_##f = n,
@@ -624,6 +625,20 @@ struct bch_extent_reservation {
#endif
};
+struct bch_extent_rebalance {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u64 type:7,
+ unused:33,
+ compression:8,
+ target:16;
+#elif defined (__BIG_ENDIAN_BITFIELD)
+ __u64 target:16,
+ compression:8,
+ unused:33,
+ type:7;
+#endif
+};
+
union bch_extent_entry {
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ || __BITS_PER_LONG == 64
unsigned long type;