Skip to content

Commit 3f3ae12

Browse files
author
Kent Overstreet
committed
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>
1 parent e4f72bb commit 3f3ae12

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

fs/bcachefs/bcachefs_format.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ struct bpos {
151151
#else
152152
#error edit for your odd byteorder.
153153
#endif
154-
} __packed __aligned(4);
154+
} __packed
155+
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
156+
__aligned(4)
157+
#endif
158+
;
155159

156160
#define KEY_INODE_MAX ((__u64)~0ULL)
157161
#define KEY_OFFSET_MAX ((__u64)~0ULL)

0 commit comments

Comments
 (0)