path: root/kerncompat.h
diff options
authorChris Mason <>2007-12-12 14:39:46 -0500
committerDavid Woodhouse <>2007-12-12 14:39:46 -0500
commit140d96a562d72d5f581c076298fbd1682811b1e2 (patch)
treebf97045baa3c8797dffd593fb61690d16bca698b /kerncompat.h
parentfba66bd8652b954be7e98699d81c8e57222b77e4 (diff)
Create macros to generation set/get funcs for on disk structures
Diffstat (limited to 'kerncompat.h')
1 files changed, 8 insertions, 0 deletions
diff --git a/kerncompat.h b/kerncompat.h
index 3681dd88..18f508f3 100644
--- a/kerncompat.h
+++ b/kerncompat.h
@@ -138,6 +138,14 @@ typedef u32 __bitwise __be32;
typedef u64 __bitwise __le64;
typedef u64 __bitwise __be64;
+/* Macros to generate set/get funcs for the struct fields
+ * assume there is a lefoo_to_cpu for every type, so lets make a simple
+ * one for u8:
+ */
+#define le8_to_cpu(v) (v)
+#define cpu_to_le8(v) (v)
+#define __le8 u8
#define cpu_to_le64(x) ((__force __le64)(u64)(bswap_64(x)))
#define le64_to_cpu(x) ((__force u64)(__le64)(bswap_64(x)))