aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_attr.c16
-rw-r--r--fs/xfs/xfs_attr_leaf.c40
-rw-r--r--fs/xfs/xfs_da_btree.c32
-rw-r--r--fs/xfs/xfs_trace.h62
4 files changed, 144 insertions, 6 deletions
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c
index 08b9ac644c31..65d61b948ead 100644
--- a/fs/xfs/xfs_attr.c
+++ b/fs/xfs/xfs_attr.c
@@ -853,6 +853,8 @@ xfs_attr_shortform_addname(xfs_da_args_t *args)
853{ 853{
854 int newsize, forkoff, retval; 854 int newsize, forkoff, retval;
855 855
856 trace_xfs_attr_sf_addname(args);
857
856 retval = xfs_attr_shortform_lookup(args); 858 retval = xfs_attr_shortform_lookup(args);
857 if ((args->flags & ATTR_REPLACE) && (retval == ENOATTR)) { 859 if ((args->flags & ATTR_REPLACE) && (retval == ENOATTR)) {
858 return(retval); 860 return(retval);
@@ -896,6 +898,8 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
896 xfs_dabuf_t *bp; 898 xfs_dabuf_t *bp;
897 int retval, error, committed, forkoff; 899 int retval, error, committed, forkoff;
898 900
901 trace_xfs_attr_leaf_addname(args);
902
899 /* 903 /*
900 * Read the (only) block in the attribute list in. 904 * Read the (only) block in the attribute list in.
901 */ 905 */
@@ -920,6 +924,9 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
920 xfs_da_brelse(args->trans, bp); 924 xfs_da_brelse(args->trans, bp);
921 return(retval); 925 return(retval);
922 } 926 }
927
928 trace_xfs_attr_leaf_replace(args);
929
923 args->op_flags |= XFS_DA_OP_RENAME; /* an atomic rename */ 930 args->op_flags |= XFS_DA_OP_RENAME; /* an atomic rename */
924 args->blkno2 = args->blkno; /* set 2nd entry info*/ 931 args->blkno2 = args->blkno; /* set 2nd entry info*/
925 args->index2 = args->index; 932 args->index2 = args->index;
@@ -1090,6 +1097,8 @@ xfs_attr_leaf_removename(xfs_da_args_t *args)
1090 xfs_dabuf_t *bp; 1097 xfs_dabuf_t *bp;
1091 int error, committed, forkoff; 1098 int error, committed, forkoff;
1092 1099
1100 trace_xfs_attr_leaf_removename(args);
1101
1093 /* 1102 /*
1094 * Remove the attribute. 1103 * Remove the attribute.
1095 */ 1104 */
@@ -1223,6 +1232,8 @@ xfs_attr_node_addname(xfs_da_args_t *args)
1223 xfs_mount_t *mp; 1232 xfs_mount_t *mp;
1224 int committed, retval, error; 1233 int committed, retval, error;
1225 1234
1235 trace_xfs_attr_node_addname(args);
1236
1226 /* 1237 /*
1227 * Fill in bucket of arguments/results/context to carry around. 1238 * Fill in bucket of arguments/results/context to carry around.
1228 */ 1239 */
@@ -1249,6 +1260,9 @@ restart:
1249 } else if (retval == EEXIST) { 1260 } else if (retval == EEXIST) {
1250 if (args->flags & ATTR_CREATE) 1261 if (args->flags & ATTR_CREATE)
1251 goto out; 1262 goto out;
1263
1264 trace_xfs_attr_node_replace(args);
1265
1252 args->op_flags |= XFS_DA_OP_RENAME; /* atomic rename op */ 1266 args->op_flags |= XFS_DA_OP_RENAME; /* atomic rename op */
1253 args->blkno2 = args->blkno; /* set 2nd entry info*/ 1267 args->blkno2 = args->blkno; /* set 2nd entry info*/
1254 args->index2 = args->index; 1268 args->index2 = args->index;
@@ -1480,6 +1494,8 @@ xfs_attr_node_removename(xfs_da_args_t *args)
1480 xfs_dabuf_t *bp; 1494 xfs_dabuf_t *bp;
1481 int retval, error, committed, forkoff; 1495 int retval, error, committed, forkoff;
1482 1496
1497 trace_xfs_attr_node_removename(args);
1498
1483 /* 1499 /*
1484 * Tie a string around our finger to remind us where we are. 1500 * Tie a string around our finger to remind us where we are.
1485 */ 1501 */
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
index d25eafd4d28d..76d93dc953e1 100644
--- a/fs/xfs/xfs_attr_leaf.c
+++ b/fs/xfs/xfs_attr_leaf.c
@@ -235,6 +235,8 @@ xfs_attr_shortform_create(xfs_da_args_t *args)
235 xfs_inode_t *dp; 235 xfs_inode_t *dp;
236 xfs_ifork_t *ifp; 236 xfs_ifork_t *ifp;
237 237
238 trace_xfs_attr_sf_create(args);
239
238 dp = args->dp; 240 dp = args->dp;
239 ASSERT(dp != NULL); 241 ASSERT(dp != NULL);
240 ifp = dp->i_afp; 242 ifp = dp->i_afp;
@@ -268,6 +270,8 @@ xfs_attr_shortform_add(xfs_da_args_t *args, int forkoff)
268 xfs_inode_t *dp; 270 xfs_inode_t *dp;
269 xfs_ifork_t *ifp; 271 xfs_ifork_t *ifp;
270 272
273 trace_xfs_attr_sf_add(args);
274
271 dp = args->dp; 275 dp = args->dp;
272 mp = dp->i_mount; 276 mp = dp->i_mount;
273 dp->i_d.di_forkoff = forkoff; 277 dp->i_d.di_forkoff = forkoff;
@@ -337,6 +341,8 @@ xfs_attr_shortform_remove(xfs_da_args_t *args)
337 xfs_mount_t *mp; 341 xfs_mount_t *mp;
338 xfs_inode_t *dp; 342 xfs_inode_t *dp;
339 343
344 trace_xfs_attr_sf_remove(args);
345
340 dp = args->dp; 346 dp = args->dp;
341 mp = dp->i_mount; 347 mp = dp->i_mount;
342 base = sizeof(xfs_attr_sf_hdr_t); 348 base = sizeof(xfs_attr_sf_hdr_t);
@@ -405,6 +411,8 @@ xfs_attr_shortform_lookup(xfs_da_args_t *args)
405 int i; 411 int i;
406 xfs_ifork_t *ifp; 412 xfs_ifork_t *ifp;
407 413
414 trace_xfs_attr_sf_lookup(args);
415
408 ifp = args->dp->i_afp; 416 ifp = args->dp->i_afp;
409 ASSERT(ifp->if_flags & XFS_IFINLINE); 417 ASSERT(ifp->if_flags & XFS_IFINLINE);
410 sf = (xfs_attr_shortform_t *)ifp->if_u1.if_data; 418 sf = (xfs_attr_shortform_t *)ifp->if_u1.if_data;
@@ -476,6 +484,8 @@ xfs_attr_shortform_to_leaf(xfs_da_args_t *args)
476 xfs_dabuf_t *bp; 484 xfs_dabuf_t *bp;
477 xfs_ifork_t *ifp; 485 xfs_ifork_t *ifp;
478 486
487 trace_xfs_attr_sf_to_leaf(args);
488
479 dp = args->dp; 489 dp = args->dp;
480 ifp = dp->i_afp; 490 ifp = dp->i_afp;
481 sf = (xfs_attr_shortform_t *)ifp->if_u1.if_data; 491 sf = (xfs_attr_shortform_t *)ifp->if_u1.if_data;
@@ -775,6 +785,8 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff)
775 char *tmpbuffer; 785 char *tmpbuffer;
776 int error, i; 786 int error, i;
777 787
788 trace_xfs_attr_leaf_to_sf(args);
789
778 dp = args->dp; 790 dp = args->dp;
779 tmpbuffer = kmem_alloc(XFS_LBSIZE(dp->i_mount), KM_SLEEP); 791 tmpbuffer = kmem_alloc(XFS_LBSIZE(dp->i_mount), KM_SLEEP);
780 ASSERT(tmpbuffer != NULL); 792 ASSERT(tmpbuffer != NULL);
@@ -848,6 +860,8 @@ xfs_attr_leaf_to_node(xfs_da_args_t *args)
848 xfs_dablk_t blkno; 860 xfs_dablk_t blkno;
849 int error; 861 int error;
850 862
863 trace_xfs_attr_leaf_to_node(args);
864
851 dp = args->dp; 865 dp = args->dp;
852 bp1 = bp2 = NULL; 866 bp1 = bp2 = NULL;
853 error = xfs_da_grow_inode(args, &blkno); 867 error = xfs_da_grow_inode(args, &blkno);
@@ -911,6 +925,8 @@ xfs_attr_leaf_create(xfs_da_args_t *args, xfs_dablk_t blkno, xfs_dabuf_t **bpp)
911 xfs_dabuf_t *bp; 925 xfs_dabuf_t *bp;
912 int error; 926 int error;
913 927
928 trace_xfs_attr_leaf_create(args);
929
914 dp = args->dp; 930 dp = args->dp;
915 ASSERT(dp != NULL); 931 ASSERT(dp != NULL);
916 error = xfs_da_get_buf(args->trans, args->dp, blkno, -1, &bp, 932 error = xfs_da_get_buf(args->trans, args->dp, blkno, -1, &bp,
@@ -948,6 +964,8 @@ xfs_attr_leaf_split(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk,
948 xfs_dablk_t blkno; 964 xfs_dablk_t blkno;
949 int error; 965 int error;
950 966
967 trace_xfs_attr_leaf_split(state->args);
968
951 /* 969 /*
952 * Allocate space for a new leaf node. 970 * Allocate space for a new leaf node.
953 */ 971 */
@@ -977,10 +995,13 @@ xfs_attr_leaf_split(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk,
977 * 995 *
978 * Insert the "new" entry in the correct block. 996 * Insert the "new" entry in the correct block.
979 */ 997 */
980 if (state->inleaf) 998 if (state->inleaf) {
999 trace_xfs_attr_leaf_add_old(state->args);
981 error = xfs_attr_leaf_add(oldblk->bp, state->args); 1000 error = xfs_attr_leaf_add(oldblk->bp, state->args);
982 else 1001 } else {
1002 trace_xfs_attr_leaf_add_new(state->args);
983 error = xfs_attr_leaf_add(newblk->bp, state->args); 1003 error = xfs_attr_leaf_add(newblk->bp, state->args);
1004 }
984 1005
985 /* 1006 /*
986 * Update last hashval in each block since we added the name. 1007 * Update last hashval in each block since we added the name.
@@ -1001,6 +1022,8 @@ xfs_attr_leaf_add(xfs_dabuf_t *bp, xfs_da_args_t *args)
1001 xfs_attr_leaf_map_t *map; 1022 xfs_attr_leaf_map_t *map;
1002 int tablesize, entsize, sum, tmp, i; 1023 int tablesize, entsize, sum, tmp, i;
1003 1024
1025 trace_xfs_attr_leaf_add(args);
1026
1004 leaf = bp->data; 1027 leaf = bp->data;
1005 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); 1028 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC));
1006 ASSERT((args->index >= 0) 1029 ASSERT((args->index >= 0)
@@ -1128,8 +1151,6 @@ xfs_attr_leaf_add_work(xfs_dabuf_t *bp, xfs_da_args_t *args, int mapindex)
1128 (be32_to_cpu(entry->hashval) <= be32_to_cpu((entry+1)->hashval))); 1151 (be32_to_cpu(entry->hashval) <= be32_to_cpu((entry+1)->hashval)));
1129 1152
1130 /* 1153 /*
1131 * Copy the attribute name and value into the new space.
1132 *
1133 * For "remote" attribute values, simply note that we need to 1154 * For "remote" attribute values, simply note that we need to
1134 * allocate space for the "remote" value. We can't actually 1155 * allocate space for the "remote" value. We can't actually
1135 * allocate the extents in this transaction, and we can't decide 1156 * allocate the extents in this transaction, and we can't decide
@@ -1265,6 +1286,8 @@ xfs_attr_leaf_rebalance(xfs_da_state_t *state, xfs_da_state_blk_t *blk1,
1265 ASSERT(leaf2->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); 1286 ASSERT(leaf2->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC));
1266 args = state->args; 1287 args = state->args;
1267 1288
1289 trace_xfs_attr_leaf_rebalance(args);
1290
1268 /* 1291 /*
1269 * Check ordering of blocks, reverse if it makes things simpler. 1292 * Check ordering of blocks, reverse if it makes things simpler.
1270 * 1293 *
@@ -1810,6 +1833,8 @@ xfs_attr_leaf_unbalance(xfs_da_state_t *state, xfs_da_state_blk_t *drop_blk,
1810 xfs_mount_t *mp; 1833 xfs_mount_t *mp;
1811 char *tmpbuffer; 1834 char *tmpbuffer;
1812 1835
1836 trace_xfs_attr_leaf_unbalance(state->args);
1837
1813 /* 1838 /*
1814 * Set up environment. 1839 * Set up environment.
1815 */ 1840 */
@@ -1919,6 +1944,8 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp, xfs_da_args_t *args)
1919 int probe, span; 1944 int probe, span;
1920 xfs_dahash_t hashval; 1945 xfs_dahash_t hashval;
1921 1946
1947 trace_xfs_attr_leaf_lookup(args);
1948
1922 leaf = bp->data; 1949 leaf = bp->data;
1923 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); 1950 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC));
1924 ASSERT(be16_to_cpu(leaf->hdr.count) 1951 ASSERT(be16_to_cpu(leaf->hdr.count)
@@ -2445,6 +2472,7 @@ xfs_attr_leaf_clearflag(xfs_da_args_t *args)
2445 char *name; 2472 char *name;
2446#endif /* DEBUG */ 2473#endif /* DEBUG */
2447 2474
2475 trace_xfs_attr_leaf_clearflag(args);
2448 /* 2476 /*
2449 * Set up the operation. 2477 * Set up the operation.
2450 */ 2478 */
@@ -2509,6 +2537,8 @@ xfs_attr_leaf_setflag(xfs_da_args_t *args)
2509 xfs_dabuf_t *bp; 2537 xfs_dabuf_t *bp;
2510 int error; 2538 int error;
2511 2539
2540 trace_xfs_attr_leaf_setflag(args);
2541
2512 /* 2542 /*
2513 * Set up the operation. 2543 * Set up the operation.
2514 */ 2544 */
@@ -2565,6 +2595,8 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *args)
2565 char *name1, *name2; 2595 char *name1, *name2;
2566#endif /* DEBUG */ 2596#endif /* DEBUG */
2567 2597
2598 trace_xfs_attr_leaf_flipflags(args);
2599
2568 /* 2600 /*
2569 * Read the block containing the "old" attr 2601 * Read the block containing the "old" attr
2570 */ 2602 */
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;
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index afb028213dbd..06838c42b2a0 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -1418,7 +1418,7 @@ DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1418DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed); 1418DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1419DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed); 1419DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1420 1420
1421DECLARE_EVENT_CLASS(xfs_dir2_class, 1421DECLARE_EVENT_CLASS(xfs_da_class,
1422 TP_PROTO(struct xfs_da_args *args), 1422 TP_PROTO(struct xfs_da_args *args),
1423 TP_ARGS(args), 1423 TP_ARGS(args),
1424 TP_STRUCT__entry( 1424 TP_STRUCT__entry(
@@ -1453,7 +1453,7 @@ DECLARE_EVENT_CLASS(xfs_dir2_class,
1453) 1453)
1454 1454
1455#define DEFINE_DIR2_EVENT(name) \ 1455#define DEFINE_DIR2_EVENT(name) \
1456DEFINE_EVENT(xfs_dir2_class, name, \ 1456DEFINE_EVENT(xfs_da_class, name, \
1457 TP_PROTO(struct xfs_da_args *args), \ 1457 TP_PROTO(struct xfs_da_args *args), \
1458 TP_ARGS(args)) 1458 TP_ARGS(args))
1459DEFINE_DIR2_EVENT(xfs_dir2_sf_addname); 1459DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
@@ -1482,6 +1482,64 @@ DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1482DEFINE_DIR2_EVENT(xfs_dir2_node_removename); 1482DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1483DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf); 1483DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1484 1484
1485#define DEFINE_ATTR_EVENT(name) \
1486DEFINE_EVENT(xfs_da_class, name, \
1487 TP_PROTO(struct xfs_da_args *args), \
1488 TP_ARGS(args))
1489DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1490DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1491DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1492DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1493DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1494DEFINE_ATTR_EVENT(xfs_attr_sf_removename);
1495DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1496
1497DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1498DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1499DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
1500DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1501DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
1502DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1503DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
1504DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1505DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1506DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1507DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1508DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1509DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1510DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1511DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1512DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1513DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1514DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
1515
1516DEFINE_ATTR_EVENT(xfs_attr_node_addname);
1517DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
1518DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1519DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1520
1521#define DEFINE_DA_EVENT(name) \
1522DEFINE_EVENT(xfs_da_class, name, \
1523 TP_PROTO(struct xfs_da_args *args), \
1524 TP_ARGS(args))
1525DEFINE_DA_EVENT(xfs_da_split);
1526DEFINE_DA_EVENT(xfs_da_join);
1527DEFINE_DA_EVENT(xfs_da_link_before);
1528DEFINE_DA_EVENT(xfs_da_link_after);
1529DEFINE_DA_EVENT(xfs_da_unlink_back);
1530DEFINE_DA_EVENT(xfs_da_unlink_forward);
1531DEFINE_DA_EVENT(xfs_da_root_split);
1532DEFINE_DA_EVENT(xfs_da_root_join);
1533DEFINE_DA_EVENT(xfs_da_node_add);
1534DEFINE_DA_EVENT(xfs_da_node_create);
1535DEFINE_DA_EVENT(xfs_da_node_split);
1536DEFINE_DA_EVENT(xfs_da_node_remove);
1537DEFINE_DA_EVENT(xfs_da_node_rebalance);
1538DEFINE_DA_EVENT(xfs_da_node_unbalance);
1539DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1540DEFINE_DA_EVENT(xfs_da_grow_inode);
1541DEFINE_DA_EVENT(xfs_da_shrink_inode);
1542
1485DECLARE_EVENT_CLASS(xfs_dir2_space_class, 1543DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1486 TP_PROTO(struct xfs_da_args *args, int idx), 1544 TP_PROTO(struct xfs_da_args *args, int idx),
1487 TP_ARGS(args, idx), 1545 TP_ARGS(args, idx),