aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_attr_leaf.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-03-22 01:15:13 -0400
committerBen Myers <bpm@sgi.com>2012-03-27 18:18:21 -0400
commit5a5881cdeec2c019b5c9a307800218ee029f7f61 (patch)
tree67ae565f9e243a1eaa986457ca869e776fb76fac /fs/xfs/xfs_attr_leaf.c
parentd97d32edcd732110758799ae60af725e5110b3dc (diff)
xfs: add lots of attribute trace points
Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_attr_leaf.c')
-rw-r--r--fs/xfs/xfs_attr_leaf.c40
1 files changed, 36 insertions, 4 deletions
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 */