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.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index 77c74257c2a3..7f1a6f5b05a6 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -108,6 +108,8 @@ xfs_da_node_create(xfs_da_args_t *args, xfs_dablk_t blkno, int level,
108 int error; 108 int error;
109 xfs_trans_t *tp; 109 xfs_trans_t *tp;
110 110
111 trace_xfs_da_node_create(args);
112
111 tp = args->trans; 113 tp = args->trans;
112 error = xfs_da_get_buf(tp, args->dp, blkno, -1, &bp, whichfork); 114 error = xfs_da_get_buf(tp, args->dp, blkno, -1, &bp, whichfork);
113 if (error) 115 if (error)
@@ -140,6 +142,8 @@ xfs_da_split(xfs_da_state_t *state)
140 xfs_dabuf_t *bp; 142 xfs_dabuf_t *bp;
141 int max, action, error, i; 143 int max, action, error, i;
142 144
145 trace_xfs_da_split(state->args);
146
143 /* 147 /*
144 * Walk back up the tree splitting/inserting/adjusting as necessary. 148 * Walk back up the tree splitting/inserting/adjusting as necessary.
145 * If we need to insert and there isn't room, split the node, then 149 * If we need to insert and there isn't room, split the node, then
@@ -178,10 +182,12 @@ xfs_da_split(xfs_da_state_t *state)
178 state->extravalid = 1; 182 state->extravalid = 1;
179 if (state->inleaf) { 183 if (state->inleaf) {
180 state->extraafter = 0; /* before newblk */ 184 state->extraafter = 0; /* before newblk */
185 trace_xfs_attr_leaf_split_before(state->args);
181 error = xfs_attr_leaf_split(state, oldblk, 186 error = xfs_attr_leaf_split(state, oldblk,
182 &state->extrablk); 187 &state->extrablk);
183 } else { 188 } else {
184 state->extraafter = 1; /* after newblk */ 189 state->extraafter = 1; /* after newblk */
190 trace_xfs_attr_leaf_split_after(state->args);
185 error = xfs_attr_leaf_split(state, newblk, 191 error = xfs_attr_leaf_split(state, newblk,
186 &state->extrablk); 192 &state->extrablk);
187 } 193 }
@@ -300,6 +306,8 @@ xfs_da_root_split(xfs_da_state_t *state, xfs_da_state_blk_t *blk1,
300 xfs_mount_t *mp; 306 xfs_mount_t *mp;
301 xfs_dir2_leaf_t *leaf; 307 xfs_dir2_leaf_t *leaf;
302 308
309 trace_xfs_da_root_split(state->args);
310
303 /* 311 /*
304 * Copy the existing (incorrect) block from the root node position 312 * Copy the existing (incorrect) block from the root node position
305 * to a free space somewhere. 313 * to a free space somewhere.
@@ -380,6 +388,8 @@ xfs_da_node_split(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk,
380 int newcount, error; 388 int newcount, error;
381 int useextra; 389 int useextra;
382 390
391 trace_xfs_da_node_split(state->args);
392
383 node = oldblk->bp->data; 393 node = oldblk->bp->data;
384 ASSERT(node->hdr.info.magic == cpu_to_be16(XFS_DA_NODE_MAGIC)); 394 ASSERT(node->hdr.info.magic == cpu_to_be16(XFS_DA_NODE_MAGIC));
385 395
@@ -466,6 +476,8 @@ xfs_da_node_rebalance(xfs_da_state_t *state, xfs_da_state_blk_t *blk1,
466 int count, tmp; 476 int count, tmp;
467 xfs_trans_t *tp; 477 xfs_trans_t *tp;
468 478
479 trace_xfs_da_node_rebalance(state->args);
480
469 node1 = blk1->bp->data; 481 node1 = blk1->bp->data;
470 node2 = blk2->bp->data; 482 node2 = blk2->bp->data;
471 /* 483 /*
@@ -574,6 +586,8 @@ xfs_da_node_add(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk,
574 xfs_da_node_entry_t *btree; 586 xfs_da_node_entry_t *btree;
575 int tmp; 587 int tmp;
576 588
589 trace_xfs_da_node_add(state->args);
590
577 node = oldblk->bp->data; 591 node = oldblk->bp->data;
578 ASSERT(node->hdr.info.magic == cpu_to_be16(XFS_DA_NODE_MAGIC)); 592 ASSERT(node->hdr.info.magic == cpu_to_be16(XFS_DA_NODE_MAGIC));
579 ASSERT((oldblk->index >= 0) && (oldblk->index <= be16_to_cpu(node->hdr.count))); 593 ASSERT((oldblk->index >= 0) && (oldblk->index <= be16_to_cpu(node->hdr.count)));
@@ -619,6 +633,8 @@ xfs_da_join(xfs_da_state_t *state)
619 xfs_da_state_blk_t *drop_blk, *save_blk; 633 xfs_da_state_blk_t *drop_blk, *save_blk;
620 int action, error; 634 int action, error;
621 635
636 trace_xfs_da_join(state->args);
637
622 action = 0; 638 action = 0;
623 drop_blk = &state->path.blk[ state->path.active-1 ]; 639 drop_blk = &state->path.blk[ state->path.active-1 ];
624 save_blk = &state->altpath.blk[ state->path.active-1 ]; 640 save_blk = &state->altpath.blk[ state->path.active-1 ];
@@ -723,6 +739,8 @@ xfs_da_root_join(xfs_da_state_t *state, xfs_da_state_blk_t *root_blk)
723 xfs_dabuf_t *bp; 739 xfs_dabuf_t *bp;
724 int error; 740 int error;
725 741
742 trace_xfs_da_root_join(state->args);
743
726 args = state->args; 744 args = state->args;
727 ASSERT(args != NULL); 745 ASSERT(args != NULL);
728 ASSERT(root_blk->magic == XFS_DA_NODE_MAGIC); 746 ASSERT(root_blk->magic == XFS_DA_NODE_MAGIC);
@@ -941,6 +959,8 @@ xfs_da_node_remove(xfs_da_state_t *state, xfs_da_state_blk_t *drop_blk)
941 xfs_da_node_entry_t *btree; 959 xfs_da_node_entry_t *btree;
942 int tmp; 960 int tmp;
943 961
962 trace_xfs_da_node_remove(state->args);
963
944 node = drop_blk->bp->data; 964 node = drop_blk->bp->data;
945 ASSERT(drop_blk->index < be16_to_cpu(node->hdr.count)); 965 ASSERT(drop_blk->index < be16_to_cpu(node->hdr.count));
946 ASSERT(drop_blk->index >= 0); 966 ASSERT(drop_blk->index >= 0);
@@ -984,6 +1004,8 @@ xfs_da_node_unbalance(xfs_da_state_t *state, xfs_da_state_blk_t *drop_blk,
984 int tmp; 1004 int tmp;
985 xfs_trans_t *tp; 1005 xfs_trans_t *tp;
986 1006
1007 trace_xfs_da_node_unbalance(state->args);
1008
987 drop_node = drop_blk->bp->data; 1009 drop_node = drop_blk->bp->data;
988 save_node = save_blk->bp->data; 1010 save_node = save_blk->bp->data;
989 ASSERT(drop_node->hdr.info.magic == cpu_to_be16(XFS_DA_NODE_MAGIC)); 1011 ASSERT(drop_node->hdr.info.magic == cpu_to_be16(XFS_DA_NODE_MAGIC));
@@ -1230,6 +1252,7 @@ xfs_da_blk_link(xfs_da_state_t *state, xfs_da_state_blk_t *old_blk,
1230 /* 1252 /*
1231 * Link new block in before existing block. 1253 * Link new block in before existing block.
1232 */ 1254 */
1255 trace_xfs_da_link_before(args);
1233 new_info->forw = cpu_to_be32(old_blk->blkno); 1256 new_info->forw = cpu_to_be32(old_blk->blkno);
1234 new_info->back = old_info->back; 1257 new_info->back = old_info->back;
1235 if (old_info->back) { 1258 if (old_info->back) {
@@ -1251,6 +1274,7 @@ xfs_da_blk_link(xfs_da_state_t *state, xfs_da_state_blk_t *old_blk,
1251 /* 1274 /*
1252 * Link new block in after existing block. 1275 * Link new block in after existing block.
1253 */ 1276 */
1277 trace_xfs_da_link_after(args);
1254 new_info->forw = old_info->forw; 1278 new_info->forw = old_info->forw;
1255 new_info->back = cpu_to_be32(old_blk->blkno); 1279 new_info->back = cpu_to_be32(old_blk->blkno);
1256 if (old_info->forw) { 1280 if (old_info->forw) {
@@ -1348,6 +1372,7 @@ xfs_da_blk_unlink(xfs_da_state_t *state, xfs_da_state_blk_t *drop_blk,
1348 * Unlink the leaf block from the doubly linked chain of leaves. 1372 * Unlink the leaf block from the doubly linked chain of leaves.
1349 */ 1373 */
1350 if (be32_to_cpu(save_info->back) == drop_blk->blkno) { 1374 if (be32_to_cpu(save_info->back) == drop_blk->blkno) {
1375 trace_xfs_da_unlink_back(args);
1351 save_info->back = drop_info->back; 1376 save_info->back = drop_info->back;
1352 if (drop_info->back) { 1377 if (drop_info->back) {
1353 error = xfs_da_read_buf(args->trans, args->dp, 1378 error = xfs_da_read_buf(args->trans, args->dp,
@@ -1365,6 +1390,7 @@ xfs_da_blk_unlink(xfs_da_state_t *state, xfs_da_state_blk_t *drop_blk,
1365 xfs_da_buf_done(bp); 1390 xfs_da_buf_done(bp);
1366 } 1391 }
1367 } else { 1392 } else {
1393 trace_xfs_da_unlink_forward(args);
1368 save_info->forw = drop_info->forw; 1394 save_info->forw = drop_info->forw;
1369 if (drop_info->forw) { 1395 if (drop_info->forw) {
1370 error = xfs_da_read_buf(args->trans, args->dp, 1396 error = xfs_da_read_buf(args->trans, args->dp,
@@ -1652,6 +1678,8 @@ xfs_da_grow_inode(
1652 int count; 1678 int count;
1653 int error; 1679 int error;
1654 1680
1681 trace_xfs_da_grow_inode(args);
1682
1655 if (args->whichfork == XFS_DATA_FORK) { 1683 if (args->whichfork == XFS_DATA_FORK) {
1656 bno = args->dp->i_mount->m_dirleafblk; 1684 bno = args->dp->i_mount->m_dirleafblk;
1657 count = args->dp->i_mount->m_dirblkfsbs; 1685 count = args->dp->i_mount->m_dirblkfsbs;
@@ -1690,6 +1718,8 @@ xfs_da_swap_lastblock(xfs_da_args_t *args, xfs_dablk_t *dead_blknop,
1690 xfs_dir2_leaf_t *dead_leaf2; 1718 xfs_dir2_leaf_t *dead_leaf2;
1691 xfs_dahash_t dead_hash; 1719 xfs_dahash_t dead_hash;
1692 1720
1721 trace_xfs_da_swap_lastblock(args);
1722
1693 dead_buf = *dead_bufp; 1723 dead_buf = *dead_bufp;
1694 dead_blkno = *dead_blknop; 1724 dead_blkno = *dead_blknop;
1695 tp = args->trans; 1725 tp = args->trans;
@@ -1878,6 +1908,8 @@ xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
1878 xfs_trans_t *tp; 1908 xfs_trans_t *tp;
1879 xfs_mount_t *mp; 1909 xfs_mount_t *mp;
1880 1910
1911 trace_xfs_da_shrink_inode(args);
1912
1881 dp = args->dp; 1913 dp = args->dp;
1882 w = args->whichfork; 1914 w = args->whichfork;
1883 tp = args->trans; 1915 tp = args->trans;