diff options
Diffstat (limited to 'fs/xfs/xfs_arch.h')
-rw-r--r-- | fs/xfs/xfs_arch.h | 16 |
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 @@ | |||
40 | #undef XFS_NATIVE_HOST | 40 | #undef XFS_NATIVE_HOST |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #ifdef XFS_NATIVE_HOST | ||
44 | #define cpu_to_be16(val) ((__be16)(val)) | ||
45 | #define cpu_to_be32(val) ((__be32)(val)) | ||
46 | #define cpu_to_be64(val) ((__be64)(val)) | ||
47 | #define be16_to_cpu(val) ((__uint16_t)(val) | ||
48 | #define be32_to_cpu(val) ((__uint32_t)(val)) | ||
49 | #define be64_to_cpu(val) ((__uint64_t)(val)) | ||
50 | #else | ||
51 | #define cpu_to_be16(val) (__swab16((__uint16_t)(val))) | ||
52 | #define cpu_to_be32(val) (__swab32((__uint32_t)(val))) | ||
53 | #define cpu_to_be64(val) (__swab64((__uint64_t)(val))) | ||
54 | #define be16_to_cpu(val) (__swab16((__be16)(val))) | ||
55 | #define be32_to_cpu(val) (__swab32((__be32)(val))) | ||
56 | #define be64_to_cpu(val) (__swab64((__be64)(val))) | ||
57 | #endif | ||
58 | |||
43 | #endif /* __KERNEL__ */ | 59 | #endif /* __KERNEL__ */ |
44 | 60 | ||
45 | /* do we need conversion? */ | 61 | /* do we need conversion? */ |