diff options
author | Nathan Scott <nathans@sgi.com> | 2006-03-17 01:26:52 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2006-03-17 01:26:52 -0500 |
commit | 70e73f59755867383edf563d5a5cbea614c0fd49 (patch) | |
tree | 6850f22b47754078b1695aad1ade7bf9705dc52a /fs/xfs/xfs_dir2_block.c | |
parent | 9cea236492ebabb9545564eb039aa0f477a05c96 (diff) |
[XFS] endianess annotations for xfs_dir2_data_hdr structure.
SGI-PV: 943272
SGI-Modid: xfs-linux-melb:xfs-kern:25484a
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_block.c')
-rw-r--r-- | fs/xfs/xfs_dir2_block.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c index 31bc99faa704..35a03f29b2fb 100644 --- a/fs/xfs/xfs_dir2_block.c +++ b/fs/xfs/xfs_dir2_block.c | |||
@@ -100,8 +100,7 @@ xfs_dir2_block_addname( | |||
100 | /* | 100 | /* |
101 | * Check the magic number, corrupted if wrong. | 101 | * Check the magic number, corrupted if wrong. |
102 | */ | 102 | */ |
103 | if (unlikely(INT_GET(block->hdr.magic, ARCH_CONVERT) | 103 | if (unlikely(be32_to_cpu(block->hdr.magic) != XFS_DIR2_BLOCK_MAGIC)) { |
104 | != XFS_DIR2_BLOCK_MAGIC)) { | ||
105 | XFS_CORRUPTION_ERROR("xfs_dir2_block_addname", | 104 | XFS_CORRUPTION_ERROR("xfs_dir2_block_addname", |
106 | XFS_ERRLEVEL_LOW, mp, block); | 105 | XFS_ERRLEVEL_LOW, mp, block); |
107 | xfs_da_brelse(tp, bp); | 106 | xfs_da_brelse(tp, bp); |
@@ -138,7 +137,7 @@ xfs_dir2_block_addname( | |||
138 | */ | 137 | */ |
139 | else { | 138 | else { |
140 | dup = (xfs_dir2_data_unused_t *) | 139 | dup = (xfs_dir2_data_unused_t *) |
141 | ((char *)block + INT_GET(bf[0].offset, ARCH_CONVERT)); | 140 | ((char *)block + be16_to_cpu(bf[0].offset)); |
142 | if (dup == enddup) { | 141 | if (dup == enddup) { |
143 | /* | 142 | /* |
144 | * It is the biggest freespace, is it too small | 143 | * It is the biggest freespace, is it too small |
@@ -149,10 +148,10 @@ xfs_dir2_block_addname( | |||
149 | * Yes, we use the second-largest | 148 | * Yes, we use the second-largest |
150 | * entry instead if it works. | 149 | * entry instead if it works. |
151 | */ | 150 | */ |
152 | if (INT_GET(bf[1].length, ARCH_CONVERT) >= len) | 151 | if (be16_to_cpu(bf[1].length) >= len) |
153 | dup = (xfs_dir2_data_unused_t *) | 152 | dup = (xfs_dir2_data_unused_t *) |
154 | ((char *)block + | 153 | ((char *)block + |
155 | INT_GET(bf[1].offset, ARCH_CONVERT)); | 154 | be16_to_cpu(bf[1].offset)); |
156 | else | 155 | else |
157 | dup = NULL; | 156 | dup = NULL; |
158 | } | 157 | } |
@@ -172,9 +171,9 @@ xfs_dir2_block_addname( | |||
172 | * If there are stale entries we'll use one for the leaf. | 171 | * If there are stale entries we'll use one for the leaf. |
173 | * Is the biggest entry enough to avoid compaction? | 172 | * Is the biggest entry enough to avoid compaction? |
174 | */ | 173 | */ |
175 | else if (INT_GET(bf[0].length, ARCH_CONVERT) >= len) { | 174 | else if (be16_to_cpu(bf[0].length) >= len) { |
176 | dup = (xfs_dir2_data_unused_t *) | 175 | dup = (xfs_dir2_data_unused_t *) |
177 | ((char *)block + INT_GET(bf[0].offset, ARCH_CONVERT)); | 176 | ((char *)block + be16_to_cpu(bf[0].offset)); |
178 | compact = 0; | 177 | compact = 0; |
179 | } | 178 | } |
180 | /* | 179 | /* |
@@ -935,7 +934,7 @@ xfs_dir2_leaf_to_block( | |||
935 | goto out; | 934 | goto out; |
936 | } | 935 | } |
937 | block = dbp->data; | 936 | block = dbp->data; |
938 | ASSERT(INT_GET(block->hdr.magic, ARCH_CONVERT) == XFS_DIR2_DATA_MAGIC); | 937 | ASSERT(be32_to_cpu(block->hdr.magic) == XFS_DIR2_DATA_MAGIC); |
939 | /* | 938 | /* |
940 | * Size of the "leaf" area in the block. | 939 | * Size of the "leaf" area in the block. |
941 | */ | 940 | */ |
@@ -956,7 +955,7 @@ xfs_dir2_leaf_to_block( | |||
956 | /* | 955 | /* |
957 | * Start converting it to block form. | 956 | * Start converting it to block form. |
958 | */ | 957 | */ |
959 | INT_SET(block->hdr.magic, ARCH_CONVERT, XFS_DIR2_BLOCK_MAGIC); | 958 | block->hdr.magic = cpu_to_be32(XFS_DIR2_BLOCK_MAGIC); |
960 | needlog = 1; | 959 | needlog = 1; |
961 | needscan = 0; | 960 | needscan = 0; |
962 | /* | 961 | /* |
@@ -1095,7 +1094,7 @@ xfs_dir2_sf_to_block( | |||
1095 | return error; | 1094 | return error; |
1096 | } | 1095 | } |
1097 | block = bp->data; | 1096 | block = bp->data; |
1098 | INT_SET(block->hdr.magic, ARCH_CONVERT, XFS_DIR2_BLOCK_MAGIC); | 1097 | block->hdr.magic = cpu_to_be32(XFS_DIR2_BLOCK_MAGIC); |
1099 | /* | 1098 | /* |
1100 | * Compute size of block "tail" area. | 1099 | * Compute size of block "tail" area. |
1101 | */ | 1100 | */ |