summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_arch.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@sgi.com>2006-01-11 07:23:43 +0300
committerNathan Scott <nathans@sgi.com>2006-01-11 07:23:43 +0300
commitd3a9b1f9da4ee3e6d284148412097621b1c9e575 (patch)
tree0de472c3ae18e863aaa0099f2227e2163f71693a /fs/xfs/xfs_arch.h
parentf60d36690ce11a6a41b89e63b4201fbba3aa0bfb (diff)
downloadlinux-d3a9b1f9da4ee3e6d284148412097621b1c9e575.tar.xz
[XFS] merge xfs_arch.h userspace changes back
SGI-PV: 907752 SGI-Modid: xfs-linux-melb:xfs-kern:201882a Signed-off-by: Christoph Hellwig <hch@sgi.com> Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_arch.h')
-rw-r--r--fs/xfs/xfs_arch.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/xfs/xfs_arch.h b/fs/xfs/xfs_arch.h
index 68e5051d8e24..f1aeda599eb1 100644
--- a/fs/xfs/xfs_arch.h
+++ b/fs/xfs/xfs_arch.h
@@ -40,6 +40,22 @@
#undef XFS_NATIVE_HOST
#endif
+#ifdef XFS_NATIVE_HOST
+#define cpu_to_be16(val) ((__be16)(val))
+#define cpu_to_be32(val) ((__be32)(val))
+#define cpu_to_be64(val) ((__be64)(val))
+#define be16_to_cpu(val) ((__uint16_t)(val)
+#define be32_to_cpu(val) ((__uint32_t)(val))
+#define be64_to_cpu(val) ((__uint64_t)(val))
+#else
+#define cpu_to_be16(val) (__swab16((__uint16_t)(val)))
+#define cpu_to_be32(val) (__swab32((__uint32_t)(val)))
+#define cpu_to_be64(val) (__swab64((__uint64_t)(val)))
+#define be16_to_cpu(val) (__swab16((__be16)(val)))
+#define be32_to_cpu(val) (__swab32((__be32)(val)))
+#define be64_to_cpu(val) (__swab64((__be64)(val)))
+#endif
+
#endif /* __KERNEL__ */
/* do we need conversion? */