aboutsummaryrefslogtreecommitdiffstats
path: root/kerncompat.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-12-12 14:39:46 -0500
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-12-12 14:39:46 -0500
commit140d96a562d72d5f581c076298fbd1682811b1e2 (patch)
treebf97045baa3c8797dffd593fb61690d16bca698b /kerncompat.h
parentfba66bd8652b954be7e98699d81c8e57222b77e4 (diff)
downloadbtrfs-progs-140d96a562d72d5f581c076298fbd1682811b1e2.tar.gz
btrfs-progs-140d96a562d72d5f581c076298fbd1682811b1e2.tar.xz
btrfs-progs-140d96a562d72d5f581c076298fbd1682811b1e2.zip
Create macros to generation set/get funcs for on disk structures
Diffstat (limited to 'kerncompat.h')
-rw-r--r--kerncompat.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/kerncompat.h b/kerncompat.h
index 3681dd8..18f508f 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
+
#if __BYTE_ORDER == __BIG_ENDIAN
#define cpu_to_le64(x) ((__force __le64)(u64)(bswap_64(x)))
#define le64_to_cpu(x) ((__force u64)(__le64)(bswap_64(x)))