diff options
author | Nathan Scott <nathans@sgi.com> | 2005-09-08 01:30:05 -0400 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-09-08 01:30:05 -0400 |
commit | f016bad6be720496b5582a59738bca00a26f876c (patch) | |
tree | 2a99f1eec64972538fc10b13e8076ff4b7c17e0c /fs/xfs | |
parent | caf39e87cc1182f7dae84eefc43ca14d54c78ef9 (diff) |
[XFS] Cleanup some -Wundef flag warnings in the endian macros (thanks
Christoph).
SGI-PV: 942400
SGI-Modid: xfs-linux-melb:xfs-kern:23771a
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_arch.h | 22 | ||||
-rw-r--r-- | fs/xfs/xfs_bmap_btree.c | 8 | ||||
-rw-r--r-- | fs/xfs/xfs_bmap_btree.h | 12 | ||||
-rw-r--r-- | fs/xfs/xfs_dir_leaf.h | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_inode_item.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_log_priv.h | 10 |
6 files changed, 32 insertions, 30 deletions
diff --git a/fs/xfs/xfs_arch.h b/fs/xfs/xfs_arch.h index ae35189b3d70..5ab0dd885b1b 100644 --- a/fs/xfs/xfs_arch.h +++ b/fs/xfs/xfs_arch.h | |||
@@ -40,22 +40,28 @@ | |||
40 | 40 | ||
41 | #include <asm/byteorder.h> | 41 | #include <asm/byteorder.h> |
42 | 42 | ||
43 | #ifdef __LITTLE_ENDIAN | ||
44 | # define __BYTE_ORDER __LITTLE_ENDIAN | ||
45 | #endif | ||
46 | #ifdef __BIG_ENDIAN | 43 | #ifdef __BIG_ENDIAN |
47 | # define __BYTE_ORDER __BIG_ENDIAN | 44 | #define XFS_NATIVE_HOST 1 |
45 | #else | ||
46 | #undef XFS_NATIVE_HOST | ||
47 | #endif | ||
48 | |||
49 | #else /* __KERNEL__ */ | ||
50 | |||
51 | #if __BYTE_ORDER == __BIG_ENDIAN | ||
52 | #define XFS_NATIVE_HOST 1 | ||
53 | #else | ||
54 | #undef XFS_NATIVE_HOST | ||
48 | #endif | 55 | #endif |
49 | 56 | ||
50 | #endif /* __KERNEL__ */ | 57 | #endif /* __KERNEL__ */ |
51 | 58 | ||
52 | /* do we need conversion? */ | 59 | /* do we need conversion? */ |
53 | |||
54 | #define ARCH_NOCONVERT 1 | 60 | #define ARCH_NOCONVERT 1 |
55 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 61 | #ifdef XFS_NATIVE_HOST |
56 | # define ARCH_CONVERT 0 | ||
57 | #else | ||
58 | # define ARCH_CONVERT ARCH_NOCONVERT | 62 | # define ARCH_CONVERT ARCH_NOCONVERT |
63 | #else | ||
64 | # define ARCH_CONVERT 0 | ||
59 | #endif | 65 | #endif |
60 | 66 | ||
61 | /* generic swapping macros */ | 67 | /* generic swapping macros */ |
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c index 09c413576ba8..09a77b17565b 100644 --- a/fs/xfs/xfs_bmap_btree.c +++ b/fs/xfs/xfs_bmap_btree.c | |||
@@ -2017,7 +2017,7 @@ xfs_bmbt_get_state( | |||
2017 | ext_flag); | 2017 | ext_flag); |
2018 | } | 2018 | } |
2019 | 2019 | ||
2020 | #if __BYTE_ORDER != __BIG_ENDIAN | 2020 | #ifndef XFS_NATIVE_HOST |
2021 | /* Endian flipping versions of the bmbt extraction functions */ | 2021 | /* Endian flipping versions of the bmbt extraction functions */ |
2022 | void | 2022 | void |
2023 | xfs_bmbt_disk_get_all( | 2023 | xfs_bmbt_disk_get_all( |
@@ -2087,7 +2087,7 @@ xfs_bmbt_disk_get_state( | |||
2087 | return xfs_extent_state(xfs_bmbt_disk_get_blockcount(r), | 2087 | return xfs_extent_state(xfs_bmbt_disk_get_blockcount(r), |
2088 | ext_flag); | 2088 | ext_flag); |
2089 | } | 2089 | } |
2090 | #endif | 2090 | #endif /* XFS_NATIVE_HOST */ |
2091 | 2091 | ||
2092 | 2092 | ||
2093 | /* | 2093 | /* |
@@ -2531,7 +2531,7 @@ xfs_bmbt_set_allf( | |||
2531 | #endif /* XFS_BIG_BLKNOS */ | 2531 | #endif /* XFS_BIG_BLKNOS */ |
2532 | } | 2532 | } |
2533 | 2533 | ||
2534 | #if __BYTE_ORDER != __BIG_ENDIAN | 2534 | #ifndef XFS_NATIVE_HOST |
2535 | /* | 2535 | /* |
2536 | * Set all the fields in a bmap extent record from the uncompressed form. | 2536 | * Set all the fields in a bmap extent record from the uncompressed form. |
2537 | */ | 2537 | */ |
@@ -2617,7 +2617,7 @@ xfs_bmbt_disk_set_allf( | |||
2617 | } | 2617 | } |
2618 | #endif /* XFS_BIG_BLKNOS */ | 2618 | #endif /* XFS_BIG_BLKNOS */ |
2619 | } | 2619 | } |
2620 | #endif | 2620 | #endif /* XFS_NATIVE_HOST */ |
2621 | 2621 | ||
2622 | /* | 2622 | /* |
2623 | * Set the blockcount field in a bmap extent record. | 2623 | * Set the blockcount field in a bmap extent record. |
diff --git a/fs/xfs/xfs_bmap_btree.h b/fs/xfs/xfs_bmap_btree.h index 0a40cf126c28..2cf4fe45cbcb 100644 --- a/fs/xfs/xfs_bmap_btree.h +++ b/fs/xfs/xfs_bmap_btree.h | |||
@@ -62,7 +62,7 @@ typedef struct xfs_bmdr_block | |||
62 | * l1:0-20 are blockcount. | 62 | * l1:0-20 are blockcount. |
63 | */ | 63 | */ |
64 | 64 | ||
65 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 65 | #ifndef XFS_NATIVE_HOST |
66 | 66 | ||
67 | #define BMBT_TOTAL_BITLEN 128 /* 128 bits, 16 bytes */ | 67 | #define BMBT_TOTAL_BITLEN 128 /* 128 bits, 16 bytes */ |
68 | #define BMBT_EXNTFLAG_BITOFF 0 | 68 | #define BMBT_EXNTFLAG_BITOFF 0 |
@@ -87,7 +87,7 @@ typedef struct xfs_bmdr_block | |||
87 | #define BMBT_BLOCKCOUNT_BITOFF 64 /* Start of second 64 bit container */ | 87 | #define BMBT_BLOCKCOUNT_BITOFF 64 /* Start of second 64 bit container */ |
88 | #define BMBT_BLOCKCOUNT_BITLEN 21 | 88 | #define BMBT_BLOCKCOUNT_BITLEN 21 |
89 | 89 | ||
90 | #endif | 90 | #endif /* XFS_NATIVE_HOST */ |
91 | 91 | ||
92 | 92 | ||
93 | #define BMBT_USE_64 1 | 93 | #define BMBT_USE_64 1 |
@@ -505,7 +505,7 @@ xfs_exntst_t | |||
505 | xfs_bmbt_get_state( | 505 | xfs_bmbt_get_state( |
506 | xfs_bmbt_rec_t *r); | 506 | xfs_bmbt_rec_t *r); |
507 | 507 | ||
508 | #if __BYTE_ORDER != __BIG_ENDIAN | 508 | #ifndef XFS_NATIVE_HOST |
509 | void | 509 | void |
510 | xfs_bmbt_disk_get_all( | 510 | xfs_bmbt_disk_get_all( |
511 | xfs_bmbt_rec_t *r, | 511 | xfs_bmbt_rec_t *r, |
@@ -538,7 +538,7 @@ xfs_bmbt_disk_get_startoff( | |||
538 | xfs_bmbt_get_blockcount(r) | 538 | xfs_bmbt_get_blockcount(r) |
539 | #define xfs_bmbt_disk_get_startoff(r) \ | 539 | #define xfs_bmbt_disk_get_startoff(r) \ |
540 | xfs_bmbt_get_startoff(r) | 540 | xfs_bmbt_get_startoff(r) |
541 | #endif | 541 | #endif /* XFS_NATIVE_HOST */ |
542 | 542 | ||
543 | int | 543 | int |
544 | xfs_bmbt_increment( | 544 | xfs_bmbt_increment( |
@@ -623,7 +623,7 @@ xfs_bmbt_set_state( | |||
623 | xfs_bmbt_rec_t *r, | 623 | xfs_bmbt_rec_t *r, |
624 | xfs_exntst_t v); | 624 | xfs_exntst_t v); |
625 | 625 | ||
626 | #if __BYTE_ORDER != __BIG_ENDIAN | 626 | #ifndef XFS_NATIVE_HOST |
627 | void | 627 | void |
628 | xfs_bmbt_disk_set_all( | 628 | xfs_bmbt_disk_set_all( |
629 | xfs_bmbt_rec_t *r, | 629 | xfs_bmbt_rec_t *r, |
@@ -641,7 +641,7 @@ xfs_bmbt_disk_set_allf( | |||
641 | xfs_bmbt_set_all(r, s) | 641 | xfs_bmbt_set_all(r, s) |
642 | #define xfs_bmbt_disk_set_allf(r, o, b, c, v) \ | 642 | #define xfs_bmbt_disk_set_allf(r, o, b, c, v) \ |
643 | xfs_bmbt_set_allf(r, o, b, c, v) | 643 | xfs_bmbt_set_allf(r, o, b, c, v) |
644 | #endif | 644 | #endif /* XFS_NATIVE_HOST */ |
645 | 645 | ||
646 | void | 646 | void |
647 | xfs_bmbt_to_bmdr( | 647 | xfs_bmbt_to_bmdr( |
diff --git a/fs/xfs/xfs_dir_leaf.h b/fs/xfs/xfs_dir_leaf.h index dd423ce1bc8d..480bffc1f29f 100644 --- a/fs/xfs/xfs_dir_leaf.h +++ b/fs/xfs/xfs_dir_leaf.h | |||
@@ -127,13 +127,13 @@ typedef union { | |||
127 | * Watch the order here (endian-ness dependent). | 127 | * Watch the order here (endian-ness dependent). |
128 | */ | 128 | */ |
129 | struct { | 129 | struct { |
130 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 130 | #ifndef XFS_NATIVE_HOST |
131 | xfs_dahash_t h; /* hash value */ | 131 | xfs_dahash_t h; /* hash value */ |
132 | __uint32_t be; /* block and entry */ | 132 | __uint32_t be; /* block and entry */ |
133 | #else /* __BYTE_ORDER == __BIG_ENDIAN */ | 133 | #else |
134 | __uint32_t be; /* block and entry */ | 134 | __uint32_t be; /* block and entry */ |
135 | xfs_dahash_t h; /* hash value */ | 135 | xfs_dahash_t h; /* hash value */ |
136 | #endif /* __BYTE_ORDER == __BIG_ENDIAN */ | 136 | #endif /* XFS_NATIVE_HOST */ |
137 | } s; | 137 | } s; |
138 | } xfs_dircook_t; | 138 | } xfs_dircook_t; |
139 | 139 | ||
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 276ec70eb7f9..50e2cadf9091 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c | |||
@@ -341,7 +341,7 @@ xfs_inode_item_format( | |||
341 | nrecs = ip->i_df.if_bytes / | 341 | nrecs = ip->i_df.if_bytes / |
342 | (uint)sizeof(xfs_bmbt_rec_t); | 342 | (uint)sizeof(xfs_bmbt_rec_t); |
343 | ASSERT(nrecs > 0); | 343 | ASSERT(nrecs > 0); |
344 | #if __BYTE_ORDER == __BIG_ENDIAN | 344 | #ifdef XFS_NATIVE_HOST |
345 | if (nrecs == ip->i_d.di_nextents) { | 345 | if (nrecs == ip->i_d.di_nextents) { |
346 | /* | 346 | /* |
347 | * There are no delayed allocation | 347 | * There are no delayed allocation |
@@ -473,7 +473,7 @@ xfs_inode_item_format( | |||
473 | #endif | 473 | #endif |
474 | ASSERT(nrecs > 0); | 474 | ASSERT(nrecs > 0); |
475 | ASSERT(nrecs == ip->i_d.di_anextents); | 475 | ASSERT(nrecs == ip->i_d.di_anextents); |
476 | #if __BYTE_ORDER == __BIG_ENDIAN | 476 | #ifdef XFS_NATIVE_HOST |
477 | /* | 477 | /* |
478 | * There are not delayed allocation extents | 478 | * There are not delayed allocation extents |
479 | * for attributes, so just point at the array. | 479 | * for attributes, so just point at the array. |
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h index eb7fdc6ebc32..a884cea82fca 100644 --- a/fs/xfs/xfs_log_priv.h +++ b/fs/xfs/xfs_log_priv.h | |||
@@ -112,7 +112,7 @@ struct xfs_mount; | |||
112 | * this has endian issues, of course. | 112 | * this has endian issues, of course. |
113 | */ | 113 | */ |
114 | 114 | ||
115 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 115 | #ifndef XFS_NATIVE_HOST |
116 | #define GET_CLIENT_ID(i,arch) \ | 116 | #define GET_CLIENT_ID(i,arch) \ |
117 | ((i) & 0xff) | 117 | ((i) & 0xff) |
118 | #else | 118 | #else |
@@ -414,14 +414,10 @@ typedef struct xlog_op_header { | |||
414 | #define XLOG_FMT_IRIX_BE 3 | 414 | #define XLOG_FMT_IRIX_BE 3 |
415 | 415 | ||
416 | /* our fmt */ | 416 | /* our fmt */ |
417 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 417 | #ifdef XFS_NATIVE_HOST |
418 | #define XLOG_FMT XLOG_FMT_LINUX_LE | ||
419 | #else | ||
420 | #if __BYTE_ORDER == __BIG_ENDIAN | ||
421 | #define XLOG_FMT XLOG_FMT_LINUX_BE | 418 | #define XLOG_FMT XLOG_FMT_LINUX_BE |
422 | #else | 419 | #else |
423 | #error unknown byte order | 420 | #define XLOG_FMT XLOG_FMT_LINUX_LE |
424 | #endif | ||
425 | #endif | 421 | #endif |
426 | 422 | ||
427 | typedef struct xlog_rec_header { | 423 | typedef struct xlog_rec_header { |