]> Git Repo - linux.git/commitdiff
bcachefs: bpos is misaligned on big endian
authorKent Overstreet <[email protected]>
Sat, 25 Nov 2023 17:16:22 +0000 (12:16 -0500)
committerKent Overstreet <[email protected]>
Sun, 26 Nov 2023 02:48:42 +0000 (21:48 -0500)
bkey embeds a bpos that is misaligned on big endian; this is so that
bch2_bkey_swab() works correctly without having to differentiate between
packed and non-packed keys (a debatable design decision).

This means it can't have the __aligned() tag on big endian.

Signed-off-by: Kent Overstreet <[email protected]>
fs/bcachefs/bcachefs_format.h

index 0a750953ff921b9d62d9fd1918da27d375c2c6dc..ca0842f9b7e9033d4383244d9c9fa7bc651802c6 100644 (file)
@@ -151,7 +151,11 @@ struct bpos {
 #else
 #error edit for your odd byteorder.
 #endif
-} __packed __aligned(4);
+} __packed
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+__aligned(4)
+#endif
+;
 
 #define KEY_INODE_MAX                  ((__u64)~0ULL)
 #define KEY_OFFSET_MAX                 ((__u64)~0ULL)
This page took 0.0554750000000001 seconds and 4 git commands to generate.