summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-01-25 11:40:26 -0900
committerKent Overstreet <kent.overstreet@gmail.com>2017-01-18 21:35:51 -0900
commitefc0e112c7173d4ddfac2cb1d19c92a5577558a2 (patch)
tree7f278214b3fc239e84488c52dff5f5f20582fa48
parent3e485b1a4301d99c92479711edf6cc8c86a0ad72 (diff)
bcache: fix extents on big endian
-rw-r--r--include/uapi/linux/bcache.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/include/uapi/linux/bcache.h b/include/uapi/linux/bcache.h
index 0397ebf350e7..ed88a0cc7cde 100644
--- a/include/uapi/linux/bcache.h
+++ b/include/uapi/linux/bcache.h
@@ -330,15 +330,16 @@ struct bch_extent_crc32 {
uncompressed_size:8,
csum_type:4,
compression_type:4;
+ __u32 csum;
#elif defined (__BIG_ENDIAN_BITFIELD)
- __u32 csum_type:4,
- compression_type:4,
+ __u32 csum;
+ __u32 compression_type:4,
+ csum_type:4,
uncompressed_size:8,
compressed_size:8,
offset:7,
type:1;
#endif
- __u32 csum;
} __attribute__((packed)) __attribute__((aligned(8)));
#define CRC32_EXTENT_SIZE_MAX (1U << 7)
@@ -346,17 +347,17 @@ struct bch_extent_crc32 {
struct bch_extent_crc64 {
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u64 type:3,
+ offset:17,
compressed_size:18,
uncompressed_size:18,
- offset:17,
csum_type:4,
compression_type:4;
#elif defined (__BIG_ENDIAN_BITFIELD)
- __u64 csum_type:4,
- compression_type:4,
- offset:17,
+ __u64 compression_type:4,
+ csum_type:4,
uncompressed_size:18,
compressed_size:18,
+ offset:17,
type:3;
#endif
__u64 csum;
@@ -386,7 +387,14 @@ struct bch_extent_ptr {
} __attribute__((packed)) __attribute__((aligned(8)));
union bch_extent_entry {
- __u8 type;
+#if defined(__LITTLE_ENDIAN__) || BITS_PER_LONG == 64
+ unsigned long type;
+#elif BITS_PER_LONG == 32
+ struct {
+ unsigned long pad;
+ unsigned long type;
+ };
+#endif
struct bch_extent_crc32 crc32;
struct bch_extent_crc64 crc64;
struct bch_extent_ptr ptr;