diff options
Diffstat (limited to 'fs/xfs/xfs_dir2_node.c')
-rw-r--r-- | fs/xfs/xfs_dir2_node.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c index 56b7cc89645e..af556f16a0c7 100644 --- a/fs/xfs/xfs_dir2_node.c +++ b/fs/xfs/xfs_dir2_node.c | |||
@@ -164,7 +164,7 @@ xfs_dir2_leaf_to_node( | |||
164 | *to = cpu_to_be16(off); | 164 | *to = cpu_to_be16(off); |
165 | } | 165 | } |
166 | free->hdr.nused = cpu_to_be32(n); | 166 | free->hdr.nused = cpu_to_be32(n); |
167 | INT_SET(leaf->hdr.info.magic, ARCH_CONVERT, XFS_DIR2_LEAFN_MAGIC); | 167 | leaf->hdr.info.magic = cpu_to_be16(XFS_DIR2_LEAFN_MAGIC); |
168 | /* | 168 | /* |
169 | * Log everything. | 169 | * Log everything. |
170 | */ | 170 | */ |
@@ -353,7 +353,7 @@ xfs_dir2_leafn_check( | |||
353 | 353 | ||
354 | leaf = bp->data; | 354 | leaf = bp->data; |
355 | mp = dp->i_mount; | 355 | mp = dp->i_mount; |
356 | ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR2_LEAFN_MAGIC); | 356 | ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_DIR2_LEAFN_MAGIC); |
357 | ASSERT(be16_to_cpu(leaf->hdr.count) <= XFS_DIR2_MAX_LEAF_ENTS(mp)); | 357 | ASSERT(be16_to_cpu(leaf->hdr.count) <= XFS_DIR2_MAX_LEAF_ENTS(mp)); |
358 | for (i = stale = 0; i < be16_to_cpu(leaf->hdr.count); i++) { | 358 | for (i = stale = 0; i < be16_to_cpu(leaf->hdr.count); i++) { |
359 | if (i + 1 < be16_to_cpu(leaf->hdr.count)) { | 359 | if (i + 1 < be16_to_cpu(leaf->hdr.count)) { |
@@ -379,7 +379,7 @@ xfs_dir2_leafn_lasthash( | |||
379 | xfs_dir2_leaf_t *leaf; /* leaf structure */ | 379 | xfs_dir2_leaf_t *leaf; /* leaf structure */ |
380 | 380 | ||
381 | leaf = bp->data; | 381 | leaf = bp->data; |
382 | ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR2_LEAFN_MAGIC); | 382 | ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_DIR2_LEAFN_MAGIC); |
383 | if (count) | 383 | if (count) |
384 | *count = be16_to_cpu(leaf->hdr.count); | 384 | *count = be16_to_cpu(leaf->hdr.count); |
385 | if (!leaf->hdr.count) | 385 | if (!leaf->hdr.count) |
@@ -420,7 +420,7 @@ xfs_dir2_leafn_lookup_int( | |||
420 | tp = args->trans; | 420 | tp = args->trans; |
421 | mp = dp->i_mount; | 421 | mp = dp->i_mount; |
422 | leaf = bp->data; | 422 | leaf = bp->data; |
423 | ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR2_LEAFN_MAGIC); | 423 | ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_DIR2_LEAFN_MAGIC); |
424 | #ifdef __KERNEL__ | 424 | #ifdef __KERNEL__ |
425 | ASSERT(be16_to_cpu(leaf->hdr.count) > 0); | 425 | ASSERT(be16_to_cpu(leaf->hdr.count) > 0); |
426 | #endif | 426 | #endif |
@@ -720,8 +720,8 @@ xfs_dir2_leafn_order( | |||
720 | 720 | ||
721 | leaf1 = leaf1_bp->data; | 721 | leaf1 = leaf1_bp->data; |
722 | leaf2 = leaf2_bp->data; | 722 | leaf2 = leaf2_bp->data; |
723 | ASSERT(INT_GET(leaf1->hdr.info.magic, ARCH_CONVERT) == XFS_DIR2_LEAFN_MAGIC); | 723 | ASSERT(be16_to_cpu(leaf1->hdr.info.magic) == XFS_DIR2_LEAFN_MAGIC); |
724 | ASSERT(INT_GET(leaf2->hdr.info.magic, ARCH_CONVERT) == XFS_DIR2_LEAFN_MAGIC); | 724 | ASSERT(be16_to_cpu(leaf2->hdr.info.magic) == XFS_DIR2_LEAFN_MAGIC); |
725 | if (be16_to_cpu(leaf1->hdr.count) > 0 && | 725 | if (be16_to_cpu(leaf1->hdr.count) > 0 && |
726 | be16_to_cpu(leaf2->hdr.count) > 0 && | 726 | be16_to_cpu(leaf2->hdr.count) > 0 && |
727 | (be32_to_cpu(leaf2->ents[0].hashval) < be32_to_cpu(leaf1->ents[0].hashval) || | 727 | (be32_to_cpu(leaf2->ents[0].hashval) < be32_to_cpu(leaf1->ents[0].hashval) || |
@@ -868,7 +868,7 @@ xfs_dir2_leafn_remove( | |||
868 | tp = args->trans; | 868 | tp = args->trans; |
869 | mp = dp->i_mount; | 869 | mp = dp->i_mount; |
870 | leaf = bp->data; | 870 | leaf = bp->data; |
871 | ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR2_LEAFN_MAGIC); | 871 | ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_DIR2_LEAFN_MAGIC); |
872 | /* | 872 | /* |
873 | * Point to the entry we're removing. | 873 | * Point to the entry we're removing. |
874 | */ | 874 | */ |
@@ -1139,7 +1139,7 @@ xfs_dir2_leafn_toosmall( | |||
1139 | */ | 1139 | */ |
1140 | blk = &state->path.blk[state->path.active - 1]; | 1140 | blk = &state->path.blk[state->path.active - 1]; |
1141 | info = blk->bp->data; | 1141 | info = blk->bp->data; |
1142 | ASSERT(INT_GET(info->magic, ARCH_CONVERT) == XFS_DIR2_LEAFN_MAGIC); | 1142 | ASSERT(be16_to_cpu(info->magic) == XFS_DIR2_LEAFN_MAGIC); |
1143 | leaf = (xfs_dir2_leaf_t *)info; | 1143 | leaf = (xfs_dir2_leaf_t *)info; |
1144 | count = be16_to_cpu(leaf->hdr.count) - be16_to_cpu(leaf->hdr.stale); | 1144 | count = be16_to_cpu(leaf->hdr.count) - be16_to_cpu(leaf->hdr.stale); |
1145 | bytes = (uint)sizeof(leaf->hdr) + count * (uint)sizeof(leaf->ents[0]); | 1145 | bytes = (uint)sizeof(leaf->hdr) + count * (uint)sizeof(leaf->ents[0]); |
@@ -1161,7 +1161,7 @@ xfs_dir2_leafn_toosmall( | |||
1161 | * Make altpath point to the block we want to keep and | 1161 | * Make altpath point to the block we want to keep and |
1162 | * path point to the block we want to drop (this one). | 1162 | * path point to the block we want to drop (this one). |
1163 | */ | 1163 | */ |
1164 | forward = info->forw; | 1164 | forward = (info->forw != 0); |
1165 | memcpy(&state->altpath, &state->path, sizeof(state->path)); | 1165 | memcpy(&state->altpath, &state->path, sizeof(state->path)); |
1166 | error = xfs_da_path_shift(state, &state->altpath, forward, 0, | 1166 | error = xfs_da_path_shift(state, &state->altpath, forward, 0, |
1167 | &rval); | 1167 | &rval); |
@@ -1177,9 +1177,9 @@ xfs_dir2_leafn_toosmall( | |||
1177 | * We prefer coalescing with the lower numbered sibling so as | 1177 | * We prefer coalescing with the lower numbered sibling so as |
1178 | * to shrink a directory over time. | 1178 | * to shrink a directory over time. |
1179 | */ | 1179 | */ |
1180 | forward = INT_GET(info->forw, ARCH_CONVERT) < INT_GET(info->back, ARCH_CONVERT); | 1180 | forward = be32_to_cpu(info->forw) < be32_to_cpu(info->back); |
1181 | for (i = 0, bp = NULL; i < 2; forward = !forward, i++) { | 1181 | for (i = 0, bp = NULL; i < 2; forward = !forward, i++) { |
1182 | blkno = forward ?INT_GET( info->forw, ARCH_CONVERT) : INT_GET(info->back, ARCH_CONVERT); | 1182 | blkno = forward ? be32_to_cpu(info->forw) : be32_to_cpu(info->back); |
1183 | if (blkno == 0) | 1183 | if (blkno == 0) |
1184 | continue; | 1184 | continue; |
1185 | /* | 1185 | /* |
@@ -1198,7 +1198,7 @@ xfs_dir2_leafn_toosmall( | |||
1198 | count = be16_to_cpu(leaf->hdr.count) - be16_to_cpu(leaf->hdr.stale); | 1198 | count = be16_to_cpu(leaf->hdr.count) - be16_to_cpu(leaf->hdr.stale); |
1199 | bytes = state->blocksize - (state->blocksize >> 2); | 1199 | bytes = state->blocksize - (state->blocksize >> 2); |
1200 | leaf = bp->data; | 1200 | leaf = bp->data; |
1201 | ASSERT(INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR2_LEAFN_MAGIC); | 1201 | ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_DIR2_LEAFN_MAGIC); |
1202 | count += be16_to_cpu(leaf->hdr.count) - be16_to_cpu(leaf->hdr.stale); | 1202 | count += be16_to_cpu(leaf->hdr.count) - be16_to_cpu(leaf->hdr.stale); |
1203 | bytes -= count * (uint)sizeof(leaf->ents[0]); | 1203 | bytes -= count * (uint)sizeof(leaf->ents[0]); |
1204 | /* | 1204 | /* |
@@ -1257,8 +1257,8 @@ xfs_dir2_leafn_unbalance( | |||
1257 | ASSERT(save_blk->magic == XFS_DIR2_LEAFN_MAGIC); | 1257 | ASSERT(save_blk->magic == XFS_DIR2_LEAFN_MAGIC); |
1258 | drop_leaf = drop_blk->bp->data; | 1258 | drop_leaf = drop_blk->bp->data; |
1259 | save_leaf = save_blk->bp->data; | 1259 | save_leaf = save_blk->bp->data; |
1260 | ASSERT(INT_GET(drop_leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR2_LEAFN_MAGIC); | 1260 | ASSERT(be16_to_cpu(drop_leaf->hdr.info.magic) == XFS_DIR2_LEAFN_MAGIC); |
1261 | ASSERT(INT_GET(save_leaf->hdr.info.magic, ARCH_CONVERT) == XFS_DIR2_LEAFN_MAGIC); | 1261 | ASSERT(be16_to_cpu(save_leaf->hdr.info.magic) == XFS_DIR2_LEAFN_MAGIC); |
1262 | /* | 1262 | /* |
1263 | * If there are any stale leaf entries, take this opportunity | 1263 | * If there are any stale leaf entries, take this opportunity |
1264 | * to purge them. | 1264 | * to purge them. |