diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-11-25 12:16:22 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-11-25 21:48:42 -0500 |
commit | 3f3ae1250e739fb446639efad0ba916ba0a012f0 (patch) | |
tree | 45cf4240511839b19b067892ed0e768c99a0fd72 /fs/bcachefs | |
parent | e4f72bb46a774b449ffe864fa6fffa7ecbf8f3f7 (diff) | |
download | lwn-3f3ae1250e739fb446639efad0ba916ba0a012f0.tar.gz lwn-3f3ae1250e739fb446639efad0ba916ba0a012f0.zip |
bcachefs: bpos is misaligned on big endian
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 <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r-- | fs/bcachefs/bcachefs_format.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h index 0a750953ff92..ca0842f9b7e9 100644 --- a/fs/bcachefs/bcachefs_format.h +++ b/fs/bcachefs/bcachefs_format.h @@ -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) |