aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@sandeen.net>2007-07-10 21:09:47 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-07-14 01:41:24 -0400
commit3a59c94c4b48878c6af047cdfc8c137d0fa7a0f0 (patch)
tree6945590171040dfa6eba6335fd8312a9fbf0baf1 /fs/xfs/xfs_bmap.c
parentb11f94d537e6b69f13770143fd7ded3d09fdbaab (diff)
[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>
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r--fs/xfs/xfs_bmap.c268
1 files changed, 114 insertions, 154 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 51ba689a4552..94b5c5fe2681 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -278,7 +278,7 @@ xfs_bmap_isaeof(
278STATIC void 278STATIC void
279xfs_bmap_trace_addentry( 279xfs_bmap_trace_addentry(
280 int opcode, /* operation */ 280 int opcode, /* operation */
281 char *fname, /* function name */ 281 const char *fname, /* function name */
282 char *desc, /* operation description */ 282 char *desc, /* operation description */
283 xfs_inode_t *ip, /* incore inode pointer */ 283 xfs_inode_t *ip, /* incore inode pointer */
284 xfs_extnum_t idx, /* index of entry(ies) */ 284 xfs_extnum_t idx, /* index of entry(ies) */
@@ -292,7 +292,7 @@ xfs_bmap_trace_addentry(
292 */ 292 */
293STATIC void 293STATIC void
294xfs_bmap_trace_delete( 294xfs_bmap_trace_delete(
295 char *fname, /* function name */ 295 const char *fname, /* function name */
296 char *desc, /* operation description */ 296 char *desc, /* operation description */
297 xfs_inode_t *ip, /* incore inode pointer */ 297 xfs_inode_t *ip, /* incore inode pointer */
298 xfs_extnum_t idx, /* index of entry(entries) deleted */ 298 xfs_extnum_t idx, /* index of entry(entries) deleted */
@@ -305,7 +305,7 @@ xfs_bmap_trace_delete(
305 */ 305 */
306STATIC void 306STATIC void
307xfs_bmap_trace_insert( 307xfs_bmap_trace_insert(
308 char *fname, /* function name */ 308 const char *fname, /* function name */
309 char *desc, /* operation description */ 309 char *desc, /* operation description */
310 xfs_inode_t *ip, /* incore inode pointer */ 310 xfs_inode_t *ip, /* incore inode pointer */
311 xfs_extnum_t idx, /* index of entry(entries) inserted */ 311 xfs_extnum_t idx, /* index of entry(entries) inserted */
@@ -319,7 +319,7 @@ xfs_bmap_trace_insert(
319 */ 319 */
320STATIC void 320STATIC void
321xfs_bmap_trace_post_update( 321xfs_bmap_trace_post_update(
322 char *fname, /* function name */ 322 const char *fname, /* function name */
323 char *desc, /* operation description */ 323 char *desc, /* operation description */
324 xfs_inode_t *ip, /* incore inode pointer */ 324 xfs_inode_t *ip, /* incore inode pointer */
325 xfs_extnum_t idx, /* index of entry updated */ 325 xfs_extnum_t idx, /* index of entry updated */
@@ -330,17 +330,25 @@ xfs_bmap_trace_post_update(
330 */ 330 */
331STATIC void 331STATIC void
332xfs_bmap_trace_pre_update( 332xfs_bmap_trace_pre_update(
333 char *fname, /* function name */ 333 const char *fname, /* function name */
334 char *desc, /* operation description */ 334 char *desc, /* operation description */
335 xfs_inode_t *ip, /* incore inode pointer */ 335 xfs_inode_t *ip, /* incore inode pointer */
336 xfs_extnum_t idx, /* index of entry to be updated */ 336 xfs_extnum_t idx, /* index of entry to be updated */
337 int whichfork); /* data or attr fork */ 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#else 347#else
340#define xfs_bmap_trace_delete(f,d,ip,i,c,w) 348#define XFS_BMAP_TRACE_DELETE(d,ip,i,c,w)
341#define xfs_bmap_trace_insert(f,d,ip,i,c,r1,r2,w) 349#define XFS_BMAP_TRACE_INSERT(d,ip,i,c,r1,r2,w)
342#define xfs_bmap_trace_post_update(f,d,ip,i,w) 350#define XFS_BMAP_TRACE_POST_UPDATE(d,ip,i,w)
343#define xfs_bmap_trace_pre_update(f,d,ip,i,w) 351#define XFS_BMAP_TRACE_PRE_UPDATE(d,ip,i,w)
344#endif /* XFS_BMAP_TRACE */ 352#endif /* XFS_BMAP_TRACE */
345 353
346/* 354/*
@@ -532,9 +540,6 @@ xfs_bmap_add_extent(
532 xfs_filblks_t da_new; /* new count del alloc blocks used */ 540 xfs_filblks_t da_new; /* new count del alloc blocks used */
533 xfs_filblks_t da_old; /* old count del alloc blocks used */ 541 xfs_filblks_t da_old; /* old count del alloc blocks used */
534 int error; /* error return value */ 542 int error; /* error return value */
535#ifdef XFS_BMAP_TRACE
536 static char fname[] = "xfs_bmap_add_extent";
537#endif
538 xfs_ifork_t *ifp; /* inode fork ptr */ 543 xfs_ifork_t *ifp; /* inode fork ptr */
539 int logflags; /* returned value */ 544 int logflags; /* returned value */
540 xfs_extnum_t nextents; /* number of extents in file now */ 545 xfs_extnum_t nextents; /* number of extents in file now */
@@ -552,8 +557,8 @@ xfs_bmap_add_extent(
552 * already extents in the list. 557 * already extents in the list.
553 */ 558 */
554 if (nextents == 0) { 559 if (nextents == 0) {
555 xfs_bmap_trace_insert(fname, "insert empty", ip, 0, 1, new, 560 XFS_BMAP_TRACE_INSERT("insert empty", ip, 0, 1, new, NULL,
556 NULL, whichfork); 561 whichfork);
557 xfs_iext_insert(ifp, 0, 1, new); 562 xfs_iext_insert(ifp, 0, 1, new);
558 ASSERT(cur == NULL); 563 ASSERT(cur == NULL);
559 ifp->if_lastex = 0; 564 ifp->if_lastex = 0;
@@ -711,9 +716,6 @@ xfs_bmap_add_extent_delay_real(
711 int diff; /* temp value */ 716 int diff; /* temp value */
712 xfs_bmbt_rec_t *ep; /* extent entry for idx */ 717 xfs_bmbt_rec_t *ep; /* extent entry for idx */
713 int error; /* error return value */ 718 int error; /* error return value */
714#ifdef XFS_BMAP_TRACE
715 static char fname[] = "xfs_bmap_add_extent_delay_real";
716#endif
717 int i; /* temp state */ 719 int i; /* temp state */
718 xfs_ifork_t *ifp; /* inode fork pointer */ 720 xfs_ifork_t *ifp; /* inode fork pointer */
719 xfs_fileoff_t new_endoff; /* end offset of new entry */ 721 xfs_fileoff_t new_endoff; /* end offset of new entry */
@@ -809,15 +811,14 @@ xfs_bmap_add_extent_delay_real(
809 * Filling in all of a previously delayed allocation extent. 811 * Filling in all of a previously delayed allocation extent.
810 * The left and right neighbors are both contiguous with new. 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 XFS_DATA_FORK); 815 XFS_DATA_FORK);
814 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), 816 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
815 LEFT.br_blockcount + PREV.br_blockcount + 817 LEFT.br_blockcount + PREV.br_blockcount +
816 RIGHT.br_blockcount); 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 XFS_DATA_FORK);
819 xfs_bmap_trace_delete(fname, "LF|RF|LC|RC", ip, idx, 2,
820 XFS_DATA_FORK); 820 XFS_DATA_FORK);
821 XFS_BMAP_TRACE_DELETE("LF|RF|LC|RC", ip, idx, 2, XFS_DATA_FORK);
821 xfs_iext_remove(ifp, idx, 2); 822 xfs_iext_remove(ifp, idx, 2);
822 ip->i_df.if_lastex = idx - 1; 823 ip->i_df.if_lastex = idx - 1;
823 ip->i_d.di_nextents--; 824 ip->i_d.di_nextents--;
@@ -856,15 +857,14 @@ xfs_bmap_add_extent_delay_real(
856 * Filling in all of a previously delayed allocation extent. 857 * Filling in all of a previously delayed allocation extent.
857 * The left neighbor is contiguous, the right is not. 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 XFS_DATA_FORK); 861 XFS_DATA_FORK);
861 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), 862 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
862 LEFT.br_blockcount + PREV.br_blockcount); 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 XFS_DATA_FORK); 865 XFS_DATA_FORK);
865 ip->i_df.if_lastex = idx - 1; 866 ip->i_df.if_lastex = idx - 1;
866 xfs_bmap_trace_delete(fname, "LF|RF|LC", ip, idx, 1, 867 XFS_BMAP_TRACE_DELETE("LF|RF|LC", ip, idx, 1, XFS_DATA_FORK);
867 XFS_DATA_FORK);
868 xfs_iext_remove(ifp, idx, 1); 868 xfs_iext_remove(ifp, idx, 1);
869 if (cur == NULL) 869 if (cur == NULL)
870 rval = XFS_ILOG_DEXT; 870 rval = XFS_ILOG_DEXT;
@@ -893,16 +893,13 @@ xfs_bmap_add_extent_delay_real(
893 * Filling in all of a previously delayed allocation extent. 893 * Filling in all of a previously delayed allocation extent.
894 * The right neighbor is contiguous, the left is not. 894 * The right neighbor is contiguous, the left is not.
895 */ 895 */
896 xfs_bmap_trace_pre_update(fname, "LF|RF|RC", ip, idx, 896 XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|RC", ip, idx, XFS_DATA_FORK);
897 XFS_DATA_FORK);
898 xfs_bmbt_set_startblock(ep, new->br_startblock); 897 xfs_bmbt_set_startblock(ep, new->br_startblock);
899 xfs_bmbt_set_blockcount(ep, 898 xfs_bmbt_set_blockcount(ep,
900 PREV.br_blockcount + RIGHT.br_blockcount); 899 PREV.br_blockcount + RIGHT.br_blockcount);
901 xfs_bmap_trace_post_update(fname, "LF|RF|RC", ip, idx, 900 XFS_BMAP_TRACE_POST_UPDATE("LF|RF|RC", ip, idx, XFS_DATA_FORK);
902 XFS_DATA_FORK);
903 ip->i_df.if_lastex = idx; 901 ip->i_df.if_lastex = idx;
904 xfs_bmap_trace_delete(fname, "LF|RF|RC", ip, idx + 1, 1, 902 XFS_BMAP_TRACE_DELETE("LF|RF|RC", ip, idx + 1, 1, XFS_DATA_FORK);
905 XFS_DATA_FORK);
906 xfs_iext_remove(ifp, idx + 1, 1); 903 xfs_iext_remove(ifp, idx + 1, 1);
907 if (cur == NULL) 904 if (cur == NULL)
908 rval = XFS_ILOG_DEXT; 905 rval = XFS_ILOG_DEXT;
@@ -932,11 +929,9 @@ xfs_bmap_add_extent_delay_real(
932 * Neither the left nor right neighbors are contiguous with 929 * Neither the left nor right neighbors are contiguous with
933 * the new one. 930 * the new one.
934 */ 931 */
935 xfs_bmap_trace_pre_update(fname, "LF|RF", ip, idx, 932 XFS_BMAP_TRACE_PRE_UPDATE("LF|RF", ip, idx, XFS_DATA_FORK);
936 XFS_DATA_FORK);
937 xfs_bmbt_set_startblock(ep, new->br_startblock); 933 xfs_bmbt_set_startblock(ep, new->br_startblock);
938 xfs_bmap_trace_post_update(fname, "LF|RF", ip, idx, 934 XFS_BMAP_TRACE_POST_UPDATE("LF|RF", ip, idx, XFS_DATA_FORK);
939 XFS_DATA_FORK);
940 ip->i_df.if_lastex = idx; 935 ip->i_df.if_lastex = idx;
941 ip->i_d.di_nextents++; 936 ip->i_d.di_nextents++;
942 if (cur == NULL) 937 if (cur == NULL)
@@ -964,17 +959,14 @@ xfs_bmap_add_extent_delay_real(
964 * Filling in the first part of a previous delayed allocation. 959 * Filling in the first part of a previous delayed allocation.
965 * The left neighbor is contiguous. 960 * The left neighbor is contiguous.
966 */ 961 */
967 xfs_bmap_trace_pre_update(fname, "LF|LC", ip, idx - 1, 962 XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx - 1, XFS_DATA_FORK);
968 XFS_DATA_FORK);
969 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), 963 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
970 LEFT.br_blockcount + new->br_blockcount); 964 LEFT.br_blockcount + new->br_blockcount);
971 xfs_bmbt_set_startoff(ep, 965 xfs_bmbt_set_startoff(ep,
972 PREV.br_startoff + new->br_blockcount); 966 PREV.br_startoff + new->br_blockcount);
973 xfs_bmap_trace_post_update(fname, "LF|LC", ip, idx - 1, 967 XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx - 1, XFS_DATA_FORK);
974 XFS_DATA_FORK);
975 temp = PREV.br_blockcount - new->br_blockcount; 968 temp = PREV.br_blockcount - new->br_blockcount;
976 xfs_bmap_trace_pre_update(fname, "LF|LC", ip, idx, 969 XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx, XFS_DATA_FORK);
977 XFS_DATA_FORK);
978 xfs_bmbt_set_blockcount(ep, temp); 970 xfs_bmbt_set_blockcount(ep, temp);
979 ip->i_df.if_lastex = idx - 1; 971 ip->i_df.if_lastex = idx - 1;
980 if (cur == NULL) 972 if (cur == NULL)
@@ -996,8 +988,7 @@ xfs_bmap_add_extent_delay_real(
996 temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), 988 temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp),
997 STARTBLOCKVAL(PREV.br_startblock)); 989 STARTBLOCKVAL(PREV.br_startblock));
998 xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); 990 xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
999 xfs_bmap_trace_post_update(fname, "LF|LC", ip, idx, 991 XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx, XFS_DATA_FORK);
1000 XFS_DATA_FORK);
1001 *dnew = temp; 992 *dnew = temp;
1002 /* DELTA: The boundary between two in-core extents moved. */ 993 /* DELTA: The boundary between two in-core extents moved. */
1003 temp = LEFT.br_startoff; 994 temp = LEFT.br_startoff;
@@ -1010,11 +1001,11 @@ xfs_bmap_add_extent_delay_real(
1010 * Filling in the first part of a previous delayed allocation. 1001 * Filling in the first part of a previous delayed allocation.
1011 * The left neighbor is not contiguous. 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 xfs_bmbt_set_startoff(ep, new_endoff); 1005 xfs_bmbt_set_startoff(ep, new_endoff);
1015 temp = PREV.br_blockcount - new->br_blockcount; 1006 temp = PREV.br_blockcount - new->br_blockcount;
1016 xfs_bmbt_set_blockcount(ep, temp); 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 XFS_DATA_FORK); 1009 XFS_DATA_FORK);
1019 xfs_iext_insert(ifp, idx, 1, new); 1010 xfs_iext_insert(ifp, idx, 1, new);
1020 ip->i_df.if_lastex = idx; 1011 ip->i_df.if_lastex = idx;
@@ -1047,8 +1038,7 @@ xfs_bmap_add_extent_delay_real(
1047 (cur ? cur->bc_private.b.allocated : 0)); 1038 (cur ? cur->bc_private.b.allocated : 0));
1048 ep = xfs_iext_get_ext(ifp, idx + 1); 1039 ep = xfs_iext_get_ext(ifp, idx + 1);
1049 xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); 1040 xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
1050 xfs_bmap_trace_post_update(fname, "LF", ip, idx + 1, 1041 XFS_BMAP_TRACE_POST_UPDATE("LF", ip, idx + 1, XFS_DATA_FORK);
1051 XFS_DATA_FORK);
1052 *dnew = temp; 1042 *dnew = temp;
1053 /* DELTA: One in-core extent is split in two. */ 1043 /* DELTA: One in-core extent is split in two. */
1054 temp = PREV.br_startoff; 1044 temp = PREV.br_startoff;
@@ -1061,17 +1051,14 @@ xfs_bmap_add_extent_delay_real(
1061 * The right neighbor is contiguous with the new allocation. 1051 * The right neighbor is contiguous with the new allocation.
1062 */ 1052 */
1063 temp = PREV.br_blockcount - new->br_blockcount; 1053 temp = PREV.br_blockcount - new->br_blockcount;
1064 xfs_bmap_trace_pre_update(fname, "RF|RC", ip, idx, 1054 XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx, XFS_DATA_FORK);
1065 XFS_DATA_FORK); 1055 XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx + 1, XFS_DATA_FORK);
1066 xfs_bmap_trace_pre_update(fname, "RF|RC", ip, idx + 1,
1067 XFS_DATA_FORK);
1068 xfs_bmbt_set_blockcount(ep, temp); 1056 xfs_bmbt_set_blockcount(ep, temp);
1069 xfs_bmbt_set_allf(xfs_iext_get_ext(ifp, idx + 1), 1057 xfs_bmbt_set_allf(xfs_iext_get_ext(ifp, idx + 1),
1070 new->br_startoff, new->br_startblock, 1058 new->br_startoff, new->br_startblock,
1071 new->br_blockcount + RIGHT.br_blockcount, 1059 new->br_blockcount + RIGHT.br_blockcount,
1072 RIGHT.br_state); 1060 RIGHT.br_state);
1073 xfs_bmap_trace_post_update(fname, "RF|RC", ip, idx + 1, 1061 XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx + 1, XFS_DATA_FORK);
1074 XFS_DATA_FORK);
1075 ip->i_df.if_lastex = idx + 1; 1062 ip->i_df.if_lastex = idx + 1;
1076 if (cur == NULL) 1063 if (cur == NULL)
1077 rval = XFS_ILOG_DEXT; 1064 rval = XFS_ILOG_DEXT;
@@ -1092,8 +1079,7 @@ xfs_bmap_add_extent_delay_real(
1092 temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), 1079 temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp),
1093 STARTBLOCKVAL(PREV.br_startblock)); 1080 STARTBLOCKVAL(PREV.br_startblock));
1094 xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); 1081 xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
1095 xfs_bmap_trace_post_update(fname, "RF|RC", ip, idx, 1082 XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx, XFS_DATA_FORK);
1096 XFS_DATA_FORK);
1097 *dnew = temp; 1083 *dnew = temp;
1098 /* DELTA: The boundary between two in-core extents moved. */ 1084 /* DELTA: The boundary between two in-core extents moved. */
1099 temp = PREV.br_startoff; 1085 temp = PREV.br_startoff;
@@ -1107,10 +1093,10 @@ xfs_bmap_add_extent_delay_real(
1107 * The right neighbor is not contiguous. 1093 * The right neighbor is not contiguous.
1108 */ 1094 */
1109 temp = PREV.br_blockcount - new->br_blockcount; 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 xfs_bmbt_set_blockcount(ep, temp); 1097 xfs_bmbt_set_blockcount(ep, temp);
1112 xfs_bmap_trace_insert(fname, "RF", ip, idx + 1, 1, 1098 XFS_BMAP_TRACE_INSERT("RF", ip, idx + 1, 1, new, NULL,
1113 new, NULL, XFS_DATA_FORK); 1099 XFS_DATA_FORK);
1114 xfs_iext_insert(ifp, idx + 1, 1, new); 1100 xfs_iext_insert(ifp, idx + 1, 1, new);
1115 ip->i_df.if_lastex = idx + 1; 1101 ip->i_df.if_lastex = idx + 1;
1116 ip->i_d.di_nextents++; 1102 ip->i_d.di_nextents++;
@@ -1142,7 +1128,7 @@ xfs_bmap_add_extent_delay_real(
1142 (cur ? cur->bc_private.b.allocated : 0)); 1128 (cur ? cur->bc_private.b.allocated : 0));
1143 ep = xfs_iext_get_ext(ifp, idx); 1129 ep = xfs_iext_get_ext(ifp, idx);
1144 xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); 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 *dnew = temp; 1132 *dnew = temp;
1147 /* DELTA: One in-core extent is split in two. */ 1133 /* DELTA: One in-core extent is split in two. */
1148 temp = PREV.br_startoff; 1134 temp = PREV.br_startoff;
@@ -1156,7 +1142,7 @@ xfs_bmap_add_extent_delay_real(
1156 * This case is avoided almost all the time. 1142 * This case is avoided almost all the time.
1157 */ 1143 */
1158 temp = new->br_startoff - PREV.br_startoff; 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 xfs_bmbt_set_blockcount(ep, temp); 1146 xfs_bmbt_set_blockcount(ep, temp);
1161 r[0] = *new; 1147 r[0] = *new;
1162 r[1].br_state = PREV.br_state; 1148 r[1].br_state = PREV.br_state;
@@ -1164,7 +1150,7 @@ xfs_bmap_add_extent_delay_real(
1164 r[1].br_startoff = new_endoff; 1150 r[1].br_startoff = new_endoff;
1165 temp2 = PREV.br_startoff + PREV.br_blockcount - new_endoff; 1151 temp2 = PREV.br_startoff + PREV.br_blockcount - new_endoff;
1166 r[1].br_blockcount = temp2; 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 XFS_DATA_FORK); 1154 XFS_DATA_FORK);
1169 xfs_iext_insert(ifp, idx + 1, 2, &r[0]); 1155 xfs_iext_insert(ifp, idx + 1, 2, &r[0]);
1170 ip->i_df.if_lastex = idx + 1; 1156 ip->i_df.if_lastex = idx + 1;
@@ -1223,13 +1209,11 @@ xfs_bmap_add_extent_delay_real(
1223 } 1209 }
1224 ep = xfs_iext_get_ext(ifp, idx); 1210 ep = xfs_iext_get_ext(ifp, idx);
1225 xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); 1211 xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
1226 xfs_bmap_trace_post_update(fname, "0", ip, idx, XFS_DATA_FORK); 1212 XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx, XFS_DATA_FORK);
1227 xfs_bmap_trace_pre_update(fname, "0", ip, idx + 2, 1213 XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx + 2, XFS_DATA_FORK);
1228 XFS_DATA_FORK);
1229 xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx + 2), 1214 xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx + 2),
1230 NULLSTARTBLOCK((int)temp2)); 1215 NULLSTARTBLOCK((int)temp2));
1231 xfs_bmap_trace_post_update(fname, "0", ip, idx + 2, 1216 XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx + 2, XFS_DATA_FORK);
1232 XFS_DATA_FORK);
1233 *dnew = temp + temp2; 1217 *dnew = temp + temp2;
1234 /* DELTA: One in-core extent is split in three. */ 1218 /* DELTA: One in-core extent is split in three. */
1235 temp = PREV.br_startoff; 1219 temp = PREV.br_startoff;
@@ -1288,9 +1272,6 @@ xfs_bmap_add_extent_unwritten_real(
1288 xfs_btree_cur_t *cur; /* btree cursor */ 1272 xfs_btree_cur_t *cur; /* btree cursor */
1289 xfs_bmbt_rec_t *ep; /* extent entry for idx */ 1273 xfs_bmbt_rec_t *ep; /* extent entry for idx */
1290 int error; /* error return value */ 1274 int error; /* error return value */
1291#ifdef XFS_BMAP_TRACE
1292 static char fname[] = "xfs_bmap_add_extent_unwritten_real";
1293#endif
1294 int i; /* temp state */ 1275 int i; /* temp state */
1295 xfs_ifork_t *ifp; /* inode fork pointer */ 1276 xfs_ifork_t *ifp; /* inode fork pointer */
1296 xfs_fileoff_t new_endoff; /* end offset of new entry */ 1277 xfs_fileoff_t new_endoff; /* end offset of new entry */
@@ -1391,15 +1372,14 @@ xfs_bmap_add_extent_unwritten_real(
1391 * Setting all of a previous oldext extent to newext. 1372 * Setting all of a previous oldext extent to newext.
1392 * The left and right neighbors are both contiguous with new. 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 XFS_DATA_FORK); 1376 XFS_DATA_FORK);
1396 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), 1377 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
1397 LEFT.br_blockcount + PREV.br_blockcount + 1378 LEFT.br_blockcount + PREV.br_blockcount +
1398 RIGHT.br_blockcount); 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 XFS_DATA_FORK);
1401 xfs_bmap_trace_delete(fname, "LF|RF|LC|RC", ip, idx, 2,
1402 XFS_DATA_FORK); 1381 XFS_DATA_FORK);
1382 XFS_BMAP_TRACE_DELETE("LF|RF|LC|RC", ip, idx, 2, XFS_DATA_FORK);
1403 xfs_iext_remove(ifp, idx, 2); 1383 xfs_iext_remove(ifp, idx, 2);
1404 ip->i_df.if_lastex = idx - 1; 1384 ip->i_df.if_lastex = idx - 1;
1405 ip->i_d.di_nextents -= 2; 1385 ip->i_d.di_nextents -= 2;
@@ -1442,15 +1422,14 @@ xfs_bmap_add_extent_unwritten_real(
1442 * Setting all of a previous oldext extent to newext. 1422 * Setting all of a previous oldext extent to newext.
1443 * The left neighbor is contiguous, the right is not. 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 XFS_DATA_FORK); 1426 XFS_DATA_FORK);
1447 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), 1427 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
1448 LEFT.br_blockcount + PREV.br_blockcount); 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 XFS_DATA_FORK); 1430 XFS_DATA_FORK);
1451 ip->i_df.if_lastex = idx - 1; 1431 ip->i_df.if_lastex = idx - 1;
1452 xfs_bmap_trace_delete(fname, "LF|RF|LC", ip, idx, 1, 1432 XFS_BMAP_TRACE_DELETE("LF|RF|LC", ip, idx, 1, XFS_DATA_FORK);
1453 XFS_DATA_FORK);
1454 xfs_iext_remove(ifp, idx, 1); 1433 xfs_iext_remove(ifp, idx, 1);
1455 ip->i_d.di_nextents--; 1434 ip->i_d.di_nextents--;
1456 if (cur == NULL) 1435 if (cur == NULL)
@@ -1485,16 +1464,15 @@ xfs_bmap_add_extent_unwritten_real(
1485 * Setting all of a previous oldext extent to newext. 1464 * Setting all of a previous oldext extent to newext.
1486 * The right neighbor is contiguous, the left is not. 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 XFS_DATA_FORK); 1468 XFS_DATA_FORK);
1490 xfs_bmbt_set_blockcount(ep, 1469 xfs_bmbt_set_blockcount(ep,
1491 PREV.br_blockcount + RIGHT.br_blockcount); 1470 PREV.br_blockcount + RIGHT.br_blockcount);
1492 xfs_bmbt_set_state(ep, newext); 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 XFS_DATA_FORK); 1473 XFS_DATA_FORK);
1495 ip->i_df.if_lastex = idx; 1474 ip->i_df.if_lastex = idx;
1496 xfs_bmap_trace_delete(fname, "LF|RF|RC", ip, idx + 1, 1, 1475 XFS_BMAP_TRACE_DELETE("LF|RF|RC", ip, idx + 1, 1, XFS_DATA_FORK);
1497 XFS_DATA_FORK);
1498 xfs_iext_remove(ifp, idx + 1, 1); 1476 xfs_iext_remove(ifp, idx + 1, 1);
1499 ip->i_d.di_nextents--; 1477 ip->i_d.di_nextents--;
1500 if (cur == NULL) 1478 if (cur == NULL)
@@ -1530,10 +1508,10 @@ xfs_bmap_add_extent_unwritten_real(
1530 * Neither the left nor right neighbors are contiguous with 1508 * Neither the left nor right neighbors are contiguous with
1531 * the new one. 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 XFS_DATA_FORK); 1512 XFS_DATA_FORK);
1535 xfs_bmbt_set_state(ep, newext); 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 XFS_DATA_FORK); 1515 XFS_DATA_FORK);
1538 ip->i_df.if_lastex = idx; 1516 ip->i_df.if_lastex = idx;
1539 if (cur == NULL) 1517 if (cur == NULL)
@@ -1560,21 +1538,21 @@ xfs_bmap_add_extent_unwritten_real(
1560 * Setting the first part of a previous oldext extent to newext. 1538 * Setting the first part of a previous oldext extent to newext.
1561 * The left neighbor is contiguous. 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 XFS_DATA_FORK); 1542 XFS_DATA_FORK);
1565 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), 1543 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
1566 LEFT.br_blockcount + new->br_blockcount); 1544 LEFT.br_blockcount + new->br_blockcount);
1567 xfs_bmbt_set_startoff(ep, 1545 xfs_bmbt_set_startoff(ep,
1568 PREV.br_startoff + new->br_blockcount); 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 XFS_DATA_FORK); 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 XFS_DATA_FORK); 1550 XFS_DATA_FORK);
1573 xfs_bmbt_set_startblock(ep, 1551 xfs_bmbt_set_startblock(ep,
1574 new->br_startblock + new->br_blockcount); 1552 new->br_startblock + new->br_blockcount);
1575 xfs_bmbt_set_blockcount(ep, 1553 xfs_bmbt_set_blockcount(ep,
1576 PREV.br_blockcount - new->br_blockcount); 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 XFS_DATA_FORK); 1556 XFS_DATA_FORK);
1579 ip->i_df.if_lastex = idx - 1; 1557 ip->i_df.if_lastex = idx - 1;
1580 if (cur == NULL) 1558 if (cur == NULL)
@@ -1611,15 +1589,15 @@ xfs_bmap_add_extent_unwritten_real(
1611 * Setting the first part of a previous oldext extent to newext. 1589 * Setting the first part of a previous oldext extent to newext.
1612 * The left neighbor is not contiguous. 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 ASSERT(ep && xfs_bmbt_get_state(ep) == oldext); 1593 ASSERT(ep && xfs_bmbt_get_state(ep) == oldext);
1616 xfs_bmbt_set_startoff(ep, new_endoff); 1594 xfs_bmbt_set_startoff(ep, new_endoff);
1617 xfs_bmbt_set_blockcount(ep, 1595 xfs_bmbt_set_blockcount(ep,
1618 PREV.br_blockcount - new->br_blockcount); 1596 PREV.br_blockcount - new->br_blockcount);
1619 xfs_bmbt_set_startblock(ep, 1597 xfs_bmbt_set_startblock(ep,
1620 new->br_startblock + new->br_blockcount); 1598 new->br_startblock + new->br_blockcount);
1621 xfs_bmap_trace_post_update(fname, "LF", ip, idx, XFS_DATA_FORK); 1599 XFS_BMAP_TRACE_POST_UPDATE("LF", ip, idx, XFS_DATA_FORK);
1622 xfs_bmap_trace_insert(fname, "LF", ip, idx, 1, new, NULL, 1600 XFS_BMAP_TRACE_INSERT("LF", ip, idx, 1, new, NULL,
1623 XFS_DATA_FORK); 1601 XFS_DATA_FORK);
1624 xfs_iext_insert(ifp, idx, 1, new); 1602 xfs_iext_insert(ifp, idx, 1, new);
1625 ip->i_df.if_lastex = idx; 1603 ip->i_df.if_lastex = idx;
@@ -1654,18 +1632,18 @@ xfs_bmap_add_extent_unwritten_real(
1654 * Setting the last part of a previous oldext extent to newext. 1632 * Setting the last part of a previous oldext extent to newext.
1655 * The right neighbor is contiguous with the new allocation. 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 XFS_DATA_FORK); 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 XFS_DATA_FORK); 1638 XFS_DATA_FORK);
1661 xfs_bmbt_set_blockcount(ep, 1639 xfs_bmbt_set_blockcount(ep,
1662 PREV.br_blockcount - new->br_blockcount); 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 XFS_DATA_FORK); 1642 XFS_DATA_FORK);
1665 xfs_bmbt_set_allf(xfs_iext_get_ext(ifp, idx + 1), 1643 xfs_bmbt_set_allf(xfs_iext_get_ext(ifp, idx + 1),
1666 new->br_startoff, new->br_startblock, 1644 new->br_startoff, new->br_startblock,
1667 new->br_blockcount + RIGHT.br_blockcount, newext); 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 XFS_DATA_FORK); 1647 XFS_DATA_FORK);
1670 ip->i_df.if_lastex = idx + 1; 1648 ip->i_df.if_lastex = idx + 1;
1671 if (cur == NULL) 1649 if (cur == NULL)
@@ -1701,12 +1679,12 @@ xfs_bmap_add_extent_unwritten_real(
1701 * Setting the last part of a previous oldext extent to newext. 1679 * Setting the last part of a previous oldext extent to newext.
1702 * The right neighbor is not contiguous. 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 xfs_bmbt_set_blockcount(ep, 1683 xfs_bmbt_set_blockcount(ep,
1706 PREV.br_blockcount - new->br_blockcount); 1684 PREV.br_blockcount - new->br_blockcount);
1707 xfs_bmap_trace_post_update(fname, "RF", ip, idx, XFS_DATA_FORK); 1685 XFS_BMAP_TRACE_POST_UPDATE("RF", ip, idx, XFS_DATA_FORK);
1708 xfs_bmap_trace_insert(fname, "RF", ip, idx + 1, 1, 1686 XFS_BMAP_TRACE_INSERT("RF", ip, idx + 1, 1, new, NULL,
1709 new, NULL, XFS_DATA_FORK); 1687 XFS_DATA_FORK);
1710 xfs_iext_insert(ifp, idx + 1, 1, new); 1688 xfs_iext_insert(ifp, idx + 1, 1, new);
1711 ip->i_df.if_lastex = idx + 1; 1689 ip->i_df.if_lastex = idx + 1;
1712 ip->i_d.di_nextents++; 1690 ip->i_d.di_nextents++;
@@ -1745,17 +1723,17 @@ xfs_bmap_add_extent_unwritten_real(
1745 * newext. Contiguity is impossible here. 1723 * newext. Contiguity is impossible here.
1746 * One extent becomes three extents. 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 xfs_bmbt_set_blockcount(ep, 1727 xfs_bmbt_set_blockcount(ep,
1750 new->br_startoff - PREV.br_startoff); 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 r[0] = *new; 1730 r[0] = *new;
1753 r[1].br_startoff = new_endoff; 1731 r[1].br_startoff = new_endoff;
1754 r[1].br_blockcount = 1732 r[1].br_blockcount =
1755 PREV.br_startoff + PREV.br_blockcount - new_endoff; 1733 PREV.br_startoff + PREV.br_blockcount - new_endoff;
1756 r[1].br_startblock = new->br_startblock + new->br_blockcount; 1734 r[1].br_startblock = new->br_startblock + new->br_blockcount;
1757 r[1].br_state = oldext; 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 XFS_DATA_FORK); 1737 XFS_DATA_FORK);
1760 xfs_iext_insert(ifp, idx + 1, 2, &r[0]); 1738 xfs_iext_insert(ifp, idx + 1, 2, &r[0]);
1761 ip->i_df.if_lastex = idx + 1; 1739 ip->i_df.if_lastex = idx + 1;
@@ -1846,9 +1824,6 @@ xfs_bmap_add_extent_hole_delay(
1846 int rsvd) /* OK to allocate reserved blocks */ 1824 int rsvd) /* OK to allocate reserved blocks */
1847{ 1825{
1848 xfs_bmbt_rec_t *ep; /* extent record for idx */ 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 xfs_ifork_t *ifp; /* inode fork pointer */ 1827 xfs_ifork_t *ifp; /* inode fork pointer */
1853 xfs_bmbt_irec_t left; /* left neighbor extent entry */ 1828 xfs_bmbt_irec_t left; /* left neighbor extent entry */
1854 xfs_filblks_t newlen=0; /* new indirect size */ 1829 xfs_filblks_t newlen=0; /* new indirect size */
@@ -1920,7 +1895,7 @@ xfs_bmap_add_extent_hole_delay(
1920 */ 1895 */
1921 temp = left.br_blockcount + new->br_blockcount + 1896 temp = left.br_blockcount + new->br_blockcount +
1922 right.br_blockcount; 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 XFS_DATA_FORK); 1899 XFS_DATA_FORK);
1925 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), temp); 1900 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), temp);
1926 oldlen = STARTBLOCKVAL(left.br_startblock) + 1901 oldlen = STARTBLOCKVAL(left.br_startblock) +
@@ -1929,10 +1904,9 @@ xfs_bmap_add_extent_hole_delay(
1929 newlen = xfs_bmap_worst_indlen(ip, temp); 1904 newlen = xfs_bmap_worst_indlen(ip, temp);
1930 xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx - 1), 1905 xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx - 1),
1931 NULLSTARTBLOCK((int)newlen)); 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 XFS_DATA_FORK);
1934 xfs_bmap_trace_delete(fname, "LC|RC", ip, idx, 1,
1935 XFS_DATA_FORK); 1908 XFS_DATA_FORK);
1909 XFS_BMAP_TRACE_DELETE("LC|RC", ip, idx, 1, XFS_DATA_FORK);
1936 xfs_iext_remove(ifp, idx, 1); 1910 xfs_iext_remove(ifp, idx, 1);
1937 ip->i_df.if_lastex = idx - 1; 1911 ip->i_df.if_lastex = idx - 1;
1938 /* DELTA: Two in-core extents were replaced by one. */ 1912 /* DELTA: Two in-core extents were replaced by one. */
@@ -1947,7 +1921,7 @@ xfs_bmap_add_extent_hole_delay(
1947 * Merge the new allocation with the left neighbor. 1921 * Merge the new allocation with the left neighbor.
1948 */ 1922 */
1949 temp = left.br_blockcount + new->br_blockcount; 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 XFS_DATA_FORK); 1925 XFS_DATA_FORK);
1952 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), temp); 1926 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), temp);
1953 oldlen = STARTBLOCKVAL(left.br_startblock) + 1927 oldlen = STARTBLOCKVAL(left.br_startblock) +
@@ -1955,7 +1929,7 @@ xfs_bmap_add_extent_hole_delay(
1955 newlen = xfs_bmap_worst_indlen(ip, temp); 1929 newlen = xfs_bmap_worst_indlen(ip, temp);
1956 xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx - 1), 1930 xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx - 1),
1957 NULLSTARTBLOCK((int)newlen)); 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 XFS_DATA_FORK); 1933 XFS_DATA_FORK);
1960 ip->i_df.if_lastex = idx - 1; 1934 ip->i_df.if_lastex = idx - 1;
1961 /* DELTA: One in-core extent grew into a hole. */ 1935 /* DELTA: One in-core extent grew into a hole. */
@@ -1969,14 +1943,14 @@ xfs_bmap_add_extent_hole_delay(
1969 * on the right. 1943 * on the right.
1970 * Merge the new allocation with the right neighbor. 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 temp = new->br_blockcount + right.br_blockcount; 1947 temp = new->br_blockcount + right.br_blockcount;
1974 oldlen = STARTBLOCKVAL(new->br_startblock) + 1948 oldlen = STARTBLOCKVAL(new->br_startblock) +
1975 STARTBLOCKVAL(right.br_startblock); 1949 STARTBLOCKVAL(right.br_startblock);
1976 newlen = xfs_bmap_worst_indlen(ip, temp); 1950 newlen = xfs_bmap_worst_indlen(ip, temp);
1977 xfs_bmbt_set_allf(ep, new->br_startoff, 1951 xfs_bmbt_set_allf(ep, new->br_startoff,
1978 NULLSTARTBLOCK((int)newlen), temp, right.br_state); 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 ip->i_df.if_lastex = idx; 1954 ip->i_df.if_lastex = idx;
1981 /* DELTA: One in-core extent grew into a hole. */ 1955 /* DELTA: One in-core extent grew into a hole. */
1982 temp2 = temp; 1956 temp2 = temp;
@@ -1990,7 +1964,7 @@ xfs_bmap_add_extent_hole_delay(
1990 * Insert a new entry. 1964 * Insert a new entry.
1991 */ 1965 */
1992 oldlen = newlen = 0; 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 XFS_DATA_FORK); 1968 XFS_DATA_FORK);
1995 xfs_iext_insert(ifp, idx, 1, new); 1969 xfs_iext_insert(ifp, idx, 1, new);
1996 ip->i_df.if_lastex = idx; 1970 ip->i_df.if_lastex = idx;
@@ -2040,9 +2014,6 @@ xfs_bmap_add_extent_hole_real(
2040{ 2014{
2041 xfs_bmbt_rec_t *ep; /* pointer to extent entry ins. point */ 2015 xfs_bmbt_rec_t *ep; /* pointer to extent entry ins. point */
2042 int error; /* error return value */ 2016 int error; /* error return value */
2043#ifdef XFS_BMAP_TRACE
2044 static char fname[] = "xfs_bmap_add_extent_hole_real";
2045#endif
2046 int i; /* temp state */ 2017 int i; /* temp state */
2047 xfs_ifork_t *ifp; /* inode fork pointer */ 2018 xfs_ifork_t *ifp; /* inode fork pointer */
2048 xfs_bmbt_irec_t left; /* left neighbor extent entry */ 2019 xfs_bmbt_irec_t left; /* left neighbor extent entry */
@@ -2119,15 +2090,14 @@ xfs_bmap_add_extent_hole_real(
2119 * left and on the right. 2090 * left and on the right.
2120 * Merge all three into a single extent record. 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 whichfork); 2094 whichfork);
2124 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), 2095 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
2125 left.br_blockcount + new->br_blockcount + 2096 left.br_blockcount + new->br_blockcount +
2126 right.br_blockcount); 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 whichfork); 2099 whichfork);
2129 xfs_bmap_trace_delete(fname, "LC|RC", ip, 2100 XFS_BMAP_TRACE_DELETE("LC|RC", ip, idx, 1, whichfork);
2130 idx, 1, whichfork);
2131 xfs_iext_remove(ifp, idx, 1); 2101 xfs_iext_remove(ifp, idx, 1);
2132 ifp->if_lastex = idx - 1; 2102 ifp->if_lastex = idx - 1;
2133 XFS_IFORK_NEXT_SET(ip, whichfork, 2103 XFS_IFORK_NEXT_SET(ip, whichfork,
@@ -2169,10 +2139,10 @@ xfs_bmap_add_extent_hole_real(
2169 * on the left. 2139 * on the left.
2170 * Merge the new allocation with the left neighbor. 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 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), 2143 xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
2174 left.br_blockcount + new->br_blockcount); 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 ifp->if_lastex = idx - 1; 2146 ifp->if_lastex = idx - 1;
2177 if (cur == NULL) { 2147 if (cur == NULL) {
2178 rval = XFS_ILOG_FEXT(whichfork); 2148 rval = XFS_ILOG_FEXT(whichfork);
@@ -2203,11 +2173,11 @@ xfs_bmap_add_extent_hole_real(
2203 * on the right. 2173 * on the right.
2204 * Merge the new allocation with the right neighbor. 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 xfs_bmbt_set_allf(ep, new->br_startoff, new->br_startblock, 2177 xfs_bmbt_set_allf(ep, new->br_startoff, new->br_startblock,
2208 new->br_blockcount + right.br_blockcount, 2178 new->br_blockcount + right.br_blockcount,
2209 right.br_state); 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 ifp->if_lastex = idx; 2181 ifp->if_lastex = idx;
2212 if (cur == NULL) { 2182 if (cur == NULL) {
2213 rval = XFS_ILOG_FEXT(whichfork); 2183 rval = XFS_ILOG_FEXT(whichfork);
@@ -2238,8 +2208,7 @@ xfs_bmap_add_extent_hole_real(
2238 * real allocation. 2208 * real allocation.
2239 * Insert a new entry. 2209 * Insert a new entry.
2240 */ 2210 */
2241 xfs_bmap_trace_insert(fname, "0", ip, idx, 1, new, NULL, 2211 XFS_BMAP_TRACE_INSERT("0", ip, idx, 1, new, NULL, whichfork);
2242 whichfork);
2243 xfs_iext_insert(ifp, idx, 1, new); 2212 xfs_iext_insert(ifp, idx, 1, new);
2244 ifp->if_lastex = idx; 2213 ifp->if_lastex = idx;
2245 XFS_IFORK_NEXT_SET(ip, whichfork, 2214 XFS_IFORK_NEXT_SET(ip, whichfork,
@@ -3104,9 +3073,6 @@ xfs_bmap_del_extent(
3104 xfs_bmbt_rec_t *ep; /* current extent entry pointer */ 3073 xfs_bmbt_rec_t *ep; /* current extent entry pointer */
3105 int error; /* error return value */ 3074 int error; /* error return value */
3106 int flags; /* inode logging flags */ 3075 int flags; /* inode logging flags */
3107#ifdef XFS_BMAP_TRACE
3108 static char fname[] = "xfs_bmap_del_extent";
3109#endif
3110 xfs_bmbt_irec_t got; /* current extent entry */ 3076 xfs_bmbt_irec_t got; /* current extent entry */
3111 xfs_fileoff_t got_endoff; /* first offset past got */ 3077 xfs_fileoff_t got_endoff; /* first offset past got */
3112 int i; /* temp state */ 3078 int i; /* temp state */
@@ -3200,7 +3166,7 @@ xfs_bmap_del_extent(
3200 /* 3166 /*
3201 * Matches the whole extent. Delete the entry. 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 xfs_iext_remove(ifp, idx, 1); 3170 xfs_iext_remove(ifp, idx, 1);
3205 ifp->if_lastex = idx; 3171 ifp->if_lastex = idx;
3206 if (delay) 3172 if (delay)
@@ -3221,7 +3187,7 @@ xfs_bmap_del_extent(
3221 /* 3187 /*
3222 * Deleting the first part of the extent. 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 xfs_bmbt_set_startoff(ep, del_endoff); 3191 xfs_bmbt_set_startoff(ep, del_endoff);
3226 temp = got.br_blockcount - del->br_blockcount; 3192 temp = got.br_blockcount - del->br_blockcount;
3227 xfs_bmbt_set_blockcount(ep, temp); 3193 xfs_bmbt_set_blockcount(ep, temp);
@@ -3230,13 +3196,13 @@ xfs_bmap_del_extent(
3230 temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), 3196 temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp),
3231 da_old); 3197 da_old);
3232 xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); 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 whichfork); 3200 whichfork);
3235 da_new = temp; 3201 da_new = temp;
3236 break; 3202 break;
3237 } 3203 }
3238 xfs_bmbt_set_startblock(ep, del_endblock); 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 if (!cur) { 3206 if (!cur) {
3241 flags |= XFS_ILOG_FEXT(whichfork); 3207 flags |= XFS_ILOG_FEXT(whichfork);
3242 break; 3208 break;
@@ -3252,19 +3218,19 @@ xfs_bmap_del_extent(
3252 * Deleting the last part of the extent. 3218 * Deleting the last part of the extent.
3253 */ 3219 */
3254 temp = got.br_blockcount - del->br_blockcount; 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 xfs_bmbt_set_blockcount(ep, temp); 3222 xfs_bmbt_set_blockcount(ep, temp);
3257 ifp->if_lastex = idx; 3223 ifp->if_lastex = idx;
3258 if (delay) { 3224 if (delay) {
3259 temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), 3225 temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp),
3260 da_old); 3226 da_old);
3261 xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); 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 whichfork); 3229 whichfork);
3264 da_new = temp; 3230 da_new = temp;
3265 break; 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 if (!cur) { 3234 if (!cur) {
3269 flags |= XFS_ILOG_FEXT(whichfork); 3235 flags |= XFS_ILOG_FEXT(whichfork);
3270 break; 3236 break;
@@ -3281,7 +3247,7 @@ xfs_bmap_del_extent(
3281 * Deleting the middle of the extent. 3247 * Deleting the middle of the extent.
3282 */ 3248 */
3283 temp = del->br_startoff - got.br_startoff; 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 xfs_bmbt_set_blockcount(ep, temp); 3251 xfs_bmbt_set_blockcount(ep, temp);
3286 new.br_startoff = del_endoff; 3252 new.br_startoff = del_endoff;
3287 temp2 = got_endoff - del_endoff; 3253 temp2 = got_endoff - del_endoff;
@@ -3368,8 +3334,8 @@ xfs_bmap_del_extent(
3368 } 3334 }
3369 } 3335 }
3370 } 3336 }
3371 xfs_bmap_trace_post_update(fname, "0", ip, idx, whichfork); 3337 XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx, whichfork);
3372 xfs_bmap_trace_insert(fname, "0", ip, idx + 1, 1, &new, NULL, 3338 XFS_BMAP_TRACE_INSERT("0", ip, idx + 1, 1, &new, NULL,
3373 whichfork); 3339 whichfork);
3374 xfs_iext_insert(ifp, idx + 1, 1, &new); 3340 xfs_iext_insert(ifp, idx + 1, 1, &new);
3375 ifp->if_lastex = idx + 1; 3341 ifp->if_lastex = idx + 1;
@@ -3609,9 +3575,6 @@ xfs_bmap_local_to_extents(
3609{ 3575{
3610 int error; /* error return value */ 3576 int error; /* error return value */
3611 int flags; /* logging flags returned */ 3577 int flags; /* logging flags returned */
3612#ifdef XFS_BMAP_TRACE
3613 static char fname[] = "xfs_bmap_local_to_extents";
3614#endif
3615 xfs_ifork_t *ifp; /* inode fork pointer */ 3578 xfs_ifork_t *ifp; /* inode fork pointer */
3616 3579
3617 /* 3580 /*
@@ -3666,7 +3629,7 @@ xfs_bmap_local_to_extents(
3666 xfs_iext_add(ifp, 0, 1); 3629 xfs_iext_add(ifp, 0, 1);
3667 ep = xfs_iext_get_ext(ifp, 0); 3630 ep = xfs_iext_get_ext(ifp, 0);
3668 xfs_bmbt_set_allf(ep, 0, args.fsbno, 1, XFS_EXT_NORM); 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 XFS_IFORK_NEXT_SET(ip, whichfork, 1); 3633 XFS_IFORK_NEXT_SET(ip, whichfork, 1);
3671 ip->i_d.di_nblocks = 1; 3634 ip->i_d.di_nblocks = 1;
3672 XFS_TRANS_MOD_DQUOT_BYINO(args.mp, tp, ip, 3635 XFS_TRANS_MOD_DQUOT_BYINO(args.mp, tp, ip,
@@ -3789,7 +3752,7 @@ ktrace_t *xfs_bmap_trace_buf;
3789STATIC void 3752STATIC void
3790xfs_bmap_trace_addentry( 3753xfs_bmap_trace_addentry(
3791 int opcode, /* operation */ 3754 int opcode, /* operation */
3792 char *fname, /* function name */ 3755 const char *fname, /* function name */
3793 char *desc, /* operation description */ 3756 char *desc, /* operation description */
3794 xfs_inode_t *ip, /* incore inode pointer */ 3757 xfs_inode_t *ip, /* incore inode pointer */
3795 xfs_extnum_t idx, /* index of entry(ies) */ 3758 xfs_extnum_t idx, /* index of entry(ies) */
@@ -3848,7 +3811,7 @@ xfs_bmap_trace_addentry(
3848 */ 3811 */
3849STATIC void 3812STATIC void
3850xfs_bmap_trace_delete( 3813xfs_bmap_trace_delete(
3851 char *fname, /* function name */ 3814 const char *fname, /* function name */
3852 char *desc, /* operation description */ 3815 char *desc, /* operation description */
3853 xfs_inode_t *ip, /* incore inode pointer */ 3816 xfs_inode_t *ip, /* incore inode pointer */
3854 xfs_extnum_t idx, /* index of entry(entries) deleted */ 3817 xfs_extnum_t idx, /* index of entry(entries) deleted */
@@ -3870,7 +3833,7 @@ xfs_bmap_trace_delete(
3870 */ 3833 */
3871STATIC void 3834STATIC void
3872xfs_bmap_trace_insert( 3835xfs_bmap_trace_insert(
3873 char *fname, /* function name */ 3836 const char *fname, /* function name */
3874 char *desc, /* operation description */ 3837 char *desc, /* operation description */
3875 xfs_inode_t *ip, /* incore inode pointer */ 3838 xfs_inode_t *ip, /* incore inode pointer */
3876 xfs_extnum_t idx, /* index of entry(entries) inserted */ 3839 xfs_extnum_t idx, /* index of entry(entries) inserted */
@@ -3899,7 +3862,7 @@ xfs_bmap_trace_insert(
3899 */ 3862 */
3900STATIC void 3863STATIC void
3901xfs_bmap_trace_post_update( 3864xfs_bmap_trace_post_update(
3902 char *fname, /* function name */ 3865 const char *fname, /* function name */
3903 char *desc, /* operation description */ 3866 char *desc, /* operation description */
3904 xfs_inode_t *ip, /* incore inode pointer */ 3867 xfs_inode_t *ip, /* incore inode pointer */
3905 xfs_extnum_t idx, /* index of entry updated */ 3868 xfs_extnum_t idx, /* index of entry updated */
@@ -3917,7 +3880,7 @@ xfs_bmap_trace_post_update(
3917 */ 3880 */
3918STATIC void 3881STATIC void
3919xfs_bmap_trace_pre_update( 3882xfs_bmap_trace_pre_update(
3920 char *fname, /* function name */ 3883 const char *fname, /* function name */
3921 char *desc, /* operation description */ 3884 char *desc, /* operation description */
3922 xfs_inode_t *ip, /* incore inode pointer */ 3885 xfs_inode_t *ip, /* incore inode pointer */
3923 xfs_extnum_t idx, /* index of entry to be updated */ 3886 xfs_extnum_t idx, /* index of entry to be updated */
@@ -4534,9 +4497,6 @@ xfs_bmap_read_extents(
4534 xfs_buf_t *bp; /* buffer for "block" */ 4497 xfs_buf_t *bp; /* buffer for "block" */
4535 int error; /* error return value */ 4498 int error; /* error return value */
4536 xfs_exntfmt_t exntf; /* XFS_EXTFMT_NOSTATE, if checking */ 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 xfs_extnum_t i, j; /* index into the extents list */ 4500 xfs_extnum_t i, j; /* index into the extents list */
4541 xfs_ifork_t *ifp; /* fork structure */ 4501 xfs_ifork_t *ifp; /* fork structure */
4542 int level; /* btree level, for checking */ 4502 int level; /* btree level, for checking */
@@ -4653,7 +4613,7 @@ xfs_bmap_read_extents(
4653 } 4613 }
4654 ASSERT(i == (ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t))); 4614 ASSERT(i == (ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t)));
4655 ASSERT(i == XFS_IFORK_NEXTENTS(ip, whichfork)); 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 return 0; 4617 return 0;
4658error0: 4618error0:
4659 xfs_trans_brelse(tp, bp); 4619 xfs_trans_brelse(tp, bp);
@@ -4666,7 +4626,7 @@ error0:
4666 */ 4626 */
4667void 4627void
4668xfs_bmap_trace_exlist( 4628xfs_bmap_trace_exlist(
4669 char *fname, /* function name */ 4629 const char *fname, /* function name */
4670 xfs_inode_t *ip, /* incore inode pointer */ 4630 xfs_inode_t *ip, /* incore inode pointer */
4671 xfs_extnum_t cnt, /* count of entries in the list */ 4631 xfs_extnum_t cnt, /* count of entries in the list */
4672 int whichfork) /* data or attr fork */ 4632 int whichfork) /* data or attr fork */
@@ -4681,7 +4641,7 @@ xfs_bmap_trace_exlist(
4681 for (idx = 0; idx < cnt; idx++) { 4641 for (idx = 0; idx < cnt; idx++) {
4682 ep = xfs_iext_get_ext(ifp, idx); 4642 ep = xfs_iext_get_ext(ifp, idx);
4683 xfs_bmbt_get_all(ep, &s); 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 whichfork); 4645 whichfork);
4686 } 4646 }
4687} 4647}