diff options
author | Nathan Scott <nathans@sgi.com> | 2006-03-17 01:27:37 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2006-03-17 01:27:37 -0500 |
commit | ad354eb34eb354eedc483d1e89e17710165bd2db (patch) | |
tree | aa7977517a3f516c81cf162bd62d7f84749a3138 /fs/xfs/xfs_dir2_block.c | |
parent | afbcb3f91903bcd34d470efe64b3738257178667 (diff) |
[XFS] endianess annotations for xfs_dir2_data_unused_t
SGI-PV: 943272
SGI-Modid: xfs-linux-melb:xfs-kern:25489a
Signed-off-by: Christoph Hellwig <hch@lst.de>
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 | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c index f70640c6b703..8b8aed77acd1 100644 --- a/fs/xfs/xfs_dir2_block.c +++ b/fs/xfs/xfs_dir2_block.c | |||
@@ -130,7 +130,7 @@ xfs_dir2_block_addname( | |||
130 | * the space before the first leaf entry needs to be free so it | 130 | * the space before the first leaf entry needs to be free so it |
131 | * can be expanded to hold the pointer to the new entry. | 131 | * can be expanded to hold the pointer to the new entry. |
132 | */ | 132 | */ |
133 | if (INT_GET(enddup->freetag, ARCH_CONVERT) != XFS_DIR2_DATA_FREE_TAG) | 133 | if (be16_to_cpu(enddup->freetag) != XFS_DIR2_DATA_FREE_TAG) |
134 | dup = enddup = NULL; | 134 | dup = enddup = NULL; |
135 | /* | 135 | /* |
136 | * Check out the biggest freespace and see if it's the same one. | 136 | * Check out the biggest freespace and see if it's the same one. |
@@ -143,7 +143,7 @@ xfs_dir2_block_addname( | |||
143 | * It is the biggest freespace, is it too small | 143 | * It is the biggest freespace, is it too small |
144 | * to hold the new leaf too? | 144 | * to hold the new leaf too? |
145 | */ | 145 | */ |
146 | if (INT_GET(dup->length, ARCH_CONVERT) < len + (uint)sizeof(*blp)) { | 146 | if (be16_to_cpu(dup->length) < len + (uint)sizeof(*blp)) { |
147 | /* | 147 | /* |
148 | * Yes, we use the second-largest | 148 | * Yes, we use the second-largest |
149 | * entry instead if it works. | 149 | * entry instead if it works. |
@@ -160,7 +160,7 @@ xfs_dir2_block_addname( | |||
160 | * Not the same free entry, | 160 | * Not the same free entry, |
161 | * just check its length. | 161 | * just check its length. |
162 | */ | 162 | */ |
163 | if (INT_GET(dup->length, ARCH_CONVERT) < len) { | 163 | if (be16_to_cpu(dup->length) < len) { |
164 | dup = NULL; | 164 | dup = NULL; |
165 | } | 165 | } |
166 | } | 166 | } |
@@ -192,8 +192,8 @@ xfs_dir2_block_addname( | |||
192 | * If it's not free then the data will go where the | 192 | * If it's not free then the data will go where the |
193 | * leaf data starts now, if it works at all. | 193 | * leaf data starts now, if it works at all. |
194 | */ | 194 | */ |
195 | if (INT_GET(dup->freetag, ARCH_CONVERT) == XFS_DIR2_DATA_FREE_TAG) { | 195 | if (be16_to_cpu(dup->freetag) == XFS_DIR2_DATA_FREE_TAG) { |
196 | if (INT_GET(dup->length, ARCH_CONVERT) + (INT_GET(btp->stale, ARCH_CONVERT) - 1) * | 196 | if (be16_to_cpu(dup->length) + (INT_GET(btp->stale, ARCH_CONVERT) - 1) * |
197 | (uint)sizeof(*blp) < len) | 197 | (uint)sizeof(*blp) < len) |
198 | dup = NULL; | 198 | dup = NULL; |
199 | } else if ((INT_GET(btp->stale, ARCH_CONVERT) - 1) * (uint)sizeof(*blp) < len) | 199 | } else if ((INT_GET(btp->stale, ARCH_CONVERT) - 1) * (uint)sizeof(*blp) < len) |
@@ -310,7 +310,7 @@ xfs_dir2_block_addname( | |||
310 | */ | 310 | */ |
311 | xfs_dir2_data_use_free(tp, bp, enddup, | 311 | xfs_dir2_data_use_free(tp, bp, enddup, |
312 | (xfs_dir2_data_aoff_t) | 312 | (xfs_dir2_data_aoff_t) |
313 | ((char *)enddup - (char *)block + INT_GET(enddup->length, ARCH_CONVERT) - | 313 | ((char *)enddup - (char *)block + be16_to_cpu(enddup->length) - |
314 | sizeof(*blp)), | 314 | sizeof(*blp)), |
315 | (xfs_dir2_data_aoff_t)sizeof(*blp), | 315 | (xfs_dir2_data_aoff_t)sizeof(*blp), |
316 | &needlog, &needscan); | 316 | &needlog, &needscan); |
@@ -484,8 +484,8 @@ xfs_dir2_block_getdents( | |||
484 | /* | 484 | /* |
485 | * Unused, skip it. | 485 | * Unused, skip it. |
486 | */ | 486 | */ |
487 | if (INT_GET(dup->freetag, ARCH_CONVERT) == XFS_DIR2_DATA_FREE_TAG) { | 487 | if (be16_to_cpu(dup->freetag) == XFS_DIR2_DATA_FREE_TAG) { |
488 | ptr += INT_GET(dup->length, ARCH_CONVERT); | 488 | ptr += be16_to_cpu(dup->length); |
489 | continue; | 489 | continue; |
490 | } | 490 | } |
491 | 491 | ||
@@ -948,7 +948,8 @@ xfs_dir2_leaf_to_block( | |||
948 | /* | 948 | /* |
949 | * If it's not free or is too short we can't do it. | 949 | * If it's not free or is too short we can't do it. |
950 | */ | 950 | */ |
951 | if (INT_GET(dup->freetag, ARCH_CONVERT) != XFS_DIR2_DATA_FREE_TAG || INT_GET(dup->length, ARCH_CONVERT) < size) { | 951 | if (be16_to_cpu(dup->freetag) != XFS_DIR2_DATA_FREE_TAG || |
952 | be16_to_cpu(dup->length) < size) { | ||
952 | error = 0; | 953 | error = 0; |
953 | goto out; | 954 | goto out; |
954 | } | 955 | } |
@@ -1122,7 +1123,7 @@ xfs_dir2_sf_to_block( | |||
1122 | */ | 1123 | */ |
1123 | xfs_dir2_data_use_free(tp, bp, dup, | 1124 | xfs_dir2_data_use_free(tp, bp, dup, |
1124 | (xfs_dir2_data_aoff_t)((char *)dup - (char *)block), | 1125 | (xfs_dir2_data_aoff_t)((char *)dup - (char *)block), |
1125 | INT_GET(dup->length, ARCH_CONVERT), &needlog, &needscan); | 1126 | be16_to_cpu(dup->length), &needlog, &needscan); |
1126 | /* | 1127 | /* |
1127 | * Create entry for . | 1128 | * Create entry for . |
1128 | */ | 1129 | */ |
@@ -1175,15 +1176,15 @@ xfs_dir2_sf_to_block( | |||
1175 | if (offset < newoffset) { | 1176 | if (offset < newoffset) { |
1176 | dup = (xfs_dir2_data_unused_t *) | 1177 | dup = (xfs_dir2_data_unused_t *) |
1177 | ((char *)block + offset); | 1178 | ((char *)block + offset); |
1178 | INT_SET(dup->freetag, ARCH_CONVERT, XFS_DIR2_DATA_FREE_TAG); | 1179 | dup->freetag = cpu_to_be16(XFS_DIR2_DATA_FREE_TAG); |
1179 | INT_SET(dup->length, ARCH_CONVERT, newoffset - offset); | 1180 | dup->length = cpu_to_be16(newoffset - offset); |
1180 | INT_SET(*XFS_DIR2_DATA_UNUSED_TAG_P(dup), ARCH_CONVERT, | 1181 | INT_SET(*XFS_DIR2_DATA_UNUSED_TAG_P(dup), ARCH_CONVERT, |
1181 | (xfs_dir2_data_off_t) | 1182 | (xfs_dir2_data_off_t) |
1182 | ((char *)dup - (char *)block)); | 1183 | ((char *)dup - (char *)block)); |
1183 | xfs_dir2_data_log_unused(tp, bp, dup); | 1184 | xfs_dir2_data_log_unused(tp, bp, dup); |
1184 | (void)xfs_dir2_data_freeinsert((xfs_dir2_data_t *)block, | 1185 | (void)xfs_dir2_data_freeinsert((xfs_dir2_data_t *)block, |
1185 | dup, &dummy); | 1186 | dup, &dummy); |
1186 | offset += INT_GET(dup->length, ARCH_CONVERT); | 1187 | offset += be16_to_cpu(dup->length); |
1187 | continue; | 1188 | continue; |
1188 | } | 1189 | } |
1189 | /* | 1190 | /* |