aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_da_btree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_da_btree.c')
-rw-r--r--fs/xfs/xfs_da_btree.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index 1b446849fb3d..021a8f7e563f 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -511,12 +511,12 @@ xfs_da_node_rebalance(xfs_da_state_t *state, xfs_da_state_blk_t *blk1,
511 * Move the req'd B-tree elements from high in node1 to 511 * Move the req'd B-tree elements from high in node1 to
512 * low in node2. 512 * low in node2.
513 */ 513 */
514 be16_add(&node2->hdr.count, count); 514 be16_add_cpu(&node2->hdr.count, count);
515 tmp = count * (uint)sizeof(xfs_da_node_entry_t); 515 tmp = count * (uint)sizeof(xfs_da_node_entry_t);
516 btree_s = &node1->btree[be16_to_cpu(node1->hdr.count) - count]; 516 btree_s = &node1->btree[be16_to_cpu(node1->hdr.count) - count];
517 btree_d = &node2->btree[0]; 517 btree_d = &node2->btree[0];
518 memcpy(btree_d, btree_s, tmp); 518 memcpy(btree_d, btree_s, tmp);
519 be16_add(&node1->hdr.count, -count); 519 be16_add_cpu(&node1->hdr.count, -count);
520 } else { 520 } else {
521 /* 521 /*
522 * Move the req'd B-tree elements from low in node2 to 522 * Move the req'd B-tree elements from low in node2 to
@@ -527,7 +527,7 @@ xfs_da_node_rebalance(xfs_da_state_t *state, xfs_da_state_blk_t *blk1,
527 btree_s = &node2->btree[0]; 527 btree_s = &node2->btree[0];
528 btree_d = &node1->btree[be16_to_cpu(node1->hdr.count)]; 528 btree_d = &node1->btree[be16_to_cpu(node1->hdr.count)];
529 memcpy(btree_d, btree_s, tmp); 529 memcpy(btree_d, btree_s, tmp);
530 be16_add(&node1->hdr.count, count); 530 be16_add_cpu(&node1->hdr.count, count);
531 xfs_da_log_buf(tp, blk1->bp, 531 xfs_da_log_buf(tp, blk1->bp,
532 XFS_DA_LOGRANGE(node1, btree_d, tmp)); 532 XFS_DA_LOGRANGE(node1, btree_d, tmp));
533 533
@@ -539,7 +539,7 @@ xfs_da_node_rebalance(xfs_da_state_t *state, xfs_da_state_blk_t *blk1,
539 btree_s = &node2->btree[count]; 539 btree_s = &node2->btree[count];
540 btree_d = &node2->btree[0]; 540 btree_d = &node2->btree[0];
541 memmove(btree_d, btree_s, tmp); 541 memmove(btree_d, btree_s, tmp);
542 be16_add(&node2->hdr.count, -count); 542 be16_add_cpu(&node2->hdr.count, -count);
543 } 543 }
544 544
545 /* 545 /*
@@ -604,7 +604,7 @@ xfs_da_node_add(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk,
604 btree->before = cpu_to_be32(newblk->blkno); 604 btree->before = cpu_to_be32(newblk->blkno);
605 xfs_da_log_buf(state->args->trans, oldblk->bp, 605 xfs_da_log_buf(state->args->trans, oldblk->bp,
606 XFS_DA_LOGRANGE(node, btree, tmp + sizeof(*btree))); 606 XFS_DA_LOGRANGE(node, btree, tmp + sizeof(*btree)));
607 be16_add(&node->hdr.count, 1); 607 be16_add_cpu(&node->hdr.count, 1);
608 xfs_da_log_buf(state->args->trans, oldblk->bp, 608 xfs_da_log_buf(state->args->trans, oldblk->bp,
609 XFS_DA_LOGRANGE(node, &node->hdr, sizeof(node->hdr))); 609 XFS_DA_LOGRANGE(node, &node->hdr, sizeof(node->hdr)));
610 610
@@ -959,7 +959,7 @@ xfs_da_node_remove(xfs_da_state_t *state, xfs_da_state_blk_t *drop_blk)
959 memset((char *)btree, 0, sizeof(xfs_da_node_entry_t)); 959 memset((char *)btree, 0, sizeof(xfs_da_node_entry_t));
960 xfs_da_log_buf(state->args->trans, drop_blk->bp, 960 xfs_da_log_buf(state->args->trans, drop_blk->bp,
961 XFS_DA_LOGRANGE(node, btree, sizeof(*btree))); 961 XFS_DA_LOGRANGE(node, btree, sizeof(*btree)));
962 be16_add(&node->hdr.count, -1); 962 be16_add_cpu(&node->hdr.count, -1);
963 xfs_da_log_buf(state->args->trans, drop_blk->bp, 963 xfs_da_log_buf(state->args->trans, drop_blk->bp,
964 XFS_DA_LOGRANGE(node, &node->hdr, sizeof(node->hdr))); 964 XFS_DA_LOGRANGE(node, &node->hdr, sizeof(node->hdr)));
965 965
@@ -1018,7 +1018,7 @@ xfs_da_node_unbalance(xfs_da_state_t *state, xfs_da_state_blk_t *drop_blk,
1018 */ 1018 */
1019 tmp = be16_to_cpu(drop_node->hdr.count) * (uint)sizeof(xfs_da_node_entry_t); 1019 tmp = be16_to_cpu(drop_node->hdr.count) * (uint)sizeof(xfs_da_node_entry_t);
1020 memcpy(btree, &drop_node->btree[0], tmp); 1020 memcpy(btree, &drop_node->btree[0], tmp);
1021 be16_add(&save_node->hdr.count, be16_to_cpu(drop_node->hdr.count)); 1021 be16_add_cpu(&save_node->hdr.count, be16_to_cpu(drop_node->hdr.count));
1022 1022
1023 xfs_da_log_buf(tp, save_blk->bp, 1023 xfs_da_log_buf(tp, save_blk->bp,
1024 XFS_DA_LOGRANGE(save_node, &save_node->hdr, 1024 XFS_DA_LOGRANGE(save_node, &save_node->hdr,