diff options
Diffstat (limited to 'fs/xfs/xfs_arch.h')
-rw-r--r-- | fs/xfs/xfs_arch.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/fs/xfs/xfs_arch.h b/fs/xfs/xfs_arch.h index 68e5051d8e24..c4836890b726 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? */ |
@@ -186,7 +202,7 @@ static inline void be64_add(__be64 *a, __s64 b) | |||
186 | */ | 202 | */ |
187 | 203 | ||
188 | #define XFS_GET_DIR_INO4(di) \ | 204 | #define XFS_GET_DIR_INO4(di) \ |
189 | (((u32)(di).i[0] << 24) | ((di).i[1] << 16) | ((di).i[2] << 8) | ((di).i[3])) | 205 | (((__u32)(di).i[0] << 24) | ((di).i[1] << 16) | ((di).i[2] << 8) | ((di).i[3])) |
190 | 206 | ||
191 | #define XFS_PUT_DIR_INO4(from, di) \ | 207 | #define XFS_PUT_DIR_INO4(from, di) \ |
192 | do { \ | 208 | do { \ |
@@ -197,9 +213,9 @@ do { \ | |||
197 | } while (0) | 213 | } while (0) |
198 | 214 | ||
199 | #define XFS_DI_HI(di) \ | 215 | #define XFS_DI_HI(di) \ |
200 | (((u32)(di).i[1] << 16) | ((di).i[2] << 8) | ((di).i[3])) | 216 | (((__u32)(di).i[1] << 16) | ((di).i[2] << 8) | ((di).i[3])) |
201 | #define XFS_DI_LO(di) \ | 217 | #define XFS_DI_LO(di) \ |
202 | (((u32)(di).i[4] << 24) | ((di).i[5] << 16) | ((di).i[6] << 8) | ((di).i[7])) | 218 | (((__u32)(di).i[4] << 24) | ((di).i[5] << 16) | ((di).i[6] << 8) | ((di).i[7])) |
203 | 219 | ||
204 | #define XFS_GET_DIR_INO8(di) \ | 220 | #define XFS_GET_DIR_INO8(di) \ |
205 | (((xfs_ino_t)XFS_DI_LO(di) & 0xffffffffULL) | \ | 221 | (((xfs_ino_t)XFS_DI_LO(di) & 0xffffffffULL) | \ |