diff options
author | Nathan Scott <nathans@sgi.com> | 2006-03-17 01:29:46 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2006-03-17 01:29:46 -0500 |
commit | 403432dcb5daa03c1f1c961adb7d2a5daebea94b (patch) | |
tree | 0298d12d14f777d06e3588dade78efbde2e5bb88 /fs/xfs/xfs_da_btree.c | |
parent | d7929ff670c802dc68d6149d3d0cc5667e18daec (diff) |
[XFS] endianess annotations for xfs_da_node_entry_t
SGI-PV: 943272
SGI-Modid: xfs-linux-melb:xfs-kern:25504a
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_da_btree.c')
-rw-r--r-- | fs/xfs/xfs_da_btree.c | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c index 4f3bb1cb9615..d32670c09f39 100644 --- a/fs/xfs/xfs_da_btree.c +++ b/fs/xfs/xfs_da_btree.c | |||
@@ -385,10 +385,10 @@ xfs_da_root_split(xfs_da_state_t *state, xfs_da_state_blk_t *blk1, | |||
385 | if (error) | 385 | if (error) |
386 | return(error); | 386 | return(error); |
387 | node = bp->data; | 387 | node = bp->data; |
388 | INT_SET(node->btree[0].hashval, ARCH_CONVERT, blk1->hashval); | 388 | node->btree[0].hashval = cpu_to_be32(blk1->hashval); |
389 | INT_SET(node->btree[0].before, ARCH_CONVERT, blk1->blkno); | 389 | node->btree[0].before = cpu_to_be32(blk1->blkno); |
390 | INT_SET(node->btree[1].hashval, ARCH_CONVERT, blk2->hashval); | 390 | node->btree[1].hashval = cpu_to_be32(blk2->hashval); |
391 | INT_SET(node->btree[1].before, ARCH_CONVERT, blk2->blkno); | 391 | node->btree[1].before = cpu_to_be32(blk2->blkno); |
392 | INT_SET(node->hdr.count, ARCH_CONVERT, 2); | 392 | INT_SET(node->hdr.count, ARCH_CONVERT, 2); |
393 | 393 | ||
394 | #ifdef DEBUG | 394 | #ifdef DEBUG |
@@ -517,9 +517,9 @@ xfs_da_node_rebalance(xfs_da_state_t *state, xfs_da_state_blk_t *blk1, | |||
517 | * Swap the nodes around if that makes it simpler. | 517 | * Swap the nodes around if that makes it simpler. |
518 | */ | 518 | */ |
519 | if ((INT_GET(node1->hdr.count, ARCH_CONVERT) > 0) && (INT_GET(node2->hdr.count, ARCH_CONVERT) > 0) && | 519 | if ((INT_GET(node1->hdr.count, ARCH_CONVERT) > 0) && (INT_GET(node2->hdr.count, ARCH_CONVERT) > 0) && |
520 | ((INT_GET(node2->btree[ 0 ].hashval, ARCH_CONVERT) < INT_GET(node1->btree[ 0 ].hashval, ARCH_CONVERT)) || | 520 | ((be32_to_cpu(node2->btree[0].hashval) < be32_to_cpu(node1->btree[0].hashval)) || |
521 | (INT_GET(node2->btree[ INT_GET(node2->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT) < | 521 | (be32_to_cpu(node2->btree[INT_GET(node2->hdr.count, ARCH_CONVERT)-1].hashval) < |
522 | INT_GET(node1->btree[ INT_GET(node1->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT)))) { | 522 | be32_to_cpu(node1->btree[INT_GET(node1->hdr.count, ARCH_CONVERT)-1].hashval)))) { |
523 | tmpnode = node1; | 523 | tmpnode = node1; |
524 | node1 = node2; | 524 | node1 = node2; |
525 | node2 = tmpnode; | 525 | node2 = tmpnode; |
@@ -596,8 +596,8 @@ xfs_da_node_rebalance(xfs_da_state_t *state, xfs_da_state_blk_t *blk1, | |||
596 | */ | 596 | */ |
597 | node1 = blk1->bp->data; | 597 | node1 = blk1->bp->data; |
598 | node2 = blk2->bp->data; | 598 | node2 = blk2->bp->data; |
599 | blk1->hashval = INT_GET(node1->btree[ INT_GET(node1->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT); | 599 | blk1->hashval = be32_to_cpu(node1->btree[ INT_GET(node1->hdr.count, ARCH_CONVERT)-1 ].hashval); |
600 | blk2->hashval = INT_GET(node2->btree[ INT_GET(node2->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT); | 600 | blk2->hashval = be32_to_cpu(node2->btree[ INT_GET(node2->hdr.count, ARCH_CONVERT)-1 ].hashval); |
601 | 601 | ||
602 | /* | 602 | /* |
603 | * Adjust the expected index for insertion. | 603 | * Adjust the expected index for insertion. |
@@ -638,8 +638,8 @@ xfs_da_node_add(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk, | |||
638 | tmp = (INT_GET(node->hdr.count, ARCH_CONVERT) - oldblk->index) * (uint)sizeof(*btree); | 638 | tmp = (INT_GET(node->hdr.count, ARCH_CONVERT) - oldblk->index) * (uint)sizeof(*btree); |
639 | memmove(btree + 1, btree, tmp); | 639 | memmove(btree + 1, btree, tmp); |
640 | } | 640 | } |
641 | INT_SET(btree->hashval, ARCH_CONVERT, newblk->hashval); | 641 | btree->hashval = cpu_to_be32(newblk->hashval); |
642 | INT_SET(btree->before, ARCH_CONVERT, newblk->blkno); | 642 | btree->before = cpu_to_be32(newblk->blkno); |
643 | xfs_da_log_buf(state->args->trans, oldblk->bp, | 643 | xfs_da_log_buf(state->args->trans, oldblk->bp, |
644 | XFS_DA_LOGRANGE(node, btree, tmp + sizeof(*btree))); | 644 | XFS_DA_LOGRANGE(node, btree, tmp + sizeof(*btree))); |
645 | INT_MOD(node->hdr.count, ARCH_CONVERT, +1); | 645 | INT_MOD(node->hdr.count, ARCH_CONVERT, +1); |
@@ -649,7 +649,7 @@ xfs_da_node_add(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk, | |||
649 | /* | 649 | /* |
650 | * Copy the last hash value from the oldblk to propagate upwards. | 650 | * Copy the last hash value from the oldblk to propagate upwards. |
651 | */ | 651 | */ |
652 | oldblk->hashval = INT_GET(node->btree[ INT_GET(node->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT); | 652 | oldblk->hashval = be32_to_cpu(node->btree[ INT_GET(node->hdr.count, ARCH_CONVERT)-1 ].hashval); |
653 | } | 653 | } |
654 | 654 | ||
655 | /*======================================================================== | 655 | /*======================================================================== |
@@ -782,7 +782,7 @@ xfs_da_root_join(xfs_da_state_t *state, xfs_da_state_blk_t *root_blk) | |||
782 | * Read in the (only) child block, then copy those bytes into | 782 | * Read in the (only) child block, then copy those bytes into |
783 | * the root block's buffer and free the original child block. | 783 | * the root block's buffer and free the original child block. |
784 | */ | 784 | */ |
785 | child = INT_GET(oldroot->btree[ 0 ].before, ARCH_CONVERT); | 785 | child = be32_to_cpu(oldroot->btree[0].before); |
786 | ASSERT(child != 0); | 786 | ASSERT(child != 0); |
787 | error = xfs_da_read_buf(args->trans, args->dp, child, -1, &bp, | 787 | error = xfs_da_read_buf(args->trans, args->dp, child, -1, &bp, |
788 | args->whichfork); | 788 | args->whichfork); |
@@ -974,14 +974,14 @@ xfs_da_fixhashpath(xfs_da_state_t *state, xfs_da_state_path_t *path) | |||
974 | node = blk->bp->data; | 974 | node = blk->bp->data; |
975 | ASSERT(be16_to_cpu(node->hdr.info.magic) == XFS_DA_NODE_MAGIC); | 975 | ASSERT(be16_to_cpu(node->hdr.info.magic) == XFS_DA_NODE_MAGIC); |
976 | btree = &node->btree[ blk->index ]; | 976 | btree = &node->btree[ blk->index ]; |
977 | if (INT_GET(btree->hashval, ARCH_CONVERT) == lasthash) | 977 | if (be32_to_cpu(btree->hashval) == lasthash) |
978 | break; | 978 | break; |
979 | blk->hashval = lasthash; | 979 | blk->hashval = lasthash; |
980 | INT_SET(btree->hashval, ARCH_CONVERT, lasthash); | 980 | btree->hashval = cpu_to_be32(lasthash); |
981 | xfs_da_log_buf(state->args->trans, blk->bp, | 981 | xfs_da_log_buf(state->args->trans, blk->bp, |
982 | XFS_DA_LOGRANGE(node, btree, sizeof(*btree))); | 982 | XFS_DA_LOGRANGE(node, btree, sizeof(*btree))); |
983 | 983 | ||
984 | lasthash = INT_GET(node->btree[ INT_GET(node->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT); | 984 | lasthash = be32_to_cpu(node->btree[ INT_GET(node->hdr.count, ARCH_CONVERT)-1 ].hashval); |
985 | } | 985 | } |
986 | } | 986 | } |
987 | 987 | ||
@@ -1022,7 +1022,7 @@ xfs_da_node_remove(xfs_da_state_t *state, xfs_da_state_blk_t *drop_blk) | |||
1022 | * Copy the last hash value from the block to propagate upwards. | 1022 | * Copy the last hash value from the block to propagate upwards. |
1023 | */ | 1023 | */ |
1024 | btree--; | 1024 | btree--; |
1025 | drop_blk->hashval = INT_GET(btree->hashval, ARCH_CONVERT); | 1025 | drop_blk->hashval = be32_to_cpu(btree->hashval); |
1026 | } | 1026 | } |
1027 | 1027 | ||
1028 | /* | 1028 | /* |
@@ -1048,9 +1048,9 @@ xfs_da_node_unbalance(xfs_da_state_t *state, xfs_da_state_blk_t *drop_blk, | |||
1048 | * If the dying block has lower hashvals, then move all the | 1048 | * If the dying block has lower hashvals, then move all the |
1049 | * elements in the remaining block up to make a hole. | 1049 | * elements in the remaining block up to make a hole. |
1050 | */ | 1050 | */ |
1051 | if ((INT_GET(drop_node->btree[ 0 ].hashval, ARCH_CONVERT) < INT_GET(save_node->btree[ 0 ].hashval, ARCH_CONVERT)) || | 1051 | if ((be32_to_cpu(drop_node->btree[0].hashval) < be32_to_cpu(save_node->btree[ 0 ].hashval)) || |
1052 | (INT_GET(drop_node->btree[ INT_GET(drop_node->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT) < | 1052 | (be32_to_cpu(drop_node->btree[INT_GET(drop_node->hdr.count, ARCH_CONVERT)-1].hashval) < |
1053 | INT_GET(save_node->btree[ INT_GET(save_node->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT))) | 1053 | be32_to_cpu(save_node->btree[INT_GET(save_node->hdr.count, ARCH_CONVERT)-1 ].hashval))) |
1054 | { | 1054 | { |
1055 | btree = &save_node->btree[ INT_GET(drop_node->hdr.count, ARCH_CONVERT) ]; | 1055 | btree = &save_node->btree[ INT_GET(drop_node->hdr.count, ARCH_CONVERT) ]; |
1056 | tmp = INT_GET(save_node->hdr.count, ARCH_CONVERT) * (uint)sizeof(xfs_da_node_entry_t); | 1056 | tmp = INT_GET(save_node->hdr.count, ARCH_CONVERT) * (uint)sizeof(xfs_da_node_entry_t); |
@@ -1082,7 +1082,7 @@ xfs_da_node_unbalance(xfs_da_state_t *state, xfs_da_state_blk_t *drop_blk, | |||
1082 | /* | 1082 | /* |
1083 | * Save the last hashval in the remaining block for upward propagation. | 1083 | * Save the last hashval in the remaining block for upward propagation. |
1084 | */ | 1084 | */ |
1085 | save_blk->hashval = INT_GET(save_node->btree[ INT_GET(save_node->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT); | 1085 | save_blk->hashval = be32_to_cpu(save_node->btree[ INT_GET(save_node->hdr.count, ARCH_CONVERT)-1 ].hashval); |
1086 | } | 1086 | } |
1087 | 1087 | ||
1088 | /*======================================================================== | 1088 | /*======================================================================== |
@@ -1147,7 +1147,7 @@ xfs_da_node_lookup_int(xfs_da_state_t *state, int *result) | |||
1147 | blk->magic = be16_to_cpu(curr->magic); | 1147 | blk->magic = be16_to_cpu(curr->magic); |
1148 | if (blk->magic == XFS_DA_NODE_MAGIC) { | 1148 | if (blk->magic == XFS_DA_NODE_MAGIC) { |
1149 | node = blk->bp->data; | 1149 | node = blk->bp->data; |
1150 | blk->hashval = INT_GET(node->btree[ INT_GET(node->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT); | 1150 | blk->hashval = be32_to_cpu(node->btree[INT_GET(node->hdr.count, ARCH_CONVERT)-1].hashval); |
1151 | 1151 | ||
1152 | /* | 1152 | /* |
1153 | * Binary search. (note: small blocks will skip loop) | 1153 | * Binary search. (note: small blocks will skip loop) |
@@ -1158,25 +1158,25 @@ xfs_da_node_lookup_int(xfs_da_state_t *state, int *result) | |||
1158 | for (btree = &node->btree[probe]; span > 4; | 1158 | for (btree = &node->btree[probe]; span > 4; |
1159 | btree = &node->btree[probe]) { | 1159 | btree = &node->btree[probe]) { |
1160 | span /= 2; | 1160 | span /= 2; |
1161 | if (INT_GET(btree->hashval, ARCH_CONVERT) < hashval) | 1161 | if (be32_to_cpu(btree->hashval) < hashval) |
1162 | probe += span; | 1162 | probe += span; |
1163 | else if (INT_GET(btree->hashval, ARCH_CONVERT) > hashval) | 1163 | else if (be32_to_cpu(btree->hashval) > hashval) |
1164 | probe -= span; | 1164 | probe -= span; |
1165 | else | 1165 | else |
1166 | break; | 1166 | break; |
1167 | } | 1167 | } |
1168 | ASSERT((probe >= 0) && (probe < max)); | 1168 | ASSERT((probe >= 0) && (probe < max)); |
1169 | ASSERT((span <= 4) || (INT_GET(btree->hashval, ARCH_CONVERT) == hashval)); | 1169 | ASSERT((span <= 4) || (be32_to_cpu(btree->hashval) == hashval)); |
1170 | 1170 | ||
1171 | /* | 1171 | /* |
1172 | * Since we may have duplicate hashval's, find the first | 1172 | * Since we may have duplicate hashval's, find the first |
1173 | * matching hashval in the node. | 1173 | * matching hashval in the node. |
1174 | */ | 1174 | */ |
1175 | while ((probe > 0) && (INT_GET(btree->hashval, ARCH_CONVERT) >= hashval)) { | 1175 | while ((probe > 0) && (be32_to_cpu(btree->hashval) >= hashval)) { |
1176 | btree--; | 1176 | btree--; |
1177 | probe--; | 1177 | probe--; |
1178 | } | 1178 | } |
1179 | while ((probe < max) && (INT_GET(btree->hashval, ARCH_CONVERT) < hashval)) { | 1179 | while ((probe < max) && (be32_to_cpu(btree->hashval) < hashval)) { |
1180 | btree++; | 1180 | btree++; |
1181 | probe++; | 1181 | probe++; |
1182 | } | 1182 | } |
@@ -1186,10 +1186,10 @@ xfs_da_node_lookup_int(xfs_da_state_t *state, int *result) | |||
1186 | */ | 1186 | */ |
1187 | if (probe == max) { | 1187 | if (probe == max) { |
1188 | blk->index = max-1; | 1188 | blk->index = max-1; |
1189 | blkno = INT_GET(node->btree[ max-1 ].before, ARCH_CONVERT); | 1189 | blkno = be32_to_cpu(node->btree[max-1].before); |
1190 | } else { | 1190 | } else { |
1191 | blk->index = probe; | 1191 | blk->index = probe; |
1192 | blkno = INT_GET(btree->before, ARCH_CONVERT); | 1192 | blkno = be32_to_cpu(btree->before); |
1193 | } | 1193 | } |
1194 | } | 1194 | } |
1195 | else if (be16_to_cpu(curr->magic) == XFS_ATTR_LEAF_MAGIC) { | 1195 | else if (be16_to_cpu(curr->magic) == XFS_ATTR_LEAF_MAGIC) { |
@@ -1359,10 +1359,10 @@ xfs_da_node_order(xfs_dabuf_t *node1_bp, xfs_dabuf_t *node2_bp) | |||
1359 | ASSERT((be16_to_cpu(node1->hdr.info.magic) == XFS_DA_NODE_MAGIC) && | 1359 | ASSERT((be16_to_cpu(node1->hdr.info.magic) == XFS_DA_NODE_MAGIC) && |
1360 | (be16_to_cpu(node2->hdr.info.magic) == XFS_DA_NODE_MAGIC)); | 1360 | (be16_to_cpu(node2->hdr.info.magic) == XFS_DA_NODE_MAGIC)); |
1361 | if ((INT_GET(node1->hdr.count, ARCH_CONVERT) > 0) && (INT_GET(node2->hdr.count, ARCH_CONVERT) > 0) && | 1361 | if ((INT_GET(node1->hdr.count, ARCH_CONVERT) > 0) && (INT_GET(node2->hdr.count, ARCH_CONVERT) > 0) && |
1362 | ((INT_GET(node2->btree[ 0 ].hashval, ARCH_CONVERT) < | 1362 | ((be32_to_cpu(node2->btree[0].hashval) < |
1363 | INT_GET(node1->btree[ 0 ].hashval, ARCH_CONVERT)) || | 1363 | be32_to_cpu(node1->btree[0].hashval)) || |
1364 | (INT_GET(node2->btree[ INT_GET(node2->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT) < | 1364 | (be32_to_cpu(node2->btree[INT_GET(node2->hdr.count, ARCH_CONVERT)-1].hashval) < |
1365 | INT_GET(node1->btree[ INT_GET(node1->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT)))) { | 1365 | be32_to_cpu(node1->btree[INT_GET(node1->hdr.count, ARCH_CONVERT)-1].hashval)))) { |
1366 | return(1); | 1366 | return(1); |
1367 | } | 1367 | } |
1368 | return(0); | 1368 | return(0); |
@@ -1382,7 +1382,7 @@ xfs_da_node_lasthash(xfs_dabuf_t *bp, int *count) | |||
1382 | *count = INT_GET(node->hdr.count, ARCH_CONVERT); | 1382 | *count = INT_GET(node->hdr.count, ARCH_CONVERT); |
1383 | if (!node->hdr.count) | 1383 | if (!node->hdr.count) |
1384 | return(0); | 1384 | return(0); |
1385 | return(INT_GET(node->btree[ INT_GET(node->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT)); | 1385 | return be32_to_cpu(node->btree[INT_GET(node->hdr.count, ARCH_CONVERT)-1].hashval); |
1386 | } | 1386 | } |
1387 | 1387 | ||
1388 | /* | 1388 | /* |
@@ -1493,11 +1493,11 @@ xfs_da_path_shift(xfs_da_state_t *state, xfs_da_state_path_t *path, | |||
1493 | ASSERT(be16_to_cpu(node->hdr.info.magic) == XFS_DA_NODE_MAGIC); | 1493 | ASSERT(be16_to_cpu(node->hdr.info.magic) == XFS_DA_NODE_MAGIC); |
1494 | if (forward && (blk->index < INT_GET(node->hdr.count, ARCH_CONVERT)-1)) { | 1494 | if (forward && (blk->index < INT_GET(node->hdr.count, ARCH_CONVERT)-1)) { |
1495 | blk->index++; | 1495 | blk->index++; |
1496 | blkno = INT_GET(node->btree[ blk->index ].before, ARCH_CONVERT); | 1496 | blkno = be32_to_cpu(node->btree[blk->index].before); |
1497 | break; | 1497 | break; |
1498 | } else if (!forward && (blk->index > 0)) { | 1498 | } else if (!forward && (blk->index > 0)) { |
1499 | blk->index--; | 1499 | blk->index--; |
1500 | blkno = INT_GET(node->btree[ blk->index ].before, ARCH_CONVERT); | 1500 | blkno = be32_to_cpu(node->btree[blk->index].before); |
1501 | break; | 1501 | break; |
1502 | } | 1502 | } |
1503 | } | 1503 | } |
@@ -1535,12 +1535,12 @@ xfs_da_path_shift(xfs_da_state_t *state, xfs_da_state_path_t *path, | |||
1535 | blk->magic = be16_to_cpu(info->magic); | 1535 | blk->magic = be16_to_cpu(info->magic); |
1536 | if (blk->magic == XFS_DA_NODE_MAGIC) { | 1536 | if (blk->magic == XFS_DA_NODE_MAGIC) { |
1537 | node = (xfs_da_intnode_t *)info; | 1537 | node = (xfs_da_intnode_t *)info; |
1538 | blk->hashval = INT_GET(node->btree[ INT_GET(node->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT); | 1538 | blk->hashval = be32_to_cpu(node->btree[INT_GET(node->hdr.count, ARCH_CONVERT)-1].hashval); |
1539 | if (forward) | 1539 | if (forward) |
1540 | blk->index = 0; | 1540 | blk->index = 0; |
1541 | else | 1541 | else |
1542 | blk->index = INT_GET(node->hdr.count, ARCH_CONVERT)-1; | 1542 | blk->index = INT_GET(node->hdr.count, ARCH_CONVERT)-1; |
1543 | blkno = INT_GET(node->btree[ blk->index ].before, ARCH_CONVERT); | 1543 | blkno = be32_to_cpu(node->btree[blk->index].before); |
1544 | } else { | 1544 | } else { |
1545 | ASSERT(level == path->active-1); | 1545 | ASSERT(level == path->active-1); |
1546 | blk->index = 0; | 1546 | blk->index = 0; |
@@ -1796,7 +1796,7 @@ xfs_da_swap_lastblock(xfs_da_args_t *args, xfs_dablk_t *dead_blknop, | |||
1796 | ASSERT(be16_to_cpu(dead_info->magic) == XFS_DA_NODE_MAGIC); | 1796 | ASSERT(be16_to_cpu(dead_info->magic) == XFS_DA_NODE_MAGIC); |
1797 | dead_node = (xfs_da_intnode_t *)dead_info; | 1797 | dead_node = (xfs_da_intnode_t *)dead_info; |
1798 | dead_level = INT_GET(dead_node->hdr.level, ARCH_CONVERT); | 1798 | dead_level = INT_GET(dead_node->hdr.level, ARCH_CONVERT); |
1799 | dead_hash = INT_GET(dead_node->btree[INT_GET(dead_node->hdr.count, ARCH_CONVERT) - 1].hashval, ARCH_CONVERT); | 1799 | dead_hash = be32_to_cpu(dead_node->btree[INT_GET(dead_node->hdr.count, ARCH_CONVERT) - 1].hashval); |
1800 | } | 1800 | } |
1801 | sib_buf = par_buf = NULL; | 1801 | sib_buf = par_buf = NULL; |
1802 | /* | 1802 | /* |
@@ -1863,7 +1863,7 @@ xfs_da_swap_lastblock(xfs_da_args_t *args, xfs_dablk_t *dead_blknop, | |||
1863 | level = INT_GET(par_node->hdr.level, ARCH_CONVERT); | 1863 | level = INT_GET(par_node->hdr.level, ARCH_CONVERT); |
1864 | for (entno = 0; | 1864 | for (entno = 0; |
1865 | entno < INT_GET(par_node->hdr.count, ARCH_CONVERT) && | 1865 | entno < INT_GET(par_node->hdr.count, ARCH_CONVERT) && |
1866 | INT_GET(par_node->btree[entno].hashval, ARCH_CONVERT) < dead_hash; | 1866 | be32_to_cpu(par_node->btree[entno].hashval) < dead_hash; |
1867 | entno++) | 1867 | entno++) |
1868 | continue; | 1868 | continue; |
1869 | if (unlikely(entno == INT_GET(par_node->hdr.count, ARCH_CONVERT))) { | 1869 | if (unlikely(entno == INT_GET(par_node->hdr.count, ARCH_CONVERT))) { |
@@ -1872,7 +1872,7 @@ xfs_da_swap_lastblock(xfs_da_args_t *args, xfs_dablk_t *dead_blknop, | |||
1872 | error = XFS_ERROR(EFSCORRUPTED); | 1872 | error = XFS_ERROR(EFSCORRUPTED); |
1873 | goto done; | 1873 | goto done; |
1874 | } | 1874 | } |
1875 | par_blkno = INT_GET(par_node->btree[entno].before, ARCH_CONVERT); | 1875 | par_blkno = be32_to_cpu(par_node->btree[entno].before); |
1876 | if (level == dead_level + 1) | 1876 | if (level == dead_level + 1) |
1877 | break; | 1877 | break; |
1878 | xfs_da_brelse(tp, par_buf); | 1878 | xfs_da_brelse(tp, par_buf); |
@@ -1885,7 +1885,7 @@ xfs_da_swap_lastblock(xfs_da_args_t *args, xfs_dablk_t *dead_blknop, | |||
1885 | for (;;) { | 1885 | for (;;) { |
1886 | for (; | 1886 | for (; |
1887 | entno < INT_GET(par_node->hdr.count, ARCH_CONVERT) && | 1887 | entno < INT_GET(par_node->hdr.count, ARCH_CONVERT) && |
1888 | INT_GET(par_node->btree[entno].before, ARCH_CONVERT) != last_blkno; | 1888 | be32_to_cpu(par_node->btree[entno].before) != last_blkno; |
1889 | entno++) | 1889 | entno++) |
1890 | continue; | 1890 | continue; |
1891 | if (entno < INT_GET(par_node->hdr.count, ARCH_CONVERT)) | 1891 | if (entno < INT_GET(par_node->hdr.count, ARCH_CONVERT)) |
@@ -1915,7 +1915,7 @@ xfs_da_swap_lastblock(xfs_da_args_t *args, xfs_dablk_t *dead_blknop, | |||
1915 | /* | 1915 | /* |
1916 | * Update the parent entry pointing to the moved block. | 1916 | * Update the parent entry pointing to the moved block. |
1917 | */ | 1917 | */ |
1918 | INT_SET(par_node->btree[entno].before, ARCH_CONVERT, dead_blkno); | 1918 | par_node->btree[entno].before = cpu_to_be32(dead_blkno); |
1919 | xfs_da_log_buf(tp, par_buf, | 1919 | xfs_da_log_buf(tp, par_buf, |
1920 | XFS_DA_LOGRANGE(par_node, &par_node->btree[entno].before, | 1920 | XFS_DA_LOGRANGE(par_node, &par_node->btree[entno].before, |
1921 | sizeof(par_node->btree[entno].before))); | 1921 | sizeof(par_node->btree[entno].before))); |