Commit 3a59c94c4b48878c6af047cdfc8c137d0fa7a0f0
Committed by
Tim Shimmin
1 parent
b11f94d537
Exists in
master
and in
4 other branches
[XFS] Clean up function name handling in tracing code
Remove the hardcoded "fnames" for tracing, and just embed them in tracing macros via __FUNCTION__. Kills a lot of #ifdefs too. SGI-PV: 967353 SGI-Modid: xfs-linux-melb:xfs-kern:29099a Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Showing 5 changed files with 150 additions and 273 deletions Side-by-side Diff
fs/xfs/xfs_alloc.c
... | ... | @@ -55,17 +55,17 @@ |
55 | 55 | ktrace_t *xfs_alloc_trace_buf; |
56 | 56 | |
57 | 57 | #define TRACE_ALLOC(s,a) \ |
58 | - xfs_alloc_trace_alloc(fname, s, a, __LINE__) | |
58 | + xfs_alloc_trace_alloc(__FUNCTION__, s, a, __LINE__) | |
59 | 59 | #define TRACE_FREE(s,a,b,x,f) \ |
60 | - xfs_alloc_trace_free(fname, s, mp, a, b, x, f, __LINE__) | |
60 | + xfs_alloc_trace_free(__FUNCTION__, s, mp, a, b, x, f, __LINE__) | |
61 | 61 | #define TRACE_MODAGF(s,a,f) \ |
62 | - xfs_alloc_trace_modagf(fname, s, mp, a, f, __LINE__) | |
63 | -#define TRACE_BUSY(fname,s,ag,agb,l,sl,tp) \ | |
64 | - xfs_alloc_trace_busy(fname, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSY, __LINE__) | |
65 | -#define TRACE_UNBUSY(fname,s,ag,sl,tp) \ | |
66 | - xfs_alloc_trace_busy(fname, s, mp, ag, -1, -1, sl, tp, XFS_ALLOC_KTRACE_UNBUSY, __LINE__) | |
67 | -#define TRACE_BUSYSEARCH(fname,s,ag,agb,l,sl,tp) \ | |
68 | - xfs_alloc_trace_busy(fname, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSYSEARCH, __LINE__) | |
62 | + xfs_alloc_trace_modagf(__FUNCTION__, s, mp, a, f, __LINE__) | |
63 | +#define TRACE_BUSY(__FUNCTION__,s,ag,agb,l,sl,tp) \ | |
64 | + xfs_alloc_trace_busy(__FUNCTION__, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSY, __LINE__) | |
65 | +#define TRACE_UNBUSY(__FUNCTION__,s,ag,sl,tp) \ | |
66 | + xfs_alloc_trace_busy(__FUNCTION__, s, mp, ag, -1, -1, sl, tp, XFS_ALLOC_KTRACE_UNBUSY, __LINE__) | |
67 | +#define TRACE_BUSYSEARCH(__FUNCTION__,s,ag,agb,l,sl,tp) \ | |
68 | + xfs_alloc_trace_busy(__FUNCTION__, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSYSEARCH, __LINE__) | |
69 | 69 | #else |
70 | 70 | #define TRACE_ALLOC(s,a) |
71 | 71 | #define TRACE_FREE(s,a,b,x,f) |
... | ... | @@ -420,7 +420,7 @@ |
420 | 420 | */ |
421 | 421 | STATIC void |
422 | 422 | xfs_alloc_trace_alloc( |
423 | - char *name, /* function tag string */ | |
423 | + const char *name, /* function tag string */ | |
424 | 424 | char *str, /* additional string */ |
425 | 425 | xfs_alloc_arg_t *args, /* allocation argument structure */ |
426 | 426 | int line) /* source line number */ |
... | ... | @@ -453,7 +453,7 @@ |
453 | 453 | */ |
454 | 454 | STATIC void |
455 | 455 | xfs_alloc_trace_free( |
456 | - char *name, /* function tag string */ | |
456 | + const char *name, /* function tag string */ | |
457 | 457 | char *str, /* additional string */ |
458 | 458 | xfs_mount_t *mp, /* file system mount point */ |
459 | 459 | xfs_agnumber_t agno, /* allocation group number */ |
... | ... | @@ -479,7 +479,7 @@ |
479 | 479 | */ |
480 | 480 | STATIC void |
481 | 481 | xfs_alloc_trace_modagf( |
482 | - char *name, /* function tag string */ | |
482 | + const char *name, /* function tag string */ | |
483 | 483 | char *str, /* additional string */ |
484 | 484 | xfs_mount_t *mp, /* file system mount point */ |
485 | 485 | xfs_agf_t *agf, /* new agf value */ |
... | ... | @@ -507,7 +507,7 @@ |
507 | 507 | |
508 | 508 | STATIC void |
509 | 509 | xfs_alloc_trace_busy( |
510 | - char *name, /* function tag string */ | |
510 | + const char *name, /* function tag string */ | |
511 | 511 | char *str, /* additional string */ |
512 | 512 | xfs_mount_t *mp, /* file system mount point */ |
513 | 513 | xfs_agnumber_t agno, /* allocation group number */ |
... | ... | @@ -549,9 +549,6 @@ |
549 | 549 | xfs_alloc_arg_t *args) /* argument structure for allocation */ |
550 | 550 | { |
551 | 551 | int error=0; |
552 | -#ifdef XFS_ALLOC_TRACE | |
553 | - static char fname[] = "xfs_alloc_ag_vextent"; | |
554 | -#endif | |
555 | 552 | |
556 | 553 | ASSERT(args->minlen > 0); |
557 | 554 | ASSERT(args->maxlen > 0); |
... | ... | @@ -635,9 +632,6 @@ |
635 | 632 | xfs_agblock_t fbno; /* start block of found extent */ |
636 | 633 | xfs_agblock_t fend; /* end block of found extent */ |
637 | 634 | xfs_extlen_t flen; /* length of found extent */ |
638 | -#ifdef XFS_ALLOC_TRACE | |
639 | - static char fname[] = "xfs_alloc_ag_vextent_exact"; | |
640 | -#endif | |
641 | 635 | int i; /* success/failure of operation */ |
642 | 636 | xfs_agblock_t maxend; /* end of maximal extent */ |
643 | 637 | xfs_agblock_t minend; /* end of minimal extent */ |
... | ... | @@ -737,9 +731,6 @@ |
737 | 731 | xfs_btree_cur_t *bno_cur_gt; /* cursor for bno btree, right side */ |
738 | 732 | xfs_btree_cur_t *bno_cur_lt; /* cursor for bno btree, left side */ |
739 | 733 | xfs_btree_cur_t *cnt_cur; /* cursor for count btree */ |
740 | -#ifdef XFS_ALLOC_TRACE | |
741 | - static char fname[] = "xfs_alloc_ag_vextent_near"; | |
742 | -#endif | |
743 | 734 | xfs_agblock_t gtbno; /* start bno of right side entry */ |
744 | 735 | xfs_agblock_t gtbnoa; /* aligned ... */ |
745 | 736 | xfs_extlen_t gtdiff; /* difference to right side entry */ |
... | ... | @@ -1270,9 +1261,6 @@ |
1270 | 1261 | int error; /* error result */ |
1271 | 1262 | xfs_agblock_t fbno; /* start of found freespace */ |
1272 | 1263 | xfs_extlen_t flen; /* length of found freespace */ |
1273 | -#ifdef XFS_ALLOC_TRACE | |
1274 | - static char fname[] = "xfs_alloc_ag_vextent_size"; | |
1275 | -#endif | |
1276 | 1264 | int i; /* temp status variable */ |
1277 | 1265 | xfs_agblock_t rbno; /* returned block number */ |
1278 | 1266 | xfs_extlen_t rlen; /* length of returned extent */ |
... | ... | @@ -1427,9 +1415,6 @@ |
1427 | 1415 | int error; |
1428 | 1416 | xfs_agblock_t fbno; |
1429 | 1417 | xfs_extlen_t flen; |
1430 | -#ifdef XFS_ALLOC_TRACE | |
1431 | - static char fname[] = "xfs_alloc_ag_vextent_small"; | |
1432 | -#endif | |
1433 | 1418 | int i; |
1434 | 1419 | |
1435 | 1420 | if ((error = xfs_alloc_decrement(ccur, 0, &i))) |
... | ... | @@ -1516,9 +1501,6 @@ |
1516 | 1501 | xfs_btree_cur_t *bno_cur; /* cursor for by-block btree */ |
1517 | 1502 | xfs_btree_cur_t *cnt_cur; /* cursor for by-size btree */ |
1518 | 1503 | int error; /* error return value */ |
1519 | -#ifdef XFS_ALLOC_TRACE | |
1520 | - static char fname[] = "xfs_free_ag_extent"; | |
1521 | -#endif | |
1522 | 1504 | xfs_agblock_t gtbno; /* start of right neighbor block */ |
1523 | 1505 | xfs_extlen_t gtlen; /* length of right neighbor block */ |
1524 | 1506 | int haveleft; /* have a left neighbor block */ |
... | ... | @@ -2003,9 +1985,6 @@ |
2003 | 1985 | xfs_agblock_t bno; /* block number returned */ |
2004 | 1986 | int error; |
2005 | 1987 | int logflags; |
2006 | -#ifdef XFS_ALLOC_TRACE | |
2007 | - static char fname[] = "xfs_alloc_get_freelist"; | |
2008 | -#endif | |
2009 | 1988 | xfs_mount_t *mp; /* mount structure */ |
2010 | 1989 | xfs_perag_t *pag; /* per allocation group data */ |
2011 | 1990 | |
... | ... | @@ -2128,9 +2107,6 @@ |
2128 | 2107 | __be32 *blockp;/* pointer to array entry */ |
2129 | 2108 | int error; |
2130 | 2109 | int logflags; |
2131 | -#ifdef XFS_ALLOC_TRACE | |
2132 | - static char fname[] = "xfs_alloc_put_freelist"; | |
2133 | -#endif | |
2134 | 2110 | xfs_mount_t *mp; /* mount structure */ |
2135 | 2111 | xfs_perag_t *pag; /* per allocation group data */ |
2136 | 2112 | |
... | ... | @@ -2263,9 +2239,6 @@ |
2263 | 2239 | xfs_agblock_t agsize; /* allocation group size */ |
2264 | 2240 | int error; |
2265 | 2241 | int flags; /* XFS_ALLOC_FLAG_... locking flags */ |
2266 | -#ifdef XFS_ALLOC_TRACE | |
2267 | - static char fname[] = "xfs_alloc_vextent"; | |
2268 | -#endif | |
2269 | 2242 | xfs_extlen_t minleft;/* minimum left value, temp copy */ |
2270 | 2243 | xfs_mount_t *mp; /* mount structure pointer */ |
2271 | 2244 | xfs_agnumber_t sagno; /* starting allocation group number */ |
fs/xfs/xfs_bmap.c
... | ... | @@ -278,7 +278,7 @@ |
278 | 278 | STATIC void |
279 | 279 | xfs_bmap_trace_addentry( |
280 | 280 | int opcode, /* operation */ |
281 | - char *fname, /* function name */ | |
281 | + const char *fname, /* function name */ | |
282 | 282 | char *desc, /* operation description */ |
283 | 283 | xfs_inode_t *ip, /* incore inode pointer */ |
284 | 284 | xfs_extnum_t idx, /* index of entry(ies) */ |
... | ... | @@ -292,7 +292,7 @@ |
292 | 292 | */ |
293 | 293 | STATIC void |
294 | 294 | xfs_bmap_trace_delete( |
295 | - char *fname, /* function name */ | |
295 | + const char *fname, /* function name */ | |
296 | 296 | char *desc, /* operation description */ |
297 | 297 | xfs_inode_t *ip, /* incore inode pointer */ |
298 | 298 | xfs_extnum_t idx, /* index of entry(entries) deleted */ |
... | ... | @@ -305,7 +305,7 @@ |
305 | 305 | */ |
306 | 306 | STATIC void |
307 | 307 | xfs_bmap_trace_insert( |
308 | - char *fname, /* function name */ | |
308 | + const char *fname, /* function name */ | |
309 | 309 | char *desc, /* operation description */ |
310 | 310 | xfs_inode_t *ip, /* incore inode pointer */ |
311 | 311 | xfs_extnum_t idx, /* index of entry(entries) inserted */ |
... | ... | @@ -319,7 +319,7 @@ |
319 | 319 | */ |
320 | 320 | STATIC void |
321 | 321 | xfs_bmap_trace_post_update( |
322 | - char *fname, /* function name */ | |
322 | + const char *fname, /* function name */ | |
323 | 323 | char *desc, /* operation description */ |
324 | 324 | xfs_inode_t *ip, /* incore inode pointer */ |
325 | 325 | xfs_extnum_t idx, /* index of entry updated */ |
326 | 326 | |
327 | 327 | |
... | ... | @@ -330,17 +330,25 @@ |
330 | 330 | */ |
331 | 331 | STATIC void |
332 | 332 | xfs_bmap_trace_pre_update( |
333 | - char *fname, /* function name */ | |
333 | + const char *fname, /* function name */ | |
334 | 334 | char *desc, /* operation description */ |
335 | 335 | xfs_inode_t *ip, /* incore inode pointer */ |
336 | 336 | xfs_extnum_t idx, /* index of entry to be updated */ |
337 | 337 | int whichfork); /* data or attr fork */ |
338 | 338 | |
339 | +#define XFS_BMAP_TRACE_DELETE(d,ip,i,c,w) \ | |
340 | + xfs_bmap_trace_delete(__FUNCTION__,d,ip,i,c,w) | |
341 | +#define XFS_BMAP_TRACE_INSERT(d,ip,i,c,r1,r2,w) \ | |
342 | + xfs_bmap_trace_insert(__FUNCTION__,d,ip,i,c,r1,r2,w) | |
343 | +#define XFS_BMAP_TRACE_POST_UPDATE(d,ip,i,w) \ | |
344 | + xfs_bmap_trace_post_update(__FUNCTION__,d,ip,i,w) | |
345 | +#define XFS_BMAP_TRACE_PRE_UPDATE(d,ip,i,w) \ | |
346 | + xfs_bmap_trace_pre_update(__FUNCTION__,d,ip,i,w) | |
339 | 347 | #else |
340 | -#define xfs_bmap_trace_delete(f,d,ip,i,c,w) | |
341 | -#define xfs_bmap_trace_insert(f,d,ip,i,c,r1,r2,w) | |
342 | -#define xfs_bmap_trace_post_update(f,d,ip,i,w) | |
343 | -#define xfs_bmap_trace_pre_update(f,d,ip,i,w) | |
348 | +#define XFS_BMAP_TRACE_DELETE(d,ip,i,c,w) | |
349 | +#define XFS_BMAP_TRACE_INSERT(d,ip,i,c,r1,r2,w) | |
350 | +#define XFS_BMAP_TRACE_POST_UPDATE(d,ip,i,w) | |
351 | +#define XFS_BMAP_TRACE_PRE_UPDATE(d,ip,i,w) | |
344 | 352 | #endif /* XFS_BMAP_TRACE */ |
345 | 353 | |
346 | 354 | /* |
... | ... | @@ -532,9 +540,6 @@ |
532 | 540 | xfs_filblks_t da_new; /* new count del alloc blocks used */ |
533 | 541 | xfs_filblks_t da_old; /* old count del alloc blocks used */ |
534 | 542 | int error; /* error return value */ |
535 | -#ifdef XFS_BMAP_TRACE | |
536 | - static char fname[] = "xfs_bmap_add_extent"; | |
537 | -#endif | |
538 | 543 | xfs_ifork_t *ifp; /* inode fork ptr */ |
539 | 544 | int logflags; /* returned value */ |
540 | 545 | xfs_extnum_t nextents; /* number of extents in file now */ |
... | ... | @@ -552,8 +557,8 @@ |
552 | 557 | * already extents in the list. |
553 | 558 | */ |
554 | 559 | if (nextents == 0) { |
555 | - xfs_bmap_trace_insert(fname, "insert empty", ip, 0, 1, new, | |
556 | - NULL, whichfork); | |
560 | + XFS_BMAP_TRACE_INSERT("insert empty", ip, 0, 1, new, NULL, | |
561 | + whichfork); | |
557 | 562 | xfs_iext_insert(ifp, 0, 1, new); |
558 | 563 | ASSERT(cur == NULL); |
559 | 564 | ifp->if_lastex = 0; |
... | ... | @@ -711,9 +716,6 @@ |
711 | 716 | int diff; /* temp value */ |
712 | 717 | xfs_bmbt_rec_t *ep; /* extent entry for idx */ |
713 | 718 | int error; /* error return value */ |
714 | -#ifdef XFS_BMAP_TRACE | |
715 | - static char fname[] = "xfs_bmap_add_extent_delay_real"; | |
716 | -#endif | |
717 | 719 | int i; /* temp state */ |
718 | 720 | xfs_ifork_t *ifp; /* inode fork pointer */ |
719 | 721 | xfs_fileoff_t new_endoff; /* end offset of new entry */ |
720 | 722 | |
721 | 723 | |
... | ... | @@ -809,15 +811,14 @@ |
809 | 811 | * Filling in all of a previously delayed allocation extent. |
810 | 812 | * The left and right neighbors are both contiguous with new. |
811 | 813 | */ |
812 | - xfs_bmap_trace_pre_update(fname, "LF|RF|LC|RC", ip, idx - 1, | |
814 | + XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|LC|RC", ip, idx - 1, | |
813 | 815 | XFS_DATA_FORK); |
814 | 816 | xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), |
815 | 817 | LEFT.br_blockcount + PREV.br_blockcount + |
816 | 818 | RIGHT.br_blockcount); |
817 | - xfs_bmap_trace_post_update(fname, "LF|RF|LC|RC", ip, idx - 1, | |
819 | + XFS_BMAP_TRACE_POST_UPDATE("LF|RF|LC|RC", ip, idx - 1, | |
818 | 820 | XFS_DATA_FORK); |
819 | - xfs_bmap_trace_delete(fname, "LF|RF|LC|RC", ip, idx, 2, | |
820 | - XFS_DATA_FORK); | |
821 | + XFS_BMAP_TRACE_DELETE("LF|RF|LC|RC", ip, idx, 2, XFS_DATA_FORK); | |
821 | 822 | xfs_iext_remove(ifp, idx, 2); |
822 | 823 | ip->i_df.if_lastex = idx - 1; |
823 | 824 | ip->i_d.di_nextents--; |
824 | 825 | |
825 | 826 | |
... | ... | @@ -856,15 +857,14 @@ |
856 | 857 | * Filling in all of a previously delayed allocation extent. |
857 | 858 | * The left neighbor is contiguous, the right is not. |
858 | 859 | */ |
859 | - xfs_bmap_trace_pre_update(fname, "LF|RF|LC", ip, idx - 1, | |
860 | + XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|LC", ip, idx - 1, | |
860 | 861 | XFS_DATA_FORK); |
861 | 862 | xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), |
862 | 863 | LEFT.br_blockcount + PREV.br_blockcount); |
863 | - xfs_bmap_trace_post_update(fname, "LF|RF|LC", ip, idx - 1, | |
864 | + XFS_BMAP_TRACE_POST_UPDATE("LF|RF|LC", ip, idx - 1, | |
864 | 865 | XFS_DATA_FORK); |
865 | 866 | ip->i_df.if_lastex = idx - 1; |
866 | - xfs_bmap_trace_delete(fname, "LF|RF|LC", ip, idx, 1, | |
867 | - XFS_DATA_FORK); | |
867 | + XFS_BMAP_TRACE_DELETE("LF|RF|LC", ip, idx, 1, XFS_DATA_FORK); | |
868 | 868 | xfs_iext_remove(ifp, idx, 1); |
869 | 869 | if (cur == NULL) |
870 | 870 | rval = XFS_ILOG_DEXT; |
871 | 871 | |
872 | 872 | |
... | ... | @@ -893,16 +893,13 @@ |
893 | 893 | * Filling in all of a previously delayed allocation extent. |
894 | 894 | * The right neighbor is contiguous, the left is not. |
895 | 895 | */ |
896 | - xfs_bmap_trace_pre_update(fname, "LF|RF|RC", ip, idx, | |
897 | - XFS_DATA_FORK); | |
896 | + XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|RC", ip, idx, XFS_DATA_FORK); | |
898 | 897 | xfs_bmbt_set_startblock(ep, new->br_startblock); |
899 | 898 | xfs_bmbt_set_blockcount(ep, |
900 | 899 | PREV.br_blockcount + RIGHT.br_blockcount); |
901 | - xfs_bmap_trace_post_update(fname, "LF|RF|RC", ip, idx, | |
902 | - XFS_DATA_FORK); | |
900 | + XFS_BMAP_TRACE_POST_UPDATE("LF|RF|RC", ip, idx, XFS_DATA_FORK); | |
903 | 901 | ip->i_df.if_lastex = idx; |
904 | - xfs_bmap_trace_delete(fname, "LF|RF|RC", ip, idx + 1, 1, | |
905 | - XFS_DATA_FORK); | |
902 | + XFS_BMAP_TRACE_DELETE("LF|RF|RC", ip, idx + 1, 1, XFS_DATA_FORK); | |
906 | 903 | xfs_iext_remove(ifp, idx + 1, 1); |
907 | 904 | if (cur == NULL) |
908 | 905 | rval = XFS_ILOG_DEXT; |
909 | 906 | |
... | ... | @@ -932,11 +929,9 @@ |
932 | 929 | * Neither the left nor right neighbors are contiguous with |
933 | 930 | * the new one. |
934 | 931 | */ |
935 | - xfs_bmap_trace_pre_update(fname, "LF|RF", ip, idx, | |
936 | - XFS_DATA_FORK); | |
932 | + XFS_BMAP_TRACE_PRE_UPDATE("LF|RF", ip, idx, XFS_DATA_FORK); | |
937 | 933 | xfs_bmbt_set_startblock(ep, new->br_startblock); |
938 | - xfs_bmap_trace_post_update(fname, "LF|RF", ip, idx, | |
939 | - XFS_DATA_FORK); | |
934 | + XFS_BMAP_TRACE_POST_UPDATE("LF|RF", ip, idx, XFS_DATA_FORK); | |
940 | 935 | ip->i_df.if_lastex = idx; |
941 | 936 | ip->i_d.di_nextents++; |
942 | 937 | if (cur == NULL) |
943 | 938 | |
944 | 939 | |
... | ... | @@ -964,17 +959,14 @@ |
964 | 959 | * Filling in the first part of a previous delayed allocation. |
965 | 960 | * The left neighbor is contiguous. |
966 | 961 | */ |
967 | - xfs_bmap_trace_pre_update(fname, "LF|LC", ip, idx - 1, | |
968 | - XFS_DATA_FORK); | |
962 | + XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx - 1, XFS_DATA_FORK); | |
969 | 963 | xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), |
970 | 964 | LEFT.br_blockcount + new->br_blockcount); |
971 | 965 | xfs_bmbt_set_startoff(ep, |
972 | 966 | PREV.br_startoff + new->br_blockcount); |
973 | - xfs_bmap_trace_post_update(fname, "LF|LC", ip, idx - 1, | |
974 | - XFS_DATA_FORK); | |
967 | + XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx - 1, XFS_DATA_FORK); | |
975 | 968 | temp = PREV.br_blockcount - new->br_blockcount; |
976 | - xfs_bmap_trace_pre_update(fname, "LF|LC", ip, idx, | |
977 | - XFS_DATA_FORK); | |
969 | + XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx, XFS_DATA_FORK); | |
978 | 970 | xfs_bmbt_set_blockcount(ep, temp); |
979 | 971 | ip->i_df.if_lastex = idx - 1; |
980 | 972 | if (cur == NULL) |
... | ... | @@ -996,8 +988,7 @@ |
996 | 988 | temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), |
997 | 989 | STARTBLOCKVAL(PREV.br_startblock)); |
998 | 990 | xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); |
999 | - xfs_bmap_trace_post_update(fname, "LF|LC", ip, idx, | |
1000 | - XFS_DATA_FORK); | |
991 | + XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx, XFS_DATA_FORK); | |
1001 | 992 | *dnew = temp; |
1002 | 993 | /* DELTA: The boundary between two in-core extents moved. */ |
1003 | 994 | temp = LEFT.br_startoff; |
1004 | 995 | |
... | ... | @@ -1010,11 +1001,11 @@ |
1010 | 1001 | * Filling in the first part of a previous delayed allocation. |
1011 | 1002 | * The left neighbor is not contiguous. |
1012 | 1003 | */ |
1013 | - xfs_bmap_trace_pre_update(fname, "LF", ip, idx, XFS_DATA_FORK); | |
1004 | + XFS_BMAP_TRACE_PRE_UPDATE("LF", ip, idx, XFS_DATA_FORK); | |
1014 | 1005 | xfs_bmbt_set_startoff(ep, new_endoff); |
1015 | 1006 | temp = PREV.br_blockcount - new->br_blockcount; |
1016 | 1007 | xfs_bmbt_set_blockcount(ep, temp); |
1017 | - xfs_bmap_trace_insert(fname, "LF", ip, idx, 1, new, NULL, | |
1008 | + XFS_BMAP_TRACE_INSERT("LF", ip, idx, 1, new, NULL, | |
1018 | 1009 | XFS_DATA_FORK); |
1019 | 1010 | xfs_iext_insert(ifp, idx, 1, new); |
1020 | 1011 | ip->i_df.if_lastex = idx; |
... | ... | @@ -1047,8 +1038,7 @@ |
1047 | 1038 | (cur ? cur->bc_private.b.allocated : 0)); |
1048 | 1039 | ep = xfs_iext_get_ext(ifp, idx + 1); |
1049 | 1040 | xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); |
1050 | - xfs_bmap_trace_post_update(fname, "LF", ip, idx + 1, | |
1051 | - XFS_DATA_FORK); | |
1041 | + XFS_BMAP_TRACE_POST_UPDATE("LF", ip, idx + 1, XFS_DATA_FORK); | |
1052 | 1042 | *dnew = temp; |
1053 | 1043 | /* DELTA: One in-core extent is split in two. */ |
1054 | 1044 | temp = PREV.br_startoff; |
1055 | 1045 | |
... | ... | @@ -1061,17 +1051,14 @@ |
1061 | 1051 | * The right neighbor is contiguous with the new allocation. |
1062 | 1052 | */ |
1063 | 1053 | temp = PREV.br_blockcount - new->br_blockcount; |
1064 | - xfs_bmap_trace_pre_update(fname, "RF|RC", ip, idx, | |
1065 | - XFS_DATA_FORK); | |
1066 | - xfs_bmap_trace_pre_update(fname, "RF|RC", ip, idx + 1, | |
1067 | - XFS_DATA_FORK); | |
1054 | + XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx, XFS_DATA_FORK); | |
1055 | + XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx + 1, XFS_DATA_FORK); | |
1068 | 1056 | xfs_bmbt_set_blockcount(ep, temp); |
1069 | 1057 | xfs_bmbt_set_allf(xfs_iext_get_ext(ifp, idx + 1), |
1070 | 1058 | new->br_startoff, new->br_startblock, |
1071 | 1059 | new->br_blockcount + RIGHT.br_blockcount, |
1072 | 1060 | RIGHT.br_state); |
1073 | - xfs_bmap_trace_post_update(fname, "RF|RC", ip, idx + 1, | |
1074 | - XFS_DATA_FORK); | |
1061 | + XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx + 1, XFS_DATA_FORK); | |
1075 | 1062 | ip->i_df.if_lastex = idx + 1; |
1076 | 1063 | if (cur == NULL) |
1077 | 1064 | rval = XFS_ILOG_DEXT; |
... | ... | @@ -1092,8 +1079,7 @@ |
1092 | 1079 | temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), |
1093 | 1080 | STARTBLOCKVAL(PREV.br_startblock)); |
1094 | 1081 | xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); |
1095 | - xfs_bmap_trace_post_update(fname, "RF|RC", ip, idx, | |
1096 | - XFS_DATA_FORK); | |
1082 | + XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx, XFS_DATA_FORK); | |
1097 | 1083 | *dnew = temp; |
1098 | 1084 | /* DELTA: The boundary between two in-core extents moved. */ |
1099 | 1085 | temp = PREV.br_startoff; |
1100 | 1086 | |
... | ... | @@ -1107,10 +1093,10 @@ |
1107 | 1093 | * The right neighbor is not contiguous. |
1108 | 1094 | */ |
1109 | 1095 | temp = PREV.br_blockcount - new->br_blockcount; |
1110 | - xfs_bmap_trace_pre_update(fname, "RF", ip, idx, XFS_DATA_FORK); | |
1096 | + XFS_BMAP_TRACE_PRE_UPDATE("RF", ip, idx, XFS_DATA_FORK); | |
1111 | 1097 | xfs_bmbt_set_blockcount(ep, temp); |
1112 | - xfs_bmap_trace_insert(fname, "RF", ip, idx + 1, 1, | |
1113 | - new, NULL, XFS_DATA_FORK); | |
1098 | + XFS_BMAP_TRACE_INSERT("RF", ip, idx + 1, 1, new, NULL, | |
1099 | + XFS_DATA_FORK); | |
1114 | 1100 | xfs_iext_insert(ifp, idx + 1, 1, new); |
1115 | 1101 | ip->i_df.if_lastex = idx + 1; |
1116 | 1102 | ip->i_d.di_nextents++; |
... | ... | @@ -1142,7 +1128,7 @@ |
1142 | 1128 | (cur ? cur->bc_private.b.allocated : 0)); |
1143 | 1129 | ep = xfs_iext_get_ext(ifp, idx); |
1144 | 1130 | xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); |
1145 | - xfs_bmap_trace_post_update(fname, "RF", ip, idx, XFS_DATA_FORK); | |
1131 | + XFS_BMAP_TRACE_POST_UPDATE("RF", ip, idx, XFS_DATA_FORK); | |
1146 | 1132 | *dnew = temp; |
1147 | 1133 | /* DELTA: One in-core extent is split in two. */ |
1148 | 1134 | temp = PREV.br_startoff; |
... | ... | @@ -1156,7 +1142,7 @@ |
1156 | 1142 | * This case is avoided almost all the time. |
1157 | 1143 | */ |
1158 | 1144 | temp = new->br_startoff - PREV.br_startoff; |
1159 | - xfs_bmap_trace_pre_update(fname, "0", ip, idx, XFS_DATA_FORK); | |
1145 | + XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx, XFS_DATA_FORK); | |
1160 | 1146 | xfs_bmbt_set_blockcount(ep, temp); |
1161 | 1147 | r[0] = *new; |
1162 | 1148 | r[1].br_state = PREV.br_state; |
... | ... | @@ -1164,7 +1150,7 @@ |
1164 | 1150 | r[1].br_startoff = new_endoff; |
1165 | 1151 | temp2 = PREV.br_startoff + PREV.br_blockcount - new_endoff; |
1166 | 1152 | r[1].br_blockcount = temp2; |
1167 | - xfs_bmap_trace_insert(fname, "0", ip, idx + 1, 2, &r[0], &r[1], | |
1153 | + XFS_BMAP_TRACE_INSERT("0", ip, idx + 1, 2, &r[0], &r[1], | |
1168 | 1154 | XFS_DATA_FORK); |
1169 | 1155 | xfs_iext_insert(ifp, idx + 1, 2, &r[0]); |
1170 | 1156 | ip->i_df.if_lastex = idx + 1; |
1171 | 1157 | |
... | ... | @@ -1223,13 +1209,11 @@ |
1223 | 1209 | } |
1224 | 1210 | ep = xfs_iext_get_ext(ifp, idx); |
1225 | 1211 | xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); |
1226 | - xfs_bmap_trace_post_update(fname, "0", ip, idx, XFS_DATA_FORK); | |
1227 | - xfs_bmap_trace_pre_update(fname, "0", ip, idx + 2, | |
1228 | - XFS_DATA_FORK); | |
1212 | + XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx, XFS_DATA_FORK); | |
1213 | + XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx + 2, XFS_DATA_FORK); | |
1229 | 1214 | xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx + 2), |
1230 | 1215 | NULLSTARTBLOCK((int)temp2)); |
1231 | - xfs_bmap_trace_post_update(fname, "0", ip, idx + 2, | |
1232 | - XFS_DATA_FORK); | |
1216 | + XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx + 2, XFS_DATA_FORK); | |
1233 | 1217 | *dnew = temp + temp2; |
1234 | 1218 | /* DELTA: One in-core extent is split in three. */ |
1235 | 1219 | temp = PREV.br_startoff; |
... | ... | @@ -1288,9 +1272,6 @@ |
1288 | 1272 | xfs_btree_cur_t *cur; /* btree cursor */ |
1289 | 1273 | xfs_bmbt_rec_t *ep; /* extent entry for idx */ |
1290 | 1274 | int error; /* error return value */ |
1291 | -#ifdef XFS_BMAP_TRACE | |
1292 | - static char fname[] = "xfs_bmap_add_extent_unwritten_real"; | |
1293 | -#endif | |
1294 | 1275 | int i; /* temp state */ |
1295 | 1276 | xfs_ifork_t *ifp; /* inode fork pointer */ |
1296 | 1277 | xfs_fileoff_t new_endoff; /* end offset of new entry */ |
1297 | 1278 | |
1298 | 1279 | |
... | ... | @@ -1391,15 +1372,14 @@ |
1391 | 1372 | * Setting all of a previous oldext extent to newext. |
1392 | 1373 | * The left and right neighbors are both contiguous with new. |
1393 | 1374 | */ |
1394 | - xfs_bmap_trace_pre_update(fname, "LF|RF|LC|RC", ip, idx - 1, | |
1375 | + XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|LC|RC", ip, idx - 1, | |
1395 | 1376 | XFS_DATA_FORK); |
1396 | 1377 | xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), |
1397 | 1378 | LEFT.br_blockcount + PREV.br_blockcount + |
1398 | 1379 | RIGHT.br_blockcount); |
1399 | - xfs_bmap_trace_post_update(fname, "LF|RF|LC|RC", ip, idx - 1, | |
1380 | + XFS_BMAP_TRACE_POST_UPDATE("LF|RF|LC|RC", ip, idx - 1, | |
1400 | 1381 | XFS_DATA_FORK); |
1401 | - xfs_bmap_trace_delete(fname, "LF|RF|LC|RC", ip, idx, 2, | |
1402 | - XFS_DATA_FORK); | |
1382 | + XFS_BMAP_TRACE_DELETE("LF|RF|LC|RC", ip, idx, 2, XFS_DATA_FORK); | |
1403 | 1383 | xfs_iext_remove(ifp, idx, 2); |
1404 | 1384 | ip->i_df.if_lastex = idx - 1; |
1405 | 1385 | ip->i_d.di_nextents -= 2; |
1406 | 1386 | |
1407 | 1387 | |
... | ... | @@ -1442,15 +1422,14 @@ |
1442 | 1422 | * Setting all of a previous oldext extent to newext. |
1443 | 1423 | * The left neighbor is contiguous, the right is not. |
1444 | 1424 | */ |
1445 | - xfs_bmap_trace_pre_update(fname, "LF|RF|LC", ip, idx - 1, | |
1425 | + XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|LC", ip, idx - 1, | |
1446 | 1426 | XFS_DATA_FORK); |
1447 | 1427 | xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), |
1448 | 1428 | LEFT.br_blockcount + PREV.br_blockcount); |
1449 | - xfs_bmap_trace_post_update(fname, "LF|RF|LC", ip, idx - 1, | |
1429 | + XFS_BMAP_TRACE_POST_UPDATE("LF|RF|LC", ip, idx - 1, | |
1450 | 1430 | XFS_DATA_FORK); |
1451 | 1431 | ip->i_df.if_lastex = idx - 1; |
1452 | - xfs_bmap_trace_delete(fname, "LF|RF|LC", ip, idx, 1, | |
1453 | - XFS_DATA_FORK); | |
1432 | + XFS_BMAP_TRACE_DELETE("LF|RF|LC", ip, idx, 1, XFS_DATA_FORK); | |
1454 | 1433 | xfs_iext_remove(ifp, idx, 1); |
1455 | 1434 | ip->i_d.di_nextents--; |
1456 | 1435 | if (cur == NULL) |
1457 | 1436 | |
1458 | 1437 | |
... | ... | @@ -1485,16 +1464,15 @@ |
1485 | 1464 | * Setting all of a previous oldext extent to newext. |
1486 | 1465 | * The right neighbor is contiguous, the left is not. |
1487 | 1466 | */ |
1488 | - xfs_bmap_trace_pre_update(fname, "LF|RF|RC", ip, idx, | |
1467 | + XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|RC", ip, idx, | |
1489 | 1468 | XFS_DATA_FORK); |
1490 | 1469 | xfs_bmbt_set_blockcount(ep, |
1491 | 1470 | PREV.br_blockcount + RIGHT.br_blockcount); |
1492 | 1471 | xfs_bmbt_set_state(ep, newext); |
1493 | - xfs_bmap_trace_post_update(fname, "LF|RF|RC", ip, idx, | |
1472 | + XFS_BMAP_TRACE_POST_UPDATE("LF|RF|RC", ip, idx, | |
1494 | 1473 | XFS_DATA_FORK); |
1495 | 1474 | ip->i_df.if_lastex = idx; |
1496 | - xfs_bmap_trace_delete(fname, "LF|RF|RC", ip, idx + 1, 1, | |
1497 | - XFS_DATA_FORK); | |
1475 | + XFS_BMAP_TRACE_DELETE("LF|RF|RC", ip, idx + 1, 1, XFS_DATA_FORK); | |
1498 | 1476 | xfs_iext_remove(ifp, idx + 1, 1); |
1499 | 1477 | ip->i_d.di_nextents--; |
1500 | 1478 | if (cur == NULL) |
1501 | 1479 | |
... | ... | @@ -1530,10 +1508,10 @@ |
1530 | 1508 | * Neither the left nor right neighbors are contiguous with |
1531 | 1509 | * the new one. |
1532 | 1510 | */ |
1533 | - xfs_bmap_trace_pre_update(fname, "LF|RF", ip, idx, | |
1511 | + XFS_BMAP_TRACE_PRE_UPDATE("LF|RF", ip, idx, | |
1534 | 1512 | XFS_DATA_FORK); |
1535 | 1513 | xfs_bmbt_set_state(ep, newext); |
1536 | - xfs_bmap_trace_post_update(fname, "LF|RF", ip, idx, | |
1514 | + XFS_BMAP_TRACE_POST_UPDATE("LF|RF", ip, idx, | |
1537 | 1515 | XFS_DATA_FORK); |
1538 | 1516 | ip->i_df.if_lastex = idx; |
1539 | 1517 | if (cur == NULL) |
1540 | 1518 | |
1541 | 1519 | |
1542 | 1520 | |
... | ... | @@ -1560,21 +1538,21 @@ |
1560 | 1538 | * Setting the first part of a previous oldext extent to newext. |
1561 | 1539 | * The left neighbor is contiguous. |
1562 | 1540 | */ |
1563 | - xfs_bmap_trace_pre_update(fname, "LF|LC", ip, idx - 1, | |
1541 | + XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx - 1, | |
1564 | 1542 | XFS_DATA_FORK); |
1565 | 1543 | xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), |
1566 | 1544 | LEFT.br_blockcount + new->br_blockcount); |
1567 | 1545 | xfs_bmbt_set_startoff(ep, |
1568 | 1546 | PREV.br_startoff + new->br_blockcount); |
1569 | - xfs_bmap_trace_post_update(fname, "LF|LC", ip, idx - 1, | |
1547 | + XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx - 1, | |
1570 | 1548 | XFS_DATA_FORK); |
1571 | - xfs_bmap_trace_pre_update(fname, "LF|LC", ip, idx, | |
1549 | + XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx, | |
1572 | 1550 | XFS_DATA_FORK); |
1573 | 1551 | xfs_bmbt_set_startblock(ep, |
1574 | 1552 | new->br_startblock + new->br_blockcount); |
1575 | 1553 | xfs_bmbt_set_blockcount(ep, |
1576 | 1554 | PREV.br_blockcount - new->br_blockcount); |
1577 | - xfs_bmap_trace_post_update(fname, "LF|LC", ip, idx, | |
1555 | + XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx, | |
1578 | 1556 | XFS_DATA_FORK); |
1579 | 1557 | ip->i_df.if_lastex = idx - 1; |
1580 | 1558 | if (cur == NULL) |
1581 | 1559 | |
... | ... | @@ -1611,15 +1589,15 @@ |
1611 | 1589 | * Setting the first part of a previous oldext extent to newext. |
1612 | 1590 | * The left neighbor is not contiguous. |
1613 | 1591 | */ |
1614 | - xfs_bmap_trace_pre_update(fname, "LF", ip, idx, XFS_DATA_FORK); | |
1592 | + XFS_BMAP_TRACE_PRE_UPDATE("LF", ip, idx, XFS_DATA_FORK); | |
1615 | 1593 | ASSERT(ep && xfs_bmbt_get_state(ep) == oldext); |
1616 | 1594 | xfs_bmbt_set_startoff(ep, new_endoff); |
1617 | 1595 | xfs_bmbt_set_blockcount(ep, |
1618 | 1596 | PREV.br_blockcount - new->br_blockcount); |
1619 | 1597 | xfs_bmbt_set_startblock(ep, |
1620 | 1598 | new->br_startblock + new->br_blockcount); |
1621 | - xfs_bmap_trace_post_update(fname, "LF", ip, idx, XFS_DATA_FORK); | |
1622 | - xfs_bmap_trace_insert(fname, "LF", ip, idx, 1, new, NULL, | |
1599 | + XFS_BMAP_TRACE_POST_UPDATE("LF", ip, idx, XFS_DATA_FORK); | |
1600 | + XFS_BMAP_TRACE_INSERT("LF", ip, idx, 1, new, NULL, | |
1623 | 1601 | XFS_DATA_FORK); |
1624 | 1602 | xfs_iext_insert(ifp, idx, 1, new); |
1625 | 1603 | ip->i_df.if_lastex = idx; |
1626 | 1604 | |
1627 | 1605 | |
1628 | 1606 | |
... | ... | @@ -1654,18 +1632,18 @@ |
1654 | 1632 | * Setting the last part of a previous oldext extent to newext. |
1655 | 1633 | * The right neighbor is contiguous with the new allocation. |
1656 | 1634 | */ |
1657 | - xfs_bmap_trace_pre_update(fname, "RF|RC", ip, idx, | |
1635 | + XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx, | |
1658 | 1636 | XFS_DATA_FORK); |
1659 | - xfs_bmap_trace_pre_update(fname, "RF|RC", ip, idx + 1, | |
1637 | + XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx + 1, | |
1660 | 1638 | XFS_DATA_FORK); |
1661 | 1639 | xfs_bmbt_set_blockcount(ep, |
1662 | 1640 | PREV.br_blockcount - new->br_blockcount); |
1663 | - xfs_bmap_trace_post_update(fname, "RF|RC", ip, idx, | |
1641 | + XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx, | |
1664 | 1642 | XFS_DATA_FORK); |
1665 | 1643 | xfs_bmbt_set_allf(xfs_iext_get_ext(ifp, idx + 1), |
1666 | 1644 | new->br_startoff, new->br_startblock, |
1667 | 1645 | new->br_blockcount + RIGHT.br_blockcount, newext); |
1668 | - xfs_bmap_trace_post_update(fname, "RF|RC", ip, idx + 1, | |
1646 | + XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx + 1, | |
1669 | 1647 | XFS_DATA_FORK); |
1670 | 1648 | ip->i_df.if_lastex = idx + 1; |
1671 | 1649 | if (cur == NULL) |
1672 | 1650 | |
... | ... | @@ -1701,12 +1679,12 @@ |
1701 | 1679 | * Setting the last part of a previous oldext extent to newext. |
1702 | 1680 | * The right neighbor is not contiguous. |
1703 | 1681 | */ |
1704 | - xfs_bmap_trace_pre_update(fname, "RF", ip, idx, XFS_DATA_FORK); | |
1682 | + XFS_BMAP_TRACE_PRE_UPDATE("RF", ip, idx, XFS_DATA_FORK); | |
1705 | 1683 | xfs_bmbt_set_blockcount(ep, |
1706 | 1684 | PREV.br_blockcount - new->br_blockcount); |
1707 | - xfs_bmap_trace_post_update(fname, "RF", ip, idx, XFS_DATA_FORK); | |
1708 | - xfs_bmap_trace_insert(fname, "RF", ip, idx + 1, 1, | |
1709 | - new, NULL, XFS_DATA_FORK); | |
1685 | + XFS_BMAP_TRACE_POST_UPDATE("RF", ip, idx, XFS_DATA_FORK); | |
1686 | + XFS_BMAP_TRACE_INSERT("RF", ip, idx + 1, 1, new, NULL, | |
1687 | + XFS_DATA_FORK); | |
1710 | 1688 | xfs_iext_insert(ifp, idx + 1, 1, new); |
1711 | 1689 | ip->i_df.if_lastex = idx + 1; |
1712 | 1690 | ip->i_d.di_nextents++; |
1713 | 1691 | |
1714 | 1692 | |
... | ... | @@ -1745,17 +1723,17 @@ |
1745 | 1723 | * newext. Contiguity is impossible here. |
1746 | 1724 | * One extent becomes three extents. |
1747 | 1725 | */ |
1748 | - xfs_bmap_trace_pre_update(fname, "0", ip, idx, XFS_DATA_FORK); | |
1726 | + XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx, XFS_DATA_FORK); | |
1749 | 1727 | xfs_bmbt_set_blockcount(ep, |
1750 | 1728 | new->br_startoff - PREV.br_startoff); |
1751 | - xfs_bmap_trace_post_update(fname, "0", ip, idx, XFS_DATA_FORK); | |
1729 | + XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx, XFS_DATA_FORK); | |
1752 | 1730 | r[0] = *new; |
1753 | 1731 | r[1].br_startoff = new_endoff; |
1754 | 1732 | r[1].br_blockcount = |
1755 | 1733 | PREV.br_startoff + PREV.br_blockcount - new_endoff; |
1756 | 1734 | r[1].br_startblock = new->br_startblock + new->br_blockcount; |
1757 | 1735 | r[1].br_state = oldext; |
1758 | - xfs_bmap_trace_insert(fname, "0", ip, idx + 1, 2, &r[0], &r[1], | |
1736 | + XFS_BMAP_TRACE_INSERT("0", ip, idx + 1, 2, &r[0], &r[1], | |
1759 | 1737 | XFS_DATA_FORK); |
1760 | 1738 | xfs_iext_insert(ifp, idx + 1, 2, &r[0]); |
1761 | 1739 | ip->i_df.if_lastex = idx + 1; |
... | ... | @@ -1846,9 +1824,6 @@ |
1846 | 1824 | int rsvd) /* OK to allocate reserved blocks */ |
1847 | 1825 | { |
1848 | 1826 | xfs_bmbt_rec_t *ep; /* extent record for idx */ |
1849 | -#ifdef XFS_BMAP_TRACE | |
1850 | - static char fname[] = "xfs_bmap_add_extent_hole_delay"; | |
1851 | -#endif | |
1852 | 1827 | xfs_ifork_t *ifp; /* inode fork pointer */ |
1853 | 1828 | xfs_bmbt_irec_t left; /* left neighbor extent entry */ |
1854 | 1829 | xfs_filblks_t newlen=0; /* new indirect size */ |
... | ... | @@ -1920,7 +1895,7 @@ |
1920 | 1895 | */ |
1921 | 1896 | temp = left.br_blockcount + new->br_blockcount + |
1922 | 1897 | right.br_blockcount; |
1923 | - xfs_bmap_trace_pre_update(fname, "LC|RC", ip, idx - 1, | |
1898 | + XFS_BMAP_TRACE_PRE_UPDATE("LC|RC", ip, idx - 1, | |
1924 | 1899 | XFS_DATA_FORK); |
1925 | 1900 | xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), temp); |
1926 | 1901 | oldlen = STARTBLOCKVAL(left.br_startblock) + |
1927 | 1902 | |
... | ... | @@ -1929,10 +1904,9 @@ |
1929 | 1904 | newlen = xfs_bmap_worst_indlen(ip, temp); |
1930 | 1905 | xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx - 1), |
1931 | 1906 | NULLSTARTBLOCK((int)newlen)); |
1932 | - xfs_bmap_trace_post_update(fname, "LC|RC", ip, idx - 1, | |
1907 | + XFS_BMAP_TRACE_POST_UPDATE("LC|RC", ip, idx - 1, | |
1933 | 1908 | XFS_DATA_FORK); |
1934 | - xfs_bmap_trace_delete(fname, "LC|RC", ip, idx, 1, | |
1935 | - XFS_DATA_FORK); | |
1909 | + XFS_BMAP_TRACE_DELETE("LC|RC", ip, idx, 1, XFS_DATA_FORK); | |
1936 | 1910 | xfs_iext_remove(ifp, idx, 1); |
1937 | 1911 | ip->i_df.if_lastex = idx - 1; |
1938 | 1912 | /* DELTA: Two in-core extents were replaced by one. */ |
... | ... | @@ -1947,7 +1921,7 @@ |
1947 | 1921 | * Merge the new allocation with the left neighbor. |
1948 | 1922 | */ |
1949 | 1923 | temp = left.br_blockcount + new->br_blockcount; |
1950 | - xfs_bmap_trace_pre_update(fname, "LC", ip, idx - 1, | |
1924 | + XFS_BMAP_TRACE_PRE_UPDATE("LC", ip, idx - 1, | |
1951 | 1925 | XFS_DATA_FORK); |
1952 | 1926 | xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), temp); |
1953 | 1927 | oldlen = STARTBLOCKVAL(left.br_startblock) + |
... | ... | @@ -1955,7 +1929,7 @@ |
1955 | 1929 | newlen = xfs_bmap_worst_indlen(ip, temp); |
1956 | 1930 | xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx - 1), |
1957 | 1931 | NULLSTARTBLOCK((int)newlen)); |
1958 | - xfs_bmap_trace_post_update(fname, "LC", ip, idx - 1, | |
1932 | + XFS_BMAP_TRACE_POST_UPDATE("LC", ip, idx - 1, | |
1959 | 1933 | XFS_DATA_FORK); |
1960 | 1934 | ip->i_df.if_lastex = idx - 1; |
1961 | 1935 | /* DELTA: One in-core extent grew into a hole. */ |
1962 | 1936 | |
... | ... | @@ -1969,14 +1943,14 @@ |
1969 | 1943 | * on the right. |
1970 | 1944 | * Merge the new allocation with the right neighbor. |
1971 | 1945 | */ |
1972 | - xfs_bmap_trace_pre_update(fname, "RC", ip, idx, XFS_DATA_FORK); | |
1946 | + XFS_BMAP_TRACE_PRE_UPDATE("RC", ip, idx, XFS_DATA_FORK); | |
1973 | 1947 | temp = new->br_blockcount + right.br_blockcount; |
1974 | 1948 | oldlen = STARTBLOCKVAL(new->br_startblock) + |
1975 | 1949 | STARTBLOCKVAL(right.br_startblock); |
1976 | 1950 | newlen = xfs_bmap_worst_indlen(ip, temp); |
1977 | 1951 | xfs_bmbt_set_allf(ep, new->br_startoff, |
1978 | 1952 | NULLSTARTBLOCK((int)newlen), temp, right.br_state); |
1979 | - xfs_bmap_trace_post_update(fname, "RC", ip, idx, XFS_DATA_FORK); | |
1953 | + XFS_BMAP_TRACE_POST_UPDATE("RC", ip, idx, XFS_DATA_FORK); | |
1980 | 1954 | ip->i_df.if_lastex = idx; |
1981 | 1955 | /* DELTA: One in-core extent grew into a hole. */ |
1982 | 1956 | temp2 = temp; |
... | ... | @@ -1990,7 +1964,7 @@ |
1990 | 1964 | * Insert a new entry. |
1991 | 1965 | */ |
1992 | 1966 | oldlen = newlen = 0; |
1993 | - xfs_bmap_trace_insert(fname, "0", ip, idx, 1, new, NULL, | |
1967 | + XFS_BMAP_TRACE_INSERT("0", ip, idx, 1, new, NULL, | |
1994 | 1968 | XFS_DATA_FORK); |
1995 | 1969 | xfs_iext_insert(ifp, idx, 1, new); |
1996 | 1970 | ip->i_df.if_lastex = idx; |
... | ... | @@ -2040,9 +2014,6 @@ |
2040 | 2014 | { |
2041 | 2015 | xfs_bmbt_rec_t *ep; /* pointer to extent entry ins. point */ |
2042 | 2016 | int error; /* error return value */ |
2043 | -#ifdef XFS_BMAP_TRACE | |
2044 | - static char fname[] = "xfs_bmap_add_extent_hole_real"; | |
2045 | -#endif | |
2046 | 2017 | int i; /* temp state */ |
2047 | 2018 | xfs_ifork_t *ifp; /* inode fork pointer */ |
2048 | 2019 | xfs_bmbt_irec_t left; /* left neighbor extent entry */ |
2049 | 2020 | |
2050 | 2021 | |
... | ... | @@ -2119,15 +2090,14 @@ |
2119 | 2090 | * left and on the right. |
2120 | 2091 | * Merge all three into a single extent record. |
2121 | 2092 | */ |
2122 | - xfs_bmap_trace_pre_update(fname, "LC|RC", ip, idx - 1, | |
2093 | + XFS_BMAP_TRACE_PRE_UPDATE("LC|RC", ip, idx - 1, | |
2123 | 2094 | whichfork); |
2124 | 2095 | xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), |
2125 | 2096 | left.br_blockcount + new->br_blockcount + |
2126 | 2097 | right.br_blockcount); |
2127 | - xfs_bmap_trace_post_update(fname, "LC|RC", ip, idx - 1, | |
2098 | + XFS_BMAP_TRACE_POST_UPDATE("LC|RC", ip, idx - 1, | |
2128 | 2099 | whichfork); |
2129 | - xfs_bmap_trace_delete(fname, "LC|RC", ip, | |
2130 | - idx, 1, whichfork); | |
2100 | + XFS_BMAP_TRACE_DELETE("LC|RC", ip, idx, 1, whichfork); | |
2131 | 2101 | xfs_iext_remove(ifp, idx, 1); |
2132 | 2102 | ifp->if_lastex = idx - 1; |
2133 | 2103 | XFS_IFORK_NEXT_SET(ip, whichfork, |
2134 | 2104 | |
... | ... | @@ -2169,10 +2139,10 @@ |
2169 | 2139 | * on the left. |
2170 | 2140 | * Merge the new allocation with the left neighbor. |
2171 | 2141 | */ |
2172 | - xfs_bmap_trace_pre_update(fname, "LC", ip, idx - 1, whichfork); | |
2142 | + XFS_BMAP_TRACE_PRE_UPDATE("LC", ip, idx - 1, whichfork); | |
2173 | 2143 | xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), |
2174 | 2144 | left.br_blockcount + new->br_blockcount); |
2175 | - xfs_bmap_trace_post_update(fname, "LC", ip, idx - 1, whichfork); | |
2145 | + XFS_BMAP_TRACE_POST_UPDATE("LC", ip, idx - 1, whichfork); | |
2176 | 2146 | ifp->if_lastex = idx - 1; |
2177 | 2147 | if (cur == NULL) { |
2178 | 2148 | rval = XFS_ILOG_FEXT(whichfork); |
2179 | 2149 | |
... | ... | @@ -2203,11 +2173,11 @@ |
2203 | 2173 | * on the right. |
2204 | 2174 | * Merge the new allocation with the right neighbor. |
2205 | 2175 | */ |
2206 | - xfs_bmap_trace_pre_update(fname, "RC", ip, idx, whichfork); | |
2176 | + XFS_BMAP_TRACE_PRE_UPDATE("RC", ip, idx, whichfork); | |
2207 | 2177 | xfs_bmbt_set_allf(ep, new->br_startoff, new->br_startblock, |
2208 | 2178 | new->br_blockcount + right.br_blockcount, |
2209 | 2179 | right.br_state); |
2210 | - xfs_bmap_trace_post_update(fname, "RC", ip, idx, whichfork); | |
2180 | + XFS_BMAP_TRACE_POST_UPDATE("RC", ip, idx, whichfork); | |
2211 | 2181 | ifp->if_lastex = idx; |
2212 | 2182 | if (cur == NULL) { |
2213 | 2183 | rval = XFS_ILOG_FEXT(whichfork); |
... | ... | @@ -2238,8 +2208,7 @@ |
2238 | 2208 | * real allocation. |
2239 | 2209 | * Insert a new entry. |
2240 | 2210 | */ |
2241 | - xfs_bmap_trace_insert(fname, "0", ip, idx, 1, new, NULL, | |
2242 | - whichfork); | |
2211 | + XFS_BMAP_TRACE_INSERT("0", ip, idx, 1, new, NULL, whichfork); | |
2243 | 2212 | xfs_iext_insert(ifp, idx, 1, new); |
2244 | 2213 | ifp->if_lastex = idx; |
2245 | 2214 | XFS_IFORK_NEXT_SET(ip, whichfork, |
... | ... | @@ -3104,9 +3073,6 @@ |
3104 | 3073 | xfs_bmbt_rec_t *ep; /* current extent entry pointer */ |
3105 | 3074 | int error; /* error return value */ |
3106 | 3075 | int flags; /* inode logging flags */ |
3107 | -#ifdef XFS_BMAP_TRACE | |
3108 | - static char fname[] = "xfs_bmap_del_extent"; | |
3109 | -#endif | |
3110 | 3076 | xfs_bmbt_irec_t got; /* current extent entry */ |
3111 | 3077 | xfs_fileoff_t got_endoff; /* first offset past got */ |
3112 | 3078 | int i; /* temp state */ |
... | ... | @@ -3200,7 +3166,7 @@ |
3200 | 3166 | /* |
3201 | 3167 | * Matches the whole extent. Delete the entry. |
3202 | 3168 | */ |
3203 | - xfs_bmap_trace_delete(fname, "3", ip, idx, 1, whichfork); | |
3169 | + XFS_BMAP_TRACE_DELETE("3", ip, idx, 1, whichfork); | |
3204 | 3170 | xfs_iext_remove(ifp, idx, 1); |
3205 | 3171 | ifp->if_lastex = idx; |
3206 | 3172 | if (delay) |
... | ... | @@ -3221,7 +3187,7 @@ |
3221 | 3187 | /* |
3222 | 3188 | * Deleting the first part of the extent. |
3223 | 3189 | */ |
3224 | - xfs_bmap_trace_pre_update(fname, "2", ip, idx, whichfork); | |
3190 | + XFS_BMAP_TRACE_PRE_UPDATE("2", ip, idx, whichfork); | |
3225 | 3191 | xfs_bmbt_set_startoff(ep, del_endoff); |
3226 | 3192 | temp = got.br_blockcount - del->br_blockcount; |
3227 | 3193 | xfs_bmbt_set_blockcount(ep, temp); |
3228 | 3194 | |
... | ... | @@ -3230,13 +3196,13 @@ |
3230 | 3196 | temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), |
3231 | 3197 | da_old); |
3232 | 3198 | xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); |
3233 | - xfs_bmap_trace_post_update(fname, "2", ip, idx, | |
3199 | + XFS_BMAP_TRACE_POST_UPDATE("2", ip, idx, | |
3234 | 3200 | whichfork); |
3235 | 3201 | da_new = temp; |
3236 | 3202 | break; |
3237 | 3203 | } |
3238 | 3204 | xfs_bmbt_set_startblock(ep, del_endblock); |
3239 | - xfs_bmap_trace_post_update(fname, "2", ip, idx, whichfork); | |
3205 | + XFS_BMAP_TRACE_POST_UPDATE("2", ip, idx, whichfork); | |
3240 | 3206 | if (!cur) { |
3241 | 3207 | flags |= XFS_ILOG_FEXT(whichfork); |
3242 | 3208 | break; |
3243 | 3209 | |
3244 | 3210 | |
... | ... | @@ -3252,19 +3218,19 @@ |
3252 | 3218 | * Deleting the last part of the extent. |
3253 | 3219 | */ |
3254 | 3220 | temp = got.br_blockcount - del->br_blockcount; |
3255 | - xfs_bmap_trace_pre_update(fname, "1", ip, idx, whichfork); | |
3221 | + XFS_BMAP_TRACE_PRE_UPDATE("1", ip, idx, whichfork); | |
3256 | 3222 | xfs_bmbt_set_blockcount(ep, temp); |
3257 | 3223 | ifp->if_lastex = idx; |
3258 | 3224 | if (delay) { |
3259 | 3225 | temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), |
3260 | 3226 | da_old); |
3261 | 3227 | xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); |
3262 | - xfs_bmap_trace_post_update(fname, "1", ip, idx, | |
3228 | + XFS_BMAP_TRACE_POST_UPDATE("1", ip, idx, | |
3263 | 3229 | whichfork); |
3264 | 3230 | da_new = temp; |
3265 | 3231 | break; |
3266 | 3232 | } |
3267 | - xfs_bmap_trace_post_update(fname, "1", ip, idx, whichfork); | |
3233 | + XFS_BMAP_TRACE_POST_UPDATE("1", ip, idx, whichfork); | |
3268 | 3234 | if (!cur) { |
3269 | 3235 | flags |= XFS_ILOG_FEXT(whichfork); |
3270 | 3236 | break; |
... | ... | @@ -3281,7 +3247,7 @@ |
3281 | 3247 | * Deleting the middle of the extent. |
3282 | 3248 | */ |
3283 | 3249 | temp = del->br_startoff - got.br_startoff; |
3284 | - xfs_bmap_trace_pre_update(fname, "0", ip, idx, whichfork); | |
3250 | + XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx, whichfork); | |
3285 | 3251 | xfs_bmbt_set_blockcount(ep, temp); |
3286 | 3252 | new.br_startoff = del_endoff; |
3287 | 3253 | temp2 = got_endoff - del_endoff; |
... | ... | @@ -3368,8 +3334,8 @@ |
3368 | 3334 | } |
3369 | 3335 | } |
3370 | 3336 | } |
3371 | - xfs_bmap_trace_post_update(fname, "0", ip, idx, whichfork); | |
3372 | - xfs_bmap_trace_insert(fname, "0", ip, idx + 1, 1, &new, NULL, | |
3337 | + XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx, whichfork); | |
3338 | + XFS_BMAP_TRACE_INSERT("0", ip, idx + 1, 1, &new, NULL, | |
3373 | 3339 | whichfork); |
3374 | 3340 | xfs_iext_insert(ifp, idx + 1, 1, &new); |
3375 | 3341 | ifp->if_lastex = idx + 1; |
... | ... | @@ -3609,9 +3575,6 @@ |
3609 | 3575 | { |
3610 | 3576 | int error; /* error return value */ |
3611 | 3577 | int flags; /* logging flags returned */ |
3612 | -#ifdef XFS_BMAP_TRACE | |
3613 | - static char fname[] = "xfs_bmap_local_to_extents"; | |
3614 | -#endif | |
3615 | 3578 | xfs_ifork_t *ifp; /* inode fork pointer */ |
3616 | 3579 | |
3617 | 3580 | /* |
... | ... | @@ -3666,7 +3629,7 @@ |
3666 | 3629 | xfs_iext_add(ifp, 0, 1); |
3667 | 3630 | ep = xfs_iext_get_ext(ifp, 0); |
3668 | 3631 | xfs_bmbt_set_allf(ep, 0, args.fsbno, 1, XFS_EXT_NORM); |
3669 | - xfs_bmap_trace_post_update(fname, "new", ip, 0, whichfork); | |
3632 | + XFS_BMAP_TRACE_POST_UPDATE("new", ip, 0, whichfork); | |
3670 | 3633 | XFS_IFORK_NEXT_SET(ip, whichfork, 1); |
3671 | 3634 | ip->i_d.di_nblocks = 1; |
3672 | 3635 | XFS_TRANS_MOD_DQUOT_BYINO(args.mp, tp, ip, |
... | ... | @@ -3789,7 +3752,7 @@ |
3789 | 3752 | STATIC void |
3790 | 3753 | xfs_bmap_trace_addentry( |
3791 | 3754 | int opcode, /* operation */ |
3792 | - char *fname, /* function name */ | |
3755 | + const char *fname, /* function name */ | |
3793 | 3756 | char *desc, /* operation description */ |
3794 | 3757 | xfs_inode_t *ip, /* incore inode pointer */ |
3795 | 3758 | xfs_extnum_t idx, /* index of entry(ies) */ |
... | ... | @@ -3848,7 +3811,7 @@ |
3848 | 3811 | */ |
3849 | 3812 | STATIC void |
3850 | 3813 | xfs_bmap_trace_delete( |
3851 | - char *fname, /* function name */ | |
3814 | + const char *fname, /* function name */ | |
3852 | 3815 | char *desc, /* operation description */ |
3853 | 3816 | xfs_inode_t *ip, /* incore inode pointer */ |
3854 | 3817 | xfs_extnum_t idx, /* index of entry(entries) deleted */ |
... | ... | @@ -3870,7 +3833,7 @@ |
3870 | 3833 | */ |
3871 | 3834 | STATIC void |
3872 | 3835 | xfs_bmap_trace_insert( |
3873 | - char *fname, /* function name */ | |
3836 | + const char *fname, /* function name */ | |
3874 | 3837 | char *desc, /* operation description */ |
3875 | 3838 | xfs_inode_t *ip, /* incore inode pointer */ |
3876 | 3839 | xfs_extnum_t idx, /* index of entry(entries) inserted */ |
... | ... | @@ -3899,7 +3862,7 @@ |
3899 | 3862 | */ |
3900 | 3863 | STATIC void |
3901 | 3864 | xfs_bmap_trace_post_update( |
3902 | - char *fname, /* function name */ | |
3865 | + const char *fname, /* function name */ | |
3903 | 3866 | char *desc, /* operation description */ |
3904 | 3867 | xfs_inode_t *ip, /* incore inode pointer */ |
3905 | 3868 | xfs_extnum_t idx, /* index of entry updated */ |
... | ... | @@ -3917,7 +3880,7 @@ |
3917 | 3880 | */ |
3918 | 3881 | STATIC void |
3919 | 3882 | xfs_bmap_trace_pre_update( |
3920 | - char *fname, /* function name */ | |
3883 | + const char *fname, /* function name */ | |
3921 | 3884 | char *desc, /* operation description */ |
3922 | 3885 | xfs_inode_t *ip, /* incore inode pointer */ |
3923 | 3886 | xfs_extnum_t idx, /* index of entry to be updated */ |
... | ... | @@ -4534,9 +4497,6 @@ |
4534 | 4497 | xfs_buf_t *bp; /* buffer for "block" */ |
4535 | 4498 | int error; /* error return value */ |
4536 | 4499 | xfs_exntfmt_t exntf; /* XFS_EXTFMT_NOSTATE, if checking */ |
4537 | -#ifdef XFS_BMAP_TRACE | |
4538 | - static char fname[] = "xfs_bmap_read_extents"; | |
4539 | -#endif | |
4540 | 4500 | xfs_extnum_t i, j; /* index into the extents list */ |
4541 | 4501 | xfs_ifork_t *ifp; /* fork structure */ |
4542 | 4502 | int level; /* btree level, for checking */ |
... | ... | @@ -4653,7 +4613,7 @@ |
4653 | 4613 | } |
4654 | 4614 | ASSERT(i == (ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t))); |
4655 | 4615 | ASSERT(i == XFS_IFORK_NEXTENTS(ip, whichfork)); |
4656 | - xfs_bmap_trace_exlist(fname, ip, i, whichfork); | |
4616 | + XFS_BMAP_TRACE_EXLIST(ip, i, whichfork); | |
4657 | 4617 | return 0; |
4658 | 4618 | error0: |
4659 | 4619 | xfs_trans_brelse(tp, bp); |
... | ... | @@ -4666,7 +4626,7 @@ |
4666 | 4626 | */ |
4667 | 4627 | void |
4668 | 4628 | xfs_bmap_trace_exlist( |
4669 | - char *fname, /* function name */ | |
4629 | + const char *fname, /* function name */ | |
4670 | 4630 | xfs_inode_t *ip, /* incore inode pointer */ |
4671 | 4631 | xfs_extnum_t cnt, /* count of entries in the list */ |
4672 | 4632 | int whichfork) /* data or attr fork */ |
... | ... | @@ -4681,7 +4641,7 @@ |
4681 | 4641 | for (idx = 0; idx < cnt; idx++) { |
4682 | 4642 | ep = xfs_iext_get_ext(ifp, idx); |
4683 | 4643 | xfs_bmbt_get_all(ep, &s); |
4684 | - xfs_bmap_trace_insert(fname, "exlist", ip, idx, 1, &s, NULL, | |
4644 | + XFS_BMAP_TRACE_INSERT("exlist", ip, idx, 1, &s, NULL, | |
4685 | 4645 | whichfork); |
4686 | 4646 | } |
4687 | 4647 | } |
fs/xfs/xfs_bmap.h
... | ... | @@ -144,12 +144,14 @@ |
144 | 144 | */ |
145 | 145 | void |
146 | 146 | xfs_bmap_trace_exlist( |
147 | - char *fname, /* function name */ | |
147 | + const char *fname, /* function name */ | |
148 | 148 | struct xfs_inode *ip, /* incore inode pointer */ |
149 | 149 | xfs_extnum_t cnt, /* count of entries in list */ |
150 | 150 | int whichfork); /* data or attr fork */ |
151 | +#define XFS_BMAP_TRACE_EXLIST(ip,c,w) \ | |
152 | + xfs_bmap_trace_exlist(__FUNCTION__,ip,c,w) | |
151 | 153 | #else |
152 | -#define xfs_bmap_trace_exlist(f,ip,c,w) | |
154 | +#define XFS_BMAP_TRACE_EXLIST(ip,c,w) | |
153 | 155 | #endif |
154 | 156 | |
155 | 157 | /* |
fs/xfs/xfs_bmap_btree.c
... | ... | @@ -76,7 +76,7 @@ |
76 | 76 | */ |
77 | 77 | STATIC void |
78 | 78 | xfs_bmbt_trace_enter( |
79 | - char *func, | |
79 | + const char *func, | |
80 | 80 | xfs_btree_cur_t *cur, |
81 | 81 | char *s, |
82 | 82 | int type, |
... | ... | @@ -117,7 +117,7 @@ |
117 | 117 | */ |
118 | 118 | STATIC void |
119 | 119 | xfs_bmbt_trace_argbi( |
120 | - char *func, | |
120 | + const char *func, | |
121 | 121 | xfs_btree_cur_t *cur, |
122 | 122 | xfs_buf_t *b, |
123 | 123 | int i, |
... | ... | @@ -134,7 +134,7 @@ |
134 | 134 | */ |
135 | 135 | STATIC void |
136 | 136 | xfs_bmbt_trace_argbii( |
137 | - char *func, | |
137 | + const char *func, | |
138 | 138 | xfs_btree_cur_t *cur, |
139 | 139 | xfs_buf_t *b, |
140 | 140 | int i0, |
... | ... | @@ -153,7 +153,7 @@ |
153 | 153 | */ |
154 | 154 | STATIC void |
155 | 155 | xfs_bmbt_trace_argfffi( |
156 | - char *func, | |
156 | + const char *func, | |
157 | 157 | xfs_btree_cur_t *cur, |
158 | 158 | xfs_dfiloff_t o, |
159 | 159 | xfs_dfsbno_t b, |
... | ... | @@ -172,7 +172,7 @@ |
172 | 172 | */ |
173 | 173 | STATIC void |
174 | 174 | xfs_bmbt_trace_argi( |
175 | - char *func, | |
175 | + const char *func, | |
176 | 176 | xfs_btree_cur_t *cur, |
177 | 177 | int i, |
178 | 178 | int line) |
... | ... | @@ -188,7 +188,7 @@ |
188 | 188 | */ |
189 | 189 | STATIC void |
190 | 190 | xfs_bmbt_trace_argifk( |
191 | - char *func, | |
191 | + const char *func, | |
192 | 192 | xfs_btree_cur_t *cur, |
193 | 193 | int i, |
194 | 194 | xfs_fsblock_t f, |
... | ... | @@ -206,7 +206,7 @@ |
206 | 206 | */ |
207 | 207 | STATIC void |
208 | 208 | xfs_bmbt_trace_argifr( |
209 | - char *func, | |
209 | + const char *func, | |
210 | 210 | xfs_btree_cur_t *cur, |
211 | 211 | int i, |
212 | 212 | xfs_fsblock_t f, |
... | ... | @@ -235,7 +235,7 @@ |
235 | 235 | */ |
236 | 236 | STATIC void |
237 | 237 | xfs_bmbt_trace_argik( |
238 | - char *func, | |
238 | + const char *func, | |
239 | 239 | xfs_btree_cur_t *cur, |
240 | 240 | int i, |
241 | 241 | xfs_bmbt_key_t *k, |
... | ... | @@ -255,7 +255,7 @@ |
255 | 255 | */ |
256 | 256 | STATIC void |
257 | 257 | xfs_bmbt_trace_cursor( |
258 | - char *func, | |
258 | + const char *func, | |
259 | 259 | xfs_btree_cur_t *cur, |
260 | 260 | char *s, |
261 | 261 | int line) |
262 | 262 | |
263 | 263 | |
264 | 264 | |
265 | 265 | |
266 | 266 | |
267 | 267 | |
268 | 268 | |
... | ... | @@ -274,21 +274,21 @@ |
274 | 274 | } |
275 | 275 | |
276 | 276 | #define XFS_BMBT_TRACE_ARGBI(c,b,i) \ |
277 | - xfs_bmbt_trace_argbi(fname, c, b, i, __LINE__) | |
277 | + xfs_bmbt_trace_argbi(__FUNCTION__, c, b, i, __LINE__) | |
278 | 278 | #define XFS_BMBT_TRACE_ARGBII(c,b,i,j) \ |
279 | - xfs_bmbt_trace_argbii(fname, c, b, i, j, __LINE__) | |
279 | + xfs_bmbt_trace_argbii(__FUNCTION__, c, b, i, j, __LINE__) | |
280 | 280 | #define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) \ |
281 | - xfs_bmbt_trace_argfffi(fname, c, o, b, i, j, __LINE__) | |
281 | + xfs_bmbt_trace_argfffi(__FUNCTION__, c, o, b, i, j, __LINE__) | |
282 | 282 | #define XFS_BMBT_TRACE_ARGI(c,i) \ |
283 | - xfs_bmbt_trace_argi(fname, c, i, __LINE__) | |
283 | + xfs_bmbt_trace_argi(__FUNCTION__, c, i, __LINE__) | |
284 | 284 | #define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) \ |
285 | - xfs_bmbt_trace_argifk(fname, c, i, f, s, __LINE__) | |
285 | + xfs_bmbt_trace_argifk(__FUNCTION__, c, i, f, s, __LINE__) | |
286 | 286 | #define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) \ |
287 | - xfs_bmbt_trace_argifr(fname, c, i, f, r, __LINE__) | |
287 | + xfs_bmbt_trace_argifr(__FUNCTION__, c, i, f, r, __LINE__) | |
288 | 288 | #define XFS_BMBT_TRACE_ARGIK(c,i,k) \ |
289 | - xfs_bmbt_trace_argik(fname, c, i, k, __LINE__) | |
289 | + xfs_bmbt_trace_argik(__FUNCTION__, c, i, k, __LINE__) | |
290 | 290 | #define XFS_BMBT_TRACE_CURSOR(c,s) \ |
291 | - xfs_bmbt_trace_cursor(fname, c, s, __LINE__) | |
291 | + xfs_bmbt_trace_cursor(__FUNCTION__, c, s, __LINE__) | |
292 | 292 | #else |
293 | 293 | #define XFS_BMBT_TRACE_ARGBI(c,b,i) |
294 | 294 | #define XFS_BMBT_TRACE_ARGBII(c,b,i,j) |
... | ... | @@ -318,9 +318,6 @@ |
318 | 318 | xfs_fsblock_t bno; /* fs-relative block number */ |
319 | 319 | xfs_buf_t *bp; /* buffer for block */ |
320 | 320 | int error; /* error return value */ |
321 | -#ifdef XFS_BMBT_TRACE | |
322 | - static char fname[] = "xfs_bmbt_delrec"; | |
323 | -#endif | |
324 | 321 | int i; /* loop counter */ |
325 | 322 | int j; /* temp state */ |
326 | 323 | xfs_bmbt_key_t key; /* bmap btree key */ |
... | ... | @@ -694,9 +691,6 @@ |
694 | 691 | xfs_bmbt_block_t *block; /* bmap btree block */ |
695 | 692 | xfs_buf_t *bp; /* buffer for block */ |
696 | 693 | int error; /* error return value */ |
697 | -#ifdef XFS_BMBT_TRACE | |
698 | - static char fname[] = "xfs_bmbt_insrec"; | |
699 | -#endif | |
700 | 694 | int i; /* loop index */ |
701 | 695 | xfs_bmbt_key_t key; /* bmap btree key */ |
702 | 696 | xfs_bmbt_key_t *kp=NULL; /* pointer to bmap btree key */ |
... | ... | @@ -881,9 +875,6 @@ |
881 | 875 | #ifdef DEBUG |
882 | 876 | int error; |
883 | 877 | #endif |
884 | -#ifdef XFS_BMBT_TRACE | |
885 | - static char fname[] = "xfs_bmbt_killroot"; | |
886 | -#endif | |
887 | 878 | int i; |
888 | 879 | xfs_bmbt_key_t *kp; |
889 | 880 | xfs_inode_t *ip; |
... | ... | @@ -973,9 +964,6 @@ |
973 | 964 | int kfirst, |
974 | 965 | int klast) |
975 | 966 | { |
976 | -#ifdef XFS_BMBT_TRACE | |
977 | - static char fname[] = "xfs_bmbt_log_keys"; | |
978 | -#endif | |
979 | 967 | xfs_trans_t *tp; |
980 | 968 | |
981 | 969 | XFS_BMBT_TRACE_CURSOR(cur, ENTRY); |
... | ... | @@ -1012,9 +1000,6 @@ |
1012 | 1000 | int pfirst, |
1013 | 1001 | int plast) |
1014 | 1002 | { |
1015 | -#ifdef XFS_BMBT_TRACE | |
1016 | - static char fname[] = "xfs_bmbt_log_ptrs"; | |
1017 | -#endif | |
1018 | 1003 | xfs_trans_t *tp; |
1019 | 1004 | |
1020 | 1005 | XFS_BMBT_TRACE_CURSOR(cur, ENTRY); |
... | ... | @@ -1055,9 +1040,6 @@ |
1055 | 1040 | xfs_daddr_t d; |
1056 | 1041 | xfs_sfiloff_t diff; |
1057 | 1042 | int error; /* error return value */ |
1058 | -#ifdef XFS_BMBT_TRACE | |
1059 | - static char fname[] = "xfs_bmbt_lookup"; | |
1060 | -#endif | |
1061 | 1043 | xfs_fsblock_t fsbno=0; |
1062 | 1044 | int high; |
1063 | 1045 | int i; |
... | ... | @@ -1195,9 +1177,6 @@ |
1195 | 1177 | int *stat) /* success/failure */ |
1196 | 1178 | { |
1197 | 1179 | int error; /* error return value */ |
1198 | -#ifdef XFS_BMBT_TRACE | |
1199 | - static char fname[] = "xfs_bmbt_lshift"; | |
1200 | -#endif | |
1201 | 1180 | #ifdef DEBUG |
1202 | 1181 | int i; /* loop counter */ |
1203 | 1182 | #endif |
... | ... | @@ -1331,9 +1310,6 @@ |
1331 | 1310 | int *stat) /* success/failure */ |
1332 | 1311 | { |
1333 | 1312 | int error; /* error return value */ |
1334 | -#ifdef XFS_BMBT_TRACE | |
1335 | - static char fname[] = "xfs_bmbt_rshift"; | |
1336 | -#endif | |
1337 | 1313 | int i; /* loop counter */ |
1338 | 1314 | xfs_bmbt_key_t key; /* bmap btree key */ |
1339 | 1315 | xfs_buf_t *lbp; /* left buffer pointer */ |
... | ... | @@ -1492,9 +1468,6 @@ |
1492 | 1468 | { |
1493 | 1469 | xfs_alloc_arg_t args; /* block allocation args */ |
1494 | 1470 | int error; /* error return value */ |
1495 | -#ifdef XFS_BMBT_TRACE | |
1496 | - static char fname[] = "xfs_bmbt_split"; | |
1497 | -#endif | |
1498 | 1471 | int i; /* loop counter */ |
1499 | 1472 | xfs_fsblock_t lbno; /* left sibling block number */ |
1500 | 1473 | xfs_buf_t *lbp; /* left buffer pointer */ |
... | ... | @@ -1641,9 +1614,6 @@ |
1641 | 1614 | #ifdef DEBUG |
1642 | 1615 | int error; |
1643 | 1616 | #endif |
1644 | -#ifdef XFS_BMBT_TRACE | |
1645 | - static char fname[] = "xfs_bmbt_updkey"; | |
1646 | -#endif | |
1647 | 1617 | xfs_bmbt_key_t *kp; |
1648 | 1618 | int ptr; |
1649 | 1619 | |
... | ... | @@ -1712,9 +1682,6 @@ |
1712 | 1682 | xfs_bmbt_block_t *block; |
1713 | 1683 | xfs_buf_t *bp; |
1714 | 1684 | int error; /* error return value */ |
1715 | -#ifdef XFS_BMBT_TRACE | |
1716 | - static char fname[] = "xfs_bmbt_decrement"; | |
1717 | -#endif | |
1718 | 1685 | xfs_fsblock_t fsbno; |
1719 | 1686 | int lev; |
1720 | 1687 | xfs_mount_t *mp; |
... | ... | @@ -1785,9 +1752,6 @@ |
1785 | 1752 | int *stat) /* success/failure */ |
1786 | 1753 | { |
1787 | 1754 | int error; /* error return value */ |
1788 | -#ifdef XFS_BMBT_TRACE | |
1789 | - static char fname[] = "xfs_bmbt_delete"; | |
1790 | -#endif | |
1791 | 1755 | int i; |
1792 | 1756 | int level; |
1793 | 1757 | |
... | ... | @@ -2000,9 +1964,6 @@ |
2000 | 1964 | xfs_bmbt_block_t *block; |
2001 | 1965 | xfs_buf_t *bp; |
2002 | 1966 | int error; /* error return value */ |
2003 | -#ifdef XFS_BMBT_TRACE | |
2004 | - static char fname[] = "xfs_bmbt_increment"; | |
2005 | -#endif | |
2006 | 1967 | xfs_fsblock_t fsbno; |
2007 | 1968 | int lev; |
2008 | 1969 | xfs_mount_t *mp; |
... | ... | @@ -2080,9 +2041,6 @@ |
2080 | 2041 | int *stat) /* success/failure */ |
2081 | 2042 | { |
2082 | 2043 | int error; /* error return value */ |
2083 | -#ifdef XFS_BMBT_TRACE | |
2084 | - static char fname[] = "xfs_bmbt_insert"; | |
2085 | -#endif | |
2086 | 2044 | int i; |
2087 | 2045 | int level; |
2088 | 2046 | xfs_fsblock_t nbno; |
... | ... | @@ -2142,9 +2100,6 @@ |
2142 | 2100 | int fields) |
2143 | 2101 | { |
2144 | 2102 | int first; |
2145 | -#ifdef XFS_BMBT_TRACE | |
2146 | - static char fname[] = "xfs_bmbt_log_block"; | |
2147 | -#endif | |
2148 | 2103 | int last; |
2149 | 2104 | xfs_trans_t *tp; |
2150 | 2105 | static const short offsets[] = { |
... | ... | @@ -2181,9 +2136,6 @@ |
2181 | 2136 | { |
2182 | 2137 | xfs_bmbt_block_t *block; |
2183 | 2138 | int first; |
2184 | -#ifdef XFS_BMBT_TRACE | |
2185 | - static char fname[] = "xfs_bmbt_log_recs"; | |
2186 | -#endif | |
2187 | 2139 | int last; |
2188 | 2140 | xfs_bmbt_rec_t *rp; |
2189 | 2141 | xfs_trans_t *tp; |
... | ... | @@ -2245,9 +2197,6 @@ |
2245 | 2197 | xfs_bmbt_key_t *ckp; /* child key pointer */ |
2246 | 2198 | xfs_bmbt_ptr_t *cpp; /* child ptr pointer */ |
2247 | 2199 | int error; /* error return code */ |
2248 | -#ifdef XFS_BMBT_TRACE | |
2249 | - static char fname[] = "xfs_bmbt_newroot"; | |
2250 | -#endif | |
2251 | 2200 | #ifdef DEBUG |
2252 | 2201 | int i; /* loop counter */ |
2253 | 2202 | #endif |
... | ... | @@ -2630,9 +2579,6 @@ |
2630 | 2579 | xfs_bmbt_block_t *block; |
2631 | 2580 | xfs_buf_t *bp; |
2632 | 2581 | int error; |
2633 | -#ifdef XFS_BMBT_TRACE | |
2634 | - static char fname[] = "xfs_bmbt_update"; | |
2635 | -#endif | |
2636 | 2582 | xfs_bmbt_key_t key; |
2637 | 2583 | int ptr; |
2638 | 2584 | xfs_bmbt_rec_t *rp; |
fs/xfs/xfs_inode.c
... | ... | @@ -645,8 +645,7 @@ |
645 | 645 | ep->l1 = INT_GET(get_unaligned((__uint64_t*)&dp->l1), |
646 | 646 | ARCH_CONVERT); |
647 | 647 | } |
648 | - xfs_bmap_trace_exlist("xfs_iformat_extents", ip, nex, | |
649 | - whichfork); | |
648 | + XFS_BMAP_TRACE_EXLIST(ip, nex, whichfork); | |
650 | 649 | if (whichfork != XFS_DATA_FORK || |
651 | 650 | XFS_EXTFMT_INODE(ip) == XFS_EXTFMT_NOSTATE) |
652 | 651 | if (unlikely(xfs_check_nostate_extents( |
... | ... | @@ -2894,9 +2893,6 @@ |
2894 | 2893 | int copied; |
2895 | 2894 | xfs_bmbt_rec_t *dest_ep; |
2896 | 2895 | xfs_bmbt_rec_t *ep; |
2897 | -#ifdef XFS_BMAP_TRACE | |
2898 | - static char fname[] = "xfs_iextents_copy"; | |
2899 | -#endif | |
2900 | 2896 | int i; |
2901 | 2897 | xfs_ifork_t *ifp; |
2902 | 2898 | int nrecs; |
... | ... | @@ -2907,7 +2903,7 @@ |
2907 | 2903 | ASSERT(ifp->if_bytes > 0); |
2908 | 2904 | |
2909 | 2905 | nrecs = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); |
2910 | - xfs_bmap_trace_exlist(fname, ip, nrecs, whichfork); | |
2906 | + XFS_BMAP_TRACE_EXLIST(ip, nrecs, whichfork); | |
2911 | 2907 | ASSERT(nrecs > 0); |
2912 | 2908 | |
2913 | 2909 | /* |