mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-09 23:00:21 +00:00
[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>
This commit is contained in:
parent
b11f94d537
commit
3a59c94c4b
@ -55,17 +55,17 @@ xfs_alloc_search_busy(xfs_trans_t *tp,
|
|||||||
ktrace_t *xfs_alloc_trace_buf;
|
ktrace_t *xfs_alloc_trace_buf;
|
||||||
|
|
||||||
#define TRACE_ALLOC(s,a) \
|
#define TRACE_ALLOC(s,a) \
|
||||||
xfs_alloc_trace_alloc(fname, s, a, __LINE__)
|
xfs_alloc_trace_alloc(__FUNCTION__, s, a, __LINE__)
|
||||||
#define TRACE_FREE(s,a,b,x,f) \
|
#define TRACE_FREE(s,a,b,x,f) \
|
||||||
xfs_alloc_trace_free(fname, s, mp, a, b, x, f, __LINE__)
|
xfs_alloc_trace_free(__FUNCTION__, s, mp, a, b, x, f, __LINE__)
|
||||||
#define TRACE_MODAGF(s,a,f) \
|
#define TRACE_MODAGF(s,a,f) \
|
||||||
xfs_alloc_trace_modagf(fname, s, mp, a, f, __LINE__)
|
xfs_alloc_trace_modagf(__FUNCTION__, s, mp, a, f, __LINE__)
|
||||||
#define TRACE_BUSY(fname,s,ag,agb,l,sl,tp) \
|
#define TRACE_BUSY(__FUNCTION__,s,ag,agb,l,sl,tp) \
|
||||||
xfs_alloc_trace_busy(fname, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSY, __LINE__)
|
xfs_alloc_trace_busy(__FUNCTION__, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSY, __LINE__)
|
||||||
#define TRACE_UNBUSY(fname,s,ag,sl,tp) \
|
#define TRACE_UNBUSY(__FUNCTION__,s,ag,sl,tp) \
|
||||||
xfs_alloc_trace_busy(fname, s, mp, ag, -1, -1, sl, tp, XFS_ALLOC_KTRACE_UNBUSY, __LINE__)
|
xfs_alloc_trace_busy(__FUNCTION__, s, mp, ag, -1, -1, sl, tp, XFS_ALLOC_KTRACE_UNBUSY, __LINE__)
|
||||||
#define TRACE_BUSYSEARCH(fname,s,ag,agb,l,sl,tp) \
|
#define TRACE_BUSYSEARCH(__FUNCTION__,s,ag,agb,l,sl,tp) \
|
||||||
xfs_alloc_trace_busy(fname, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSYSEARCH, __LINE__)
|
xfs_alloc_trace_busy(__FUNCTION__, s, mp, ag, agb, l, sl, tp, XFS_ALLOC_KTRACE_BUSYSEARCH, __LINE__)
|
||||||
#else
|
#else
|
||||||
#define TRACE_ALLOC(s,a)
|
#define TRACE_ALLOC(s,a)
|
||||||
#define TRACE_FREE(s,a,b,x,f)
|
#define TRACE_FREE(s,a,b,x,f)
|
||||||
@ -420,7 +420,7 @@ xfs_alloc_read_agfl(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_alloc_trace_alloc(
|
xfs_alloc_trace_alloc(
|
||||||
char *name, /* function tag string */
|
const char *name, /* function tag string */
|
||||||
char *str, /* additional string */
|
char *str, /* additional string */
|
||||||
xfs_alloc_arg_t *args, /* allocation argument structure */
|
xfs_alloc_arg_t *args, /* allocation argument structure */
|
||||||
int line) /* source line number */
|
int line) /* source line number */
|
||||||
@ -453,7 +453,7 @@ xfs_alloc_trace_alloc(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_alloc_trace_free(
|
xfs_alloc_trace_free(
|
||||||
char *name, /* function tag string */
|
const char *name, /* function tag string */
|
||||||
char *str, /* additional string */
|
char *str, /* additional string */
|
||||||
xfs_mount_t *mp, /* file system mount point */
|
xfs_mount_t *mp, /* file system mount point */
|
||||||
xfs_agnumber_t agno, /* allocation group number */
|
xfs_agnumber_t agno, /* allocation group number */
|
||||||
@ -479,7 +479,7 @@ xfs_alloc_trace_free(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_alloc_trace_modagf(
|
xfs_alloc_trace_modagf(
|
||||||
char *name, /* function tag string */
|
const char *name, /* function tag string */
|
||||||
char *str, /* additional string */
|
char *str, /* additional string */
|
||||||
xfs_mount_t *mp, /* file system mount point */
|
xfs_mount_t *mp, /* file system mount point */
|
||||||
xfs_agf_t *agf, /* new agf value */
|
xfs_agf_t *agf, /* new agf value */
|
||||||
@ -507,7 +507,7 @@ xfs_alloc_trace_modagf(
|
|||||||
|
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_alloc_trace_busy(
|
xfs_alloc_trace_busy(
|
||||||
char *name, /* function tag string */
|
const char *name, /* function tag string */
|
||||||
char *str, /* additional string */
|
char *str, /* additional string */
|
||||||
xfs_mount_t *mp, /* file system mount point */
|
xfs_mount_t *mp, /* file system mount point */
|
||||||
xfs_agnumber_t agno, /* allocation group number */
|
xfs_agnumber_t agno, /* allocation group number */
|
||||||
@ -549,9 +549,6 @@ xfs_alloc_ag_vextent(
|
|||||||
xfs_alloc_arg_t *args) /* argument structure for allocation */
|
xfs_alloc_arg_t *args) /* argument structure for allocation */
|
||||||
{
|
{
|
||||||
int error=0;
|
int error=0;
|
||||||
#ifdef XFS_ALLOC_TRACE
|
|
||||||
static char fname[] = "xfs_alloc_ag_vextent";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ASSERT(args->minlen > 0);
|
ASSERT(args->minlen > 0);
|
||||||
ASSERT(args->maxlen > 0);
|
ASSERT(args->maxlen > 0);
|
||||||
@ -635,9 +632,6 @@ xfs_alloc_ag_vextent_exact(
|
|||||||
xfs_agblock_t fbno; /* start block of found extent */
|
xfs_agblock_t fbno; /* start block of found extent */
|
||||||
xfs_agblock_t fend; /* end block of found extent */
|
xfs_agblock_t fend; /* end block of found extent */
|
||||||
xfs_extlen_t flen; /* length of found extent */
|
xfs_extlen_t flen; /* length of found extent */
|
||||||
#ifdef XFS_ALLOC_TRACE
|
|
||||||
static char fname[] = "xfs_alloc_ag_vextent_exact";
|
|
||||||
#endif
|
|
||||||
int i; /* success/failure of operation */
|
int i; /* success/failure of operation */
|
||||||
xfs_agblock_t maxend; /* end of maximal extent */
|
xfs_agblock_t maxend; /* end of maximal extent */
|
||||||
xfs_agblock_t minend; /* end of minimal extent */
|
xfs_agblock_t minend; /* end of minimal extent */
|
||||||
@ -737,9 +731,6 @@ xfs_alloc_ag_vextent_near(
|
|||||||
xfs_btree_cur_t *bno_cur_gt; /* cursor for bno btree, right side */
|
xfs_btree_cur_t *bno_cur_gt; /* cursor for bno btree, right side */
|
||||||
xfs_btree_cur_t *bno_cur_lt; /* cursor for bno btree, left side */
|
xfs_btree_cur_t *bno_cur_lt; /* cursor for bno btree, left side */
|
||||||
xfs_btree_cur_t *cnt_cur; /* cursor for count btree */
|
xfs_btree_cur_t *cnt_cur; /* cursor for count btree */
|
||||||
#ifdef XFS_ALLOC_TRACE
|
|
||||||
static char fname[] = "xfs_alloc_ag_vextent_near";
|
|
||||||
#endif
|
|
||||||
xfs_agblock_t gtbno; /* start bno of right side entry */
|
xfs_agblock_t gtbno; /* start bno of right side entry */
|
||||||
xfs_agblock_t gtbnoa; /* aligned ... */
|
xfs_agblock_t gtbnoa; /* aligned ... */
|
||||||
xfs_extlen_t gtdiff; /* difference to right side entry */
|
xfs_extlen_t gtdiff; /* difference to right side entry */
|
||||||
@ -1270,9 +1261,6 @@ xfs_alloc_ag_vextent_size(
|
|||||||
int error; /* error result */
|
int error; /* error result */
|
||||||
xfs_agblock_t fbno; /* start of found freespace */
|
xfs_agblock_t fbno; /* start of found freespace */
|
||||||
xfs_extlen_t flen; /* length of found freespace */
|
xfs_extlen_t flen; /* length of found freespace */
|
||||||
#ifdef XFS_ALLOC_TRACE
|
|
||||||
static char fname[] = "xfs_alloc_ag_vextent_size";
|
|
||||||
#endif
|
|
||||||
int i; /* temp status variable */
|
int i; /* temp status variable */
|
||||||
xfs_agblock_t rbno; /* returned block number */
|
xfs_agblock_t rbno; /* returned block number */
|
||||||
xfs_extlen_t rlen; /* length of returned extent */
|
xfs_extlen_t rlen; /* length of returned extent */
|
||||||
@ -1427,9 +1415,6 @@ xfs_alloc_ag_vextent_small(
|
|||||||
int error;
|
int error;
|
||||||
xfs_agblock_t fbno;
|
xfs_agblock_t fbno;
|
||||||
xfs_extlen_t flen;
|
xfs_extlen_t flen;
|
||||||
#ifdef XFS_ALLOC_TRACE
|
|
||||||
static char fname[] = "xfs_alloc_ag_vextent_small";
|
|
||||||
#endif
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ((error = xfs_alloc_decrement(ccur, 0, &i)))
|
if ((error = xfs_alloc_decrement(ccur, 0, &i)))
|
||||||
@ -1516,9 +1501,6 @@ xfs_free_ag_extent(
|
|||||||
xfs_btree_cur_t *bno_cur; /* cursor for by-block btree */
|
xfs_btree_cur_t *bno_cur; /* cursor for by-block btree */
|
||||||
xfs_btree_cur_t *cnt_cur; /* cursor for by-size btree */
|
xfs_btree_cur_t *cnt_cur; /* cursor for by-size btree */
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_ALLOC_TRACE
|
|
||||||
static char fname[] = "xfs_free_ag_extent";
|
|
||||||
#endif
|
|
||||||
xfs_agblock_t gtbno; /* start of right neighbor block */
|
xfs_agblock_t gtbno; /* start of right neighbor block */
|
||||||
xfs_extlen_t gtlen; /* length of right neighbor block */
|
xfs_extlen_t gtlen; /* length of right neighbor block */
|
||||||
int haveleft; /* have a left neighbor block */
|
int haveleft; /* have a left neighbor block */
|
||||||
@ -2003,9 +1985,6 @@ xfs_alloc_get_freelist(
|
|||||||
xfs_agblock_t bno; /* block number returned */
|
xfs_agblock_t bno; /* block number returned */
|
||||||
int error;
|
int error;
|
||||||
int logflags;
|
int logflags;
|
||||||
#ifdef XFS_ALLOC_TRACE
|
|
||||||
static char fname[] = "xfs_alloc_get_freelist";
|
|
||||||
#endif
|
|
||||||
xfs_mount_t *mp; /* mount structure */
|
xfs_mount_t *mp; /* mount structure */
|
||||||
xfs_perag_t *pag; /* per allocation group data */
|
xfs_perag_t *pag; /* per allocation group data */
|
||||||
|
|
||||||
@ -2128,9 +2107,6 @@ xfs_alloc_put_freelist(
|
|||||||
__be32 *blockp;/* pointer to array entry */
|
__be32 *blockp;/* pointer to array entry */
|
||||||
int error;
|
int error;
|
||||||
int logflags;
|
int logflags;
|
||||||
#ifdef XFS_ALLOC_TRACE
|
|
||||||
static char fname[] = "xfs_alloc_put_freelist";
|
|
||||||
#endif
|
|
||||||
xfs_mount_t *mp; /* mount structure */
|
xfs_mount_t *mp; /* mount structure */
|
||||||
xfs_perag_t *pag; /* per allocation group data */
|
xfs_perag_t *pag; /* per allocation group data */
|
||||||
|
|
||||||
@ -2263,9 +2239,6 @@ xfs_alloc_vextent(
|
|||||||
xfs_agblock_t agsize; /* allocation group size */
|
xfs_agblock_t agsize; /* allocation group size */
|
||||||
int error;
|
int error;
|
||||||
int flags; /* XFS_ALLOC_FLAG_... locking flags */
|
int flags; /* XFS_ALLOC_FLAG_... locking flags */
|
||||||
#ifdef XFS_ALLOC_TRACE
|
|
||||||
static char fname[] = "xfs_alloc_vextent";
|
|
||||||
#endif
|
|
||||||
xfs_extlen_t minleft;/* minimum left value, temp copy */
|
xfs_extlen_t minleft;/* minimum left value, temp copy */
|
||||||
xfs_mount_t *mp; /* mount structure pointer */
|
xfs_mount_t *mp; /* mount structure pointer */
|
||||||
xfs_agnumber_t sagno; /* starting allocation group number */
|
xfs_agnumber_t sagno; /* starting allocation group number */
|
||||||
|
@ -278,7 +278,7 @@ xfs_bmap_isaeof(
|
|||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmap_trace_addentry(
|
xfs_bmap_trace_addentry(
|
||||||
int opcode, /* operation */
|
int opcode, /* operation */
|
||||||
char *fname, /* function name */
|
const char *fname, /* function name */
|
||||||
char *desc, /* operation description */
|
char *desc, /* operation description */
|
||||||
xfs_inode_t *ip, /* incore inode pointer */
|
xfs_inode_t *ip, /* incore inode pointer */
|
||||||
xfs_extnum_t idx, /* index of entry(ies) */
|
xfs_extnum_t idx, /* index of entry(ies) */
|
||||||
@ -292,7 +292,7 @@ xfs_bmap_trace_addentry(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmap_trace_delete(
|
xfs_bmap_trace_delete(
|
||||||
char *fname, /* function name */
|
const char *fname, /* function name */
|
||||||
char *desc, /* operation description */
|
char *desc, /* operation description */
|
||||||
xfs_inode_t *ip, /* incore inode pointer */
|
xfs_inode_t *ip, /* incore inode pointer */
|
||||||
xfs_extnum_t idx, /* index of entry(entries) deleted */
|
xfs_extnum_t idx, /* index of entry(entries) deleted */
|
||||||
@ -305,7 +305,7 @@ xfs_bmap_trace_delete(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmap_trace_insert(
|
xfs_bmap_trace_insert(
|
||||||
char *fname, /* function name */
|
const char *fname, /* function name */
|
||||||
char *desc, /* operation description */
|
char *desc, /* operation description */
|
||||||
xfs_inode_t *ip, /* incore inode pointer */
|
xfs_inode_t *ip, /* incore inode pointer */
|
||||||
xfs_extnum_t idx, /* index of entry(entries) inserted */
|
xfs_extnum_t idx, /* index of entry(entries) inserted */
|
||||||
@ -319,7 +319,7 @@ xfs_bmap_trace_insert(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmap_trace_post_update(
|
xfs_bmap_trace_post_update(
|
||||||
char *fname, /* function name */
|
const char *fname, /* function name */
|
||||||
char *desc, /* operation description */
|
char *desc, /* operation description */
|
||||||
xfs_inode_t *ip, /* incore inode pointer */
|
xfs_inode_t *ip, /* incore inode pointer */
|
||||||
xfs_extnum_t idx, /* index of entry updated */
|
xfs_extnum_t idx, /* index of entry updated */
|
||||||
@ -330,17 +330,25 @@ xfs_bmap_trace_post_update(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmap_trace_pre_update(
|
xfs_bmap_trace_pre_update(
|
||||||
char *fname, /* function name */
|
const char *fname, /* function name */
|
||||||
char *desc, /* operation description */
|
char *desc, /* operation description */
|
||||||
xfs_inode_t *ip, /* incore inode pointer */
|
xfs_inode_t *ip, /* incore inode pointer */
|
||||||
xfs_extnum_t idx, /* index of entry to be updated */
|
xfs_extnum_t idx, /* index of entry to be updated */
|
||||||
int whichfork); /* data or attr fork */
|
int whichfork); /* data or attr fork */
|
||||||
|
|
||||||
|
#define XFS_BMAP_TRACE_DELETE(d,ip,i,c,w) \
|
||||||
|
xfs_bmap_trace_delete(__FUNCTION__,d,ip,i,c,w)
|
||||||
|
#define XFS_BMAP_TRACE_INSERT(d,ip,i,c,r1,r2,w) \
|
||||||
|
xfs_bmap_trace_insert(__FUNCTION__,d,ip,i,c,r1,r2,w)
|
||||||
|
#define XFS_BMAP_TRACE_POST_UPDATE(d,ip,i,w) \
|
||||||
|
xfs_bmap_trace_post_update(__FUNCTION__,d,ip,i,w)
|
||||||
|
#define XFS_BMAP_TRACE_PRE_UPDATE(d,ip,i,w) \
|
||||||
|
xfs_bmap_trace_pre_update(__FUNCTION__,d,ip,i,w)
|
||||||
#else
|
#else
|
||||||
#define xfs_bmap_trace_delete(f,d,ip,i,c,w)
|
#define XFS_BMAP_TRACE_DELETE(d,ip,i,c,w)
|
||||||
#define xfs_bmap_trace_insert(f,d,ip,i,c,r1,r2,w)
|
#define XFS_BMAP_TRACE_INSERT(d,ip,i,c,r1,r2,w)
|
||||||
#define xfs_bmap_trace_post_update(f,d,ip,i,w)
|
#define XFS_BMAP_TRACE_POST_UPDATE(d,ip,i,w)
|
||||||
#define xfs_bmap_trace_pre_update(f,d,ip,i,w)
|
#define XFS_BMAP_TRACE_PRE_UPDATE(d,ip,i,w)
|
||||||
#endif /* XFS_BMAP_TRACE */
|
#endif /* XFS_BMAP_TRACE */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -532,9 +540,6 @@ xfs_bmap_add_extent(
|
|||||||
xfs_filblks_t da_new; /* new count del alloc blocks used */
|
xfs_filblks_t da_new; /* new count del alloc blocks used */
|
||||||
xfs_filblks_t da_old; /* old count del alloc blocks used */
|
xfs_filblks_t da_old; /* old count del alloc blocks used */
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_BMAP_TRACE
|
|
||||||
static char fname[] = "xfs_bmap_add_extent";
|
|
||||||
#endif
|
|
||||||
xfs_ifork_t *ifp; /* inode fork ptr */
|
xfs_ifork_t *ifp; /* inode fork ptr */
|
||||||
int logflags; /* returned value */
|
int logflags; /* returned value */
|
||||||
xfs_extnum_t nextents; /* number of extents in file now */
|
xfs_extnum_t nextents; /* number of extents in file now */
|
||||||
@ -552,8 +557,8 @@ xfs_bmap_add_extent(
|
|||||||
* already extents in the list.
|
* already extents in the list.
|
||||||
*/
|
*/
|
||||||
if (nextents == 0) {
|
if (nextents == 0) {
|
||||||
xfs_bmap_trace_insert(fname, "insert empty", ip, 0, 1, new,
|
XFS_BMAP_TRACE_INSERT("insert empty", ip, 0, 1, new, NULL,
|
||||||
NULL, whichfork);
|
whichfork);
|
||||||
xfs_iext_insert(ifp, 0, 1, new);
|
xfs_iext_insert(ifp, 0, 1, new);
|
||||||
ASSERT(cur == NULL);
|
ASSERT(cur == NULL);
|
||||||
ifp->if_lastex = 0;
|
ifp->if_lastex = 0;
|
||||||
@ -711,9 +716,6 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
int diff; /* temp value */
|
int diff; /* temp value */
|
||||||
xfs_bmbt_rec_t *ep; /* extent entry for idx */
|
xfs_bmbt_rec_t *ep; /* extent entry for idx */
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_BMAP_TRACE
|
|
||||||
static char fname[] = "xfs_bmap_add_extent_delay_real";
|
|
||||||
#endif
|
|
||||||
int i; /* temp state */
|
int i; /* temp state */
|
||||||
xfs_ifork_t *ifp; /* inode fork pointer */
|
xfs_ifork_t *ifp; /* inode fork pointer */
|
||||||
xfs_fileoff_t new_endoff; /* end offset of new entry */
|
xfs_fileoff_t new_endoff; /* end offset of new entry */
|
||||||
@ -809,15 +811,14 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
* Filling in all of a previously delayed allocation extent.
|
* Filling in all of a previously delayed allocation extent.
|
||||||
* The left and right neighbors are both contiguous with new.
|
* The left and right neighbors are both contiguous with new.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "LF|RF|LC|RC", ip, idx - 1,
|
XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|LC|RC", ip, idx - 1,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
||||||
LEFT.br_blockcount + PREV.br_blockcount +
|
LEFT.br_blockcount + PREV.br_blockcount +
|
||||||
RIGHT.br_blockcount);
|
RIGHT.br_blockcount);
|
||||||
xfs_bmap_trace_post_update(fname, "LF|RF|LC|RC", ip, idx - 1,
|
XFS_BMAP_TRACE_POST_UPDATE("LF|RF|LC|RC", ip, idx - 1,
|
||||||
XFS_DATA_FORK);
|
|
||||||
xfs_bmap_trace_delete(fname, "LF|RF|LC|RC", ip, idx, 2,
|
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
|
XFS_BMAP_TRACE_DELETE("LF|RF|LC|RC", ip, idx, 2, XFS_DATA_FORK);
|
||||||
xfs_iext_remove(ifp, idx, 2);
|
xfs_iext_remove(ifp, idx, 2);
|
||||||
ip->i_df.if_lastex = idx - 1;
|
ip->i_df.if_lastex = idx - 1;
|
||||||
ip->i_d.di_nextents--;
|
ip->i_d.di_nextents--;
|
||||||
@ -856,15 +857,14 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
* Filling in all of a previously delayed allocation extent.
|
* Filling in all of a previously delayed allocation extent.
|
||||||
* The left neighbor is contiguous, the right is not.
|
* The left neighbor is contiguous, the right is not.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "LF|RF|LC", ip, idx - 1,
|
XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|LC", ip, idx - 1,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
||||||
LEFT.br_blockcount + PREV.br_blockcount);
|
LEFT.br_blockcount + PREV.br_blockcount);
|
||||||
xfs_bmap_trace_post_update(fname, "LF|RF|LC", ip, idx - 1,
|
XFS_BMAP_TRACE_POST_UPDATE("LF|RF|LC", ip, idx - 1,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
ip->i_df.if_lastex = idx - 1;
|
ip->i_df.if_lastex = idx - 1;
|
||||||
xfs_bmap_trace_delete(fname, "LF|RF|LC", ip, idx, 1,
|
XFS_BMAP_TRACE_DELETE("LF|RF|LC", ip, idx, 1, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
xfs_iext_remove(ifp, idx, 1);
|
xfs_iext_remove(ifp, idx, 1);
|
||||||
if (cur == NULL)
|
if (cur == NULL)
|
||||||
rval = XFS_ILOG_DEXT;
|
rval = XFS_ILOG_DEXT;
|
||||||
@ -893,16 +893,13 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
* Filling in all of a previously delayed allocation extent.
|
* Filling in all of a previously delayed allocation extent.
|
||||||
* The right neighbor is contiguous, the left is not.
|
* The right neighbor is contiguous, the left is not.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "LF|RF|RC", ip, idx,
|
XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|RC", ip, idx, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
xfs_bmbt_set_startblock(ep, new->br_startblock);
|
xfs_bmbt_set_startblock(ep, new->br_startblock);
|
||||||
xfs_bmbt_set_blockcount(ep,
|
xfs_bmbt_set_blockcount(ep,
|
||||||
PREV.br_blockcount + RIGHT.br_blockcount);
|
PREV.br_blockcount + RIGHT.br_blockcount);
|
||||||
xfs_bmap_trace_post_update(fname, "LF|RF|RC", ip, idx,
|
XFS_BMAP_TRACE_POST_UPDATE("LF|RF|RC", ip, idx, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
ip->i_df.if_lastex = idx;
|
ip->i_df.if_lastex = idx;
|
||||||
xfs_bmap_trace_delete(fname, "LF|RF|RC", ip, idx + 1, 1,
|
XFS_BMAP_TRACE_DELETE("LF|RF|RC", ip, idx + 1, 1, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
xfs_iext_remove(ifp, idx + 1, 1);
|
xfs_iext_remove(ifp, idx + 1, 1);
|
||||||
if (cur == NULL)
|
if (cur == NULL)
|
||||||
rval = XFS_ILOG_DEXT;
|
rval = XFS_ILOG_DEXT;
|
||||||
@ -932,11 +929,9 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
* Neither the left nor right neighbors are contiguous with
|
* Neither the left nor right neighbors are contiguous with
|
||||||
* the new one.
|
* the new one.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "LF|RF", ip, idx,
|
XFS_BMAP_TRACE_PRE_UPDATE("LF|RF", ip, idx, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
xfs_bmbt_set_startblock(ep, new->br_startblock);
|
xfs_bmbt_set_startblock(ep, new->br_startblock);
|
||||||
xfs_bmap_trace_post_update(fname, "LF|RF", ip, idx,
|
XFS_BMAP_TRACE_POST_UPDATE("LF|RF", ip, idx, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
ip->i_df.if_lastex = idx;
|
ip->i_df.if_lastex = idx;
|
||||||
ip->i_d.di_nextents++;
|
ip->i_d.di_nextents++;
|
||||||
if (cur == NULL)
|
if (cur == NULL)
|
||||||
@ -964,17 +959,14 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
* Filling in the first part of a previous delayed allocation.
|
* Filling in the first part of a previous delayed allocation.
|
||||||
* The left neighbor is contiguous.
|
* The left neighbor is contiguous.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "LF|LC", ip, idx - 1,
|
XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx - 1, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
||||||
LEFT.br_blockcount + new->br_blockcount);
|
LEFT.br_blockcount + new->br_blockcount);
|
||||||
xfs_bmbt_set_startoff(ep,
|
xfs_bmbt_set_startoff(ep,
|
||||||
PREV.br_startoff + new->br_blockcount);
|
PREV.br_startoff + new->br_blockcount);
|
||||||
xfs_bmap_trace_post_update(fname, "LF|LC", ip, idx - 1,
|
XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx - 1, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
temp = PREV.br_blockcount - new->br_blockcount;
|
temp = PREV.br_blockcount - new->br_blockcount;
|
||||||
xfs_bmap_trace_pre_update(fname, "LF|LC", ip, idx,
|
XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
xfs_bmbt_set_blockcount(ep, temp);
|
xfs_bmbt_set_blockcount(ep, temp);
|
||||||
ip->i_df.if_lastex = idx - 1;
|
ip->i_df.if_lastex = idx - 1;
|
||||||
if (cur == NULL)
|
if (cur == NULL)
|
||||||
@ -996,8 +988,7 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp),
|
temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp),
|
||||||
STARTBLOCKVAL(PREV.br_startblock));
|
STARTBLOCKVAL(PREV.br_startblock));
|
||||||
xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
|
xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
|
||||||
xfs_bmap_trace_post_update(fname, "LF|LC", ip, idx,
|
XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
*dnew = temp;
|
*dnew = temp;
|
||||||
/* DELTA: The boundary between two in-core extents moved. */
|
/* DELTA: The boundary between two in-core extents moved. */
|
||||||
temp = LEFT.br_startoff;
|
temp = LEFT.br_startoff;
|
||||||
@ -1010,11 +1001,11 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
* Filling in the first part of a previous delayed allocation.
|
* Filling in the first part of a previous delayed allocation.
|
||||||
* The left neighbor is not contiguous.
|
* The left neighbor is not contiguous.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "LF", ip, idx, XFS_DATA_FORK);
|
XFS_BMAP_TRACE_PRE_UPDATE("LF", ip, idx, XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_startoff(ep, new_endoff);
|
xfs_bmbt_set_startoff(ep, new_endoff);
|
||||||
temp = PREV.br_blockcount - new->br_blockcount;
|
temp = PREV.br_blockcount - new->br_blockcount;
|
||||||
xfs_bmbt_set_blockcount(ep, temp);
|
xfs_bmbt_set_blockcount(ep, temp);
|
||||||
xfs_bmap_trace_insert(fname, "LF", ip, idx, 1, new, NULL,
|
XFS_BMAP_TRACE_INSERT("LF", ip, idx, 1, new, NULL,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_iext_insert(ifp, idx, 1, new);
|
xfs_iext_insert(ifp, idx, 1, new);
|
||||||
ip->i_df.if_lastex = idx;
|
ip->i_df.if_lastex = idx;
|
||||||
@ -1047,8 +1038,7 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
(cur ? cur->bc_private.b.allocated : 0));
|
(cur ? cur->bc_private.b.allocated : 0));
|
||||||
ep = xfs_iext_get_ext(ifp, idx + 1);
|
ep = xfs_iext_get_ext(ifp, idx + 1);
|
||||||
xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
|
xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
|
||||||
xfs_bmap_trace_post_update(fname, "LF", ip, idx + 1,
|
XFS_BMAP_TRACE_POST_UPDATE("LF", ip, idx + 1, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
*dnew = temp;
|
*dnew = temp;
|
||||||
/* DELTA: One in-core extent is split in two. */
|
/* DELTA: One in-core extent is split in two. */
|
||||||
temp = PREV.br_startoff;
|
temp = PREV.br_startoff;
|
||||||
@ -1061,17 +1051,14 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
* The right neighbor is contiguous with the new allocation.
|
* The right neighbor is contiguous with the new allocation.
|
||||||
*/
|
*/
|
||||||
temp = PREV.br_blockcount - new->br_blockcount;
|
temp = PREV.br_blockcount - new->br_blockcount;
|
||||||
xfs_bmap_trace_pre_update(fname, "RF|RC", ip, idx,
|
XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx + 1, XFS_DATA_FORK);
|
||||||
xfs_bmap_trace_pre_update(fname, "RF|RC", ip, idx + 1,
|
|
||||||
XFS_DATA_FORK);
|
|
||||||
xfs_bmbt_set_blockcount(ep, temp);
|
xfs_bmbt_set_blockcount(ep, temp);
|
||||||
xfs_bmbt_set_allf(xfs_iext_get_ext(ifp, idx + 1),
|
xfs_bmbt_set_allf(xfs_iext_get_ext(ifp, idx + 1),
|
||||||
new->br_startoff, new->br_startblock,
|
new->br_startoff, new->br_startblock,
|
||||||
new->br_blockcount + RIGHT.br_blockcount,
|
new->br_blockcount + RIGHT.br_blockcount,
|
||||||
RIGHT.br_state);
|
RIGHT.br_state);
|
||||||
xfs_bmap_trace_post_update(fname, "RF|RC", ip, idx + 1,
|
XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx + 1, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
ip->i_df.if_lastex = idx + 1;
|
ip->i_df.if_lastex = idx + 1;
|
||||||
if (cur == NULL)
|
if (cur == NULL)
|
||||||
rval = XFS_ILOG_DEXT;
|
rval = XFS_ILOG_DEXT;
|
||||||
@ -1092,8 +1079,7 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp),
|
temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp),
|
||||||
STARTBLOCKVAL(PREV.br_startblock));
|
STARTBLOCKVAL(PREV.br_startblock));
|
||||||
xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
|
xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
|
||||||
xfs_bmap_trace_post_update(fname, "RF|RC", ip, idx,
|
XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
*dnew = temp;
|
*dnew = temp;
|
||||||
/* DELTA: The boundary between two in-core extents moved. */
|
/* DELTA: The boundary between two in-core extents moved. */
|
||||||
temp = PREV.br_startoff;
|
temp = PREV.br_startoff;
|
||||||
@ -1107,10 +1093,10 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
* The right neighbor is not contiguous.
|
* The right neighbor is not contiguous.
|
||||||
*/
|
*/
|
||||||
temp = PREV.br_blockcount - new->br_blockcount;
|
temp = PREV.br_blockcount - new->br_blockcount;
|
||||||
xfs_bmap_trace_pre_update(fname, "RF", ip, idx, XFS_DATA_FORK);
|
XFS_BMAP_TRACE_PRE_UPDATE("RF", ip, idx, XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_blockcount(ep, temp);
|
xfs_bmbt_set_blockcount(ep, temp);
|
||||||
xfs_bmap_trace_insert(fname, "RF", ip, idx + 1, 1,
|
XFS_BMAP_TRACE_INSERT("RF", ip, idx + 1, 1, new, NULL,
|
||||||
new, NULL, XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_iext_insert(ifp, idx + 1, 1, new);
|
xfs_iext_insert(ifp, idx + 1, 1, new);
|
||||||
ip->i_df.if_lastex = idx + 1;
|
ip->i_df.if_lastex = idx + 1;
|
||||||
ip->i_d.di_nextents++;
|
ip->i_d.di_nextents++;
|
||||||
@ -1142,7 +1128,7 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
(cur ? cur->bc_private.b.allocated : 0));
|
(cur ? cur->bc_private.b.allocated : 0));
|
||||||
ep = xfs_iext_get_ext(ifp, idx);
|
ep = xfs_iext_get_ext(ifp, idx);
|
||||||
xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
|
xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
|
||||||
xfs_bmap_trace_post_update(fname, "RF", ip, idx, XFS_DATA_FORK);
|
XFS_BMAP_TRACE_POST_UPDATE("RF", ip, idx, XFS_DATA_FORK);
|
||||||
*dnew = temp;
|
*dnew = temp;
|
||||||
/* DELTA: One in-core extent is split in two. */
|
/* DELTA: One in-core extent is split in two. */
|
||||||
temp = PREV.br_startoff;
|
temp = PREV.br_startoff;
|
||||||
@ -1156,7 +1142,7 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
* This case is avoided almost all the time.
|
* This case is avoided almost all the time.
|
||||||
*/
|
*/
|
||||||
temp = new->br_startoff - PREV.br_startoff;
|
temp = new->br_startoff - PREV.br_startoff;
|
||||||
xfs_bmap_trace_pre_update(fname, "0", ip, idx, XFS_DATA_FORK);
|
XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx, XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_blockcount(ep, temp);
|
xfs_bmbt_set_blockcount(ep, temp);
|
||||||
r[0] = *new;
|
r[0] = *new;
|
||||||
r[1].br_state = PREV.br_state;
|
r[1].br_state = PREV.br_state;
|
||||||
@ -1164,7 +1150,7 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
r[1].br_startoff = new_endoff;
|
r[1].br_startoff = new_endoff;
|
||||||
temp2 = PREV.br_startoff + PREV.br_blockcount - new_endoff;
|
temp2 = PREV.br_startoff + PREV.br_blockcount - new_endoff;
|
||||||
r[1].br_blockcount = temp2;
|
r[1].br_blockcount = temp2;
|
||||||
xfs_bmap_trace_insert(fname, "0", ip, idx + 1, 2, &r[0], &r[1],
|
XFS_BMAP_TRACE_INSERT("0", ip, idx + 1, 2, &r[0], &r[1],
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_iext_insert(ifp, idx + 1, 2, &r[0]);
|
xfs_iext_insert(ifp, idx + 1, 2, &r[0]);
|
||||||
ip->i_df.if_lastex = idx + 1;
|
ip->i_df.if_lastex = idx + 1;
|
||||||
@ -1223,13 +1209,11 @@ xfs_bmap_add_extent_delay_real(
|
|||||||
}
|
}
|
||||||
ep = xfs_iext_get_ext(ifp, idx);
|
ep = xfs_iext_get_ext(ifp, idx);
|
||||||
xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
|
xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
|
||||||
xfs_bmap_trace_post_update(fname, "0", ip, idx, XFS_DATA_FORK);
|
XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx, XFS_DATA_FORK);
|
||||||
xfs_bmap_trace_pre_update(fname, "0", ip, idx + 2,
|
XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx + 2, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx + 2),
|
xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx + 2),
|
||||||
NULLSTARTBLOCK((int)temp2));
|
NULLSTARTBLOCK((int)temp2));
|
||||||
xfs_bmap_trace_post_update(fname, "0", ip, idx + 2,
|
XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx + 2, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
*dnew = temp + temp2;
|
*dnew = temp + temp2;
|
||||||
/* DELTA: One in-core extent is split in three. */
|
/* DELTA: One in-core extent is split in three. */
|
||||||
temp = PREV.br_startoff;
|
temp = PREV.br_startoff;
|
||||||
@ -1288,9 +1272,6 @@ xfs_bmap_add_extent_unwritten_real(
|
|||||||
xfs_btree_cur_t *cur; /* btree cursor */
|
xfs_btree_cur_t *cur; /* btree cursor */
|
||||||
xfs_bmbt_rec_t *ep; /* extent entry for idx */
|
xfs_bmbt_rec_t *ep; /* extent entry for idx */
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_BMAP_TRACE
|
|
||||||
static char fname[] = "xfs_bmap_add_extent_unwritten_real";
|
|
||||||
#endif
|
|
||||||
int i; /* temp state */
|
int i; /* temp state */
|
||||||
xfs_ifork_t *ifp; /* inode fork pointer */
|
xfs_ifork_t *ifp; /* inode fork pointer */
|
||||||
xfs_fileoff_t new_endoff; /* end offset of new entry */
|
xfs_fileoff_t new_endoff; /* end offset of new entry */
|
||||||
@ -1391,15 +1372,14 @@ xfs_bmap_add_extent_unwritten_real(
|
|||||||
* Setting all of a previous oldext extent to newext.
|
* Setting all of a previous oldext extent to newext.
|
||||||
* The left and right neighbors are both contiguous with new.
|
* The left and right neighbors are both contiguous with new.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "LF|RF|LC|RC", ip, idx - 1,
|
XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|LC|RC", ip, idx - 1,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
||||||
LEFT.br_blockcount + PREV.br_blockcount +
|
LEFT.br_blockcount + PREV.br_blockcount +
|
||||||
RIGHT.br_blockcount);
|
RIGHT.br_blockcount);
|
||||||
xfs_bmap_trace_post_update(fname, "LF|RF|LC|RC", ip, idx - 1,
|
XFS_BMAP_TRACE_POST_UPDATE("LF|RF|LC|RC", ip, idx - 1,
|
||||||
XFS_DATA_FORK);
|
|
||||||
xfs_bmap_trace_delete(fname, "LF|RF|LC|RC", ip, idx, 2,
|
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
|
XFS_BMAP_TRACE_DELETE("LF|RF|LC|RC", ip, idx, 2, XFS_DATA_FORK);
|
||||||
xfs_iext_remove(ifp, idx, 2);
|
xfs_iext_remove(ifp, idx, 2);
|
||||||
ip->i_df.if_lastex = idx - 1;
|
ip->i_df.if_lastex = idx - 1;
|
||||||
ip->i_d.di_nextents -= 2;
|
ip->i_d.di_nextents -= 2;
|
||||||
@ -1442,15 +1422,14 @@ xfs_bmap_add_extent_unwritten_real(
|
|||||||
* Setting all of a previous oldext extent to newext.
|
* Setting all of a previous oldext extent to newext.
|
||||||
* The left neighbor is contiguous, the right is not.
|
* The left neighbor is contiguous, the right is not.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "LF|RF|LC", ip, idx - 1,
|
XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|LC", ip, idx - 1,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
||||||
LEFT.br_blockcount + PREV.br_blockcount);
|
LEFT.br_blockcount + PREV.br_blockcount);
|
||||||
xfs_bmap_trace_post_update(fname, "LF|RF|LC", ip, idx - 1,
|
XFS_BMAP_TRACE_POST_UPDATE("LF|RF|LC", ip, idx - 1,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
ip->i_df.if_lastex = idx - 1;
|
ip->i_df.if_lastex = idx - 1;
|
||||||
xfs_bmap_trace_delete(fname, "LF|RF|LC", ip, idx, 1,
|
XFS_BMAP_TRACE_DELETE("LF|RF|LC", ip, idx, 1, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
xfs_iext_remove(ifp, idx, 1);
|
xfs_iext_remove(ifp, idx, 1);
|
||||||
ip->i_d.di_nextents--;
|
ip->i_d.di_nextents--;
|
||||||
if (cur == NULL)
|
if (cur == NULL)
|
||||||
@ -1485,16 +1464,15 @@ xfs_bmap_add_extent_unwritten_real(
|
|||||||
* Setting all of a previous oldext extent to newext.
|
* Setting all of a previous oldext extent to newext.
|
||||||
* The right neighbor is contiguous, the left is not.
|
* The right neighbor is contiguous, the left is not.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "LF|RF|RC", ip, idx,
|
XFS_BMAP_TRACE_PRE_UPDATE("LF|RF|RC", ip, idx,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_blockcount(ep,
|
xfs_bmbt_set_blockcount(ep,
|
||||||
PREV.br_blockcount + RIGHT.br_blockcount);
|
PREV.br_blockcount + RIGHT.br_blockcount);
|
||||||
xfs_bmbt_set_state(ep, newext);
|
xfs_bmbt_set_state(ep, newext);
|
||||||
xfs_bmap_trace_post_update(fname, "LF|RF|RC", ip, idx,
|
XFS_BMAP_TRACE_POST_UPDATE("LF|RF|RC", ip, idx,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
ip->i_df.if_lastex = idx;
|
ip->i_df.if_lastex = idx;
|
||||||
xfs_bmap_trace_delete(fname, "LF|RF|RC", ip, idx + 1, 1,
|
XFS_BMAP_TRACE_DELETE("LF|RF|RC", ip, idx + 1, 1, XFS_DATA_FORK);
|
||||||
XFS_DATA_FORK);
|
|
||||||
xfs_iext_remove(ifp, idx + 1, 1);
|
xfs_iext_remove(ifp, idx + 1, 1);
|
||||||
ip->i_d.di_nextents--;
|
ip->i_d.di_nextents--;
|
||||||
if (cur == NULL)
|
if (cur == NULL)
|
||||||
@ -1530,10 +1508,10 @@ xfs_bmap_add_extent_unwritten_real(
|
|||||||
* Neither the left nor right neighbors are contiguous with
|
* Neither the left nor right neighbors are contiguous with
|
||||||
* the new one.
|
* the new one.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "LF|RF", ip, idx,
|
XFS_BMAP_TRACE_PRE_UPDATE("LF|RF", ip, idx,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_state(ep, newext);
|
xfs_bmbt_set_state(ep, newext);
|
||||||
xfs_bmap_trace_post_update(fname, "LF|RF", ip, idx,
|
XFS_BMAP_TRACE_POST_UPDATE("LF|RF", ip, idx,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
ip->i_df.if_lastex = idx;
|
ip->i_df.if_lastex = idx;
|
||||||
if (cur == NULL)
|
if (cur == NULL)
|
||||||
@ -1560,21 +1538,21 @@ xfs_bmap_add_extent_unwritten_real(
|
|||||||
* Setting the first part of a previous oldext extent to newext.
|
* Setting the first part of a previous oldext extent to newext.
|
||||||
* The left neighbor is contiguous.
|
* The left neighbor is contiguous.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "LF|LC", ip, idx - 1,
|
XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx - 1,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
||||||
LEFT.br_blockcount + new->br_blockcount);
|
LEFT.br_blockcount + new->br_blockcount);
|
||||||
xfs_bmbt_set_startoff(ep,
|
xfs_bmbt_set_startoff(ep,
|
||||||
PREV.br_startoff + new->br_blockcount);
|
PREV.br_startoff + new->br_blockcount);
|
||||||
xfs_bmap_trace_post_update(fname, "LF|LC", ip, idx - 1,
|
XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx - 1,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_bmap_trace_pre_update(fname, "LF|LC", ip, idx,
|
XFS_BMAP_TRACE_PRE_UPDATE("LF|LC", ip, idx,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_startblock(ep,
|
xfs_bmbt_set_startblock(ep,
|
||||||
new->br_startblock + new->br_blockcount);
|
new->br_startblock + new->br_blockcount);
|
||||||
xfs_bmbt_set_blockcount(ep,
|
xfs_bmbt_set_blockcount(ep,
|
||||||
PREV.br_blockcount - new->br_blockcount);
|
PREV.br_blockcount - new->br_blockcount);
|
||||||
xfs_bmap_trace_post_update(fname, "LF|LC", ip, idx,
|
XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
ip->i_df.if_lastex = idx - 1;
|
ip->i_df.if_lastex = idx - 1;
|
||||||
if (cur == NULL)
|
if (cur == NULL)
|
||||||
@ -1611,15 +1589,15 @@ xfs_bmap_add_extent_unwritten_real(
|
|||||||
* Setting the first part of a previous oldext extent to newext.
|
* Setting the first part of a previous oldext extent to newext.
|
||||||
* The left neighbor is not contiguous.
|
* The left neighbor is not contiguous.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "LF", ip, idx, XFS_DATA_FORK);
|
XFS_BMAP_TRACE_PRE_UPDATE("LF", ip, idx, XFS_DATA_FORK);
|
||||||
ASSERT(ep && xfs_bmbt_get_state(ep) == oldext);
|
ASSERT(ep && xfs_bmbt_get_state(ep) == oldext);
|
||||||
xfs_bmbt_set_startoff(ep, new_endoff);
|
xfs_bmbt_set_startoff(ep, new_endoff);
|
||||||
xfs_bmbt_set_blockcount(ep,
|
xfs_bmbt_set_blockcount(ep,
|
||||||
PREV.br_blockcount - new->br_blockcount);
|
PREV.br_blockcount - new->br_blockcount);
|
||||||
xfs_bmbt_set_startblock(ep,
|
xfs_bmbt_set_startblock(ep,
|
||||||
new->br_startblock + new->br_blockcount);
|
new->br_startblock + new->br_blockcount);
|
||||||
xfs_bmap_trace_post_update(fname, "LF", ip, idx, XFS_DATA_FORK);
|
XFS_BMAP_TRACE_POST_UPDATE("LF", ip, idx, XFS_DATA_FORK);
|
||||||
xfs_bmap_trace_insert(fname, "LF", ip, idx, 1, new, NULL,
|
XFS_BMAP_TRACE_INSERT("LF", ip, idx, 1, new, NULL,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_iext_insert(ifp, idx, 1, new);
|
xfs_iext_insert(ifp, idx, 1, new);
|
||||||
ip->i_df.if_lastex = idx;
|
ip->i_df.if_lastex = idx;
|
||||||
@ -1654,18 +1632,18 @@ xfs_bmap_add_extent_unwritten_real(
|
|||||||
* Setting the last part of a previous oldext extent to newext.
|
* Setting the last part of a previous oldext extent to newext.
|
||||||
* The right neighbor is contiguous with the new allocation.
|
* The right neighbor is contiguous with the new allocation.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "RF|RC", ip, idx,
|
XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_bmap_trace_pre_update(fname, "RF|RC", ip, idx + 1,
|
XFS_BMAP_TRACE_PRE_UPDATE("RF|RC", ip, idx + 1,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_blockcount(ep,
|
xfs_bmbt_set_blockcount(ep,
|
||||||
PREV.br_blockcount - new->br_blockcount);
|
PREV.br_blockcount - new->br_blockcount);
|
||||||
xfs_bmap_trace_post_update(fname, "RF|RC", ip, idx,
|
XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_allf(xfs_iext_get_ext(ifp, idx + 1),
|
xfs_bmbt_set_allf(xfs_iext_get_ext(ifp, idx + 1),
|
||||||
new->br_startoff, new->br_startblock,
|
new->br_startoff, new->br_startblock,
|
||||||
new->br_blockcount + RIGHT.br_blockcount, newext);
|
new->br_blockcount + RIGHT.br_blockcount, newext);
|
||||||
xfs_bmap_trace_post_update(fname, "RF|RC", ip, idx + 1,
|
XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx + 1,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
ip->i_df.if_lastex = idx + 1;
|
ip->i_df.if_lastex = idx + 1;
|
||||||
if (cur == NULL)
|
if (cur == NULL)
|
||||||
@ -1701,12 +1679,12 @@ xfs_bmap_add_extent_unwritten_real(
|
|||||||
* Setting the last part of a previous oldext extent to newext.
|
* Setting the last part of a previous oldext extent to newext.
|
||||||
* The right neighbor is not contiguous.
|
* The right neighbor is not contiguous.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "RF", ip, idx, XFS_DATA_FORK);
|
XFS_BMAP_TRACE_PRE_UPDATE("RF", ip, idx, XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_blockcount(ep,
|
xfs_bmbt_set_blockcount(ep,
|
||||||
PREV.br_blockcount - new->br_blockcount);
|
PREV.br_blockcount - new->br_blockcount);
|
||||||
xfs_bmap_trace_post_update(fname, "RF", ip, idx, XFS_DATA_FORK);
|
XFS_BMAP_TRACE_POST_UPDATE("RF", ip, idx, XFS_DATA_FORK);
|
||||||
xfs_bmap_trace_insert(fname, "RF", ip, idx + 1, 1,
|
XFS_BMAP_TRACE_INSERT("RF", ip, idx + 1, 1, new, NULL,
|
||||||
new, NULL, XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_iext_insert(ifp, idx + 1, 1, new);
|
xfs_iext_insert(ifp, idx + 1, 1, new);
|
||||||
ip->i_df.if_lastex = idx + 1;
|
ip->i_df.if_lastex = idx + 1;
|
||||||
ip->i_d.di_nextents++;
|
ip->i_d.di_nextents++;
|
||||||
@ -1745,17 +1723,17 @@ xfs_bmap_add_extent_unwritten_real(
|
|||||||
* newext. Contiguity is impossible here.
|
* newext. Contiguity is impossible here.
|
||||||
* One extent becomes three extents.
|
* One extent becomes three extents.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "0", ip, idx, XFS_DATA_FORK);
|
XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx, XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_blockcount(ep,
|
xfs_bmbt_set_blockcount(ep,
|
||||||
new->br_startoff - PREV.br_startoff);
|
new->br_startoff - PREV.br_startoff);
|
||||||
xfs_bmap_trace_post_update(fname, "0", ip, idx, XFS_DATA_FORK);
|
XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx, XFS_DATA_FORK);
|
||||||
r[0] = *new;
|
r[0] = *new;
|
||||||
r[1].br_startoff = new_endoff;
|
r[1].br_startoff = new_endoff;
|
||||||
r[1].br_blockcount =
|
r[1].br_blockcount =
|
||||||
PREV.br_startoff + PREV.br_blockcount - new_endoff;
|
PREV.br_startoff + PREV.br_blockcount - new_endoff;
|
||||||
r[1].br_startblock = new->br_startblock + new->br_blockcount;
|
r[1].br_startblock = new->br_startblock + new->br_blockcount;
|
||||||
r[1].br_state = oldext;
|
r[1].br_state = oldext;
|
||||||
xfs_bmap_trace_insert(fname, "0", ip, idx + 1, 2, &r[0], &r[1],
|
XFS_BMAP_TRACE_INSERT("0", ip, idx + 1, 2, &r[0], &r[1],
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_iext_insert(ifp, idx + 1, 2, &r[0]);
|
xfs_iext_insert(ifp, idx + 1, 2, &r[0]);
|
||||||
ip->i_df.if_lastex = idx + 1;
|
ip->i_df.if_lastex = idx + 1;
|
||||||
@ -1846,9 +1824,6 @@ xfs_bmap_add_extent_hole_delay(
|
|||||||
int rsvd) /* OK to allocate reserved blocks */
|
int rsvd) /* OK to allocate reserved blocks */
|
||||||
{
|
{
|
||||||
xfs_bmbt_rec_t *ep; /* extent record for idx */
|
xfs_bmbt_rec_t *ep; /* extent record for idx */
|
||||||
#ifdef XFS_BMAP_TRACE
|
|
||||||
static char fname[] = "xfs_bmap_add_extent_hole_delay";
|
|
||||||
#endif
|
|
||||||
xfs_ifork_t *ifp; /* inode fork pointer */
|
xfs_ifork_t *ifp; /* inode fork pointer */
|
||||||
xfs_bmbt_irec_t left; /* left neighbor extent entry */
|
xfs_bmbt_irec_t left; /* left neighbor extent entry */
|
||||||
xfs_filblks_t newlen=0; /* new indirect size */
|
xfs_filblks_t newlen=0; /* new indirect size */
|
||||||
@ -1920,7 +1895,7 @@ xfs_bmap_add_extent_hole_delay(
|
|||||||
*/
|
*/
|
||||||
temp = left.br_blockcount + new->br_blockcount +
|
temp = left.br_blockcount + new->br_blockcount +
|
||||||
right.br_blockcount;
|
right.br_blockcount;
|
||||||
xfs_bmap_trace_pre_update(fname, "LC|RC", ip, idx - 1,
|
XFS_BMAP_TRACE_PRE_UPDATE("LC|RC", ip, idx - 1,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), temp);
|
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), temp);
|
||||||
oldlen = STARTBLOCKVAL(left.br_startblock) +
|
oldlen = STARTBLOCKVAL(left.br_startblock) +
|
||||||
@ -1929,10 +1904,9 @@ xfs_bmap_add_extent_hole_delay(
|
|||||||
newlen = xfs_bmap_worst_indlen(ip, temp);
|
newlen = xfs_bmap_worst_indlen(ip, temp);
|
||||||
xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx - 1),
|
xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx - 1),
|
||||||
NULLSTARTBLOCK((int)newlen));
|
NULLSTARTBLOCK((int)newlen));
|
||||||
xfs_bmap_trace_post_update(fname, "LC|RC", ip, idx - 1,
|
XFS_BMAP_TRACE_POST_UPDATE("LC|RC", ip, idx - 1,
|
||||||
XFS_DATA_FORK);
|
|
||||||
xfs_bmap_trace_delete(fname, "LC|RC", ip, idx, 1,
|
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
|
XFS_BMAP_TRACE_DELETE("LC|RC", ip, idx, 1, XFS_DATA_FORK);
|
||||||
xfs_iext_remove(ifp, idx, 1);
|
xfs_iext_remove(ifp, idx, 1);
|
||||||
ip->i_df.if_lastex = idx - 1;
|
ip->i_df.if_lastex = idx - 1;
|
||||||
/* DELTA: Two in-core extents were replaced by one. */
|
/* DELTA: Two in-core extents were replaced by one. */
|
||||||
@ -1947,7 +1921,7 @@ xfs_bmap_add_extent_hole_delay(
|
|||||||
* Merge the new allocation with the left neighbor.
|
* Merge the new allocation with the left neighbor.
|
||||||
*/
|
*/
|
||||||
temp = left.br_blockcount + new->br_blockcount;
|
temp = left.br_blockcount + new->br_blockcount;
|
||||||
xfs_bmap_trace_pre_update(fname, "LC", ip, idx - 1,
|
XFS_BMAP_TRACE_PRE_UPDATE("LC", ip, idx - 1,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), temp);
|
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), temp);
|
||||||
oldlen = STARTBLOCKVAL(left.br_startblock) +
|
oldlen = STARTBLOCKVAL(left.br_startblock) +
|
||||||
@ -1955,7 +1929,7 @@ xfs_bmap_add_extent_hole_delay(
|
|||||||
newlen = xfs_bmap_worst_indlen(ip, temp);
|
newlen = xfs_bmap_worst_indlen(ip, temp);
|
||||||
xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx - 1),
|
xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx - 1),
|
||||||
NULLSTARTBLOCK((int)newlen));
|
NULLSTARTBLOCK((int)newlen));
|
||||||
xfs_bmap_trace_post_update(fname, "LC", ip, idx - 1,
|
XFS_BMAP_TRACE_POST_UPDATE("LC", ip, idx - 1,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
ip->i_df.if_lastex = idx - 1;
|
ip->i_df.if_lastex = idx - 1;
|
||||||
/* DELTA: One in-core extent grew into a hole. */
|
/* DELTA: One in-core extent grew into a hole. */
|
||||||
@ -1969,14 +1943,14 @@ xfs_bmap_add_extent_hole_delay(
|
|||||||
* on the right.
|
* on the right.
|
||||||
* Merge the new allocation with the right neighbor.
|
* Merge the new allocation with the right neighbor.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "RC", ip, idx, XFS_DATA_FORK);
|
XFS_BMAP_TRACE_PRE_UPDATE("RC", ip, idx, XFS_DATA_FORK);
|
||||||
temp = new->br_blockcount + right.br_blockcount;
|
temp = new->br_blockcount + right.br_blockcount;
|
||||||
oldlen = STARTBLOCKVAL(new->br_startblock) +
|
oldlen = STARTBLOCKVAL(new->br_startblock) +
|
||||||
STARTBLOCKVAL(right.br_startblock);
|
STARTBLOCKVAL(right.br_startblock);
|
||||||
newlen = xfs_bmap_worst_indlen(ip, temp);
|
newlen = xfs_bmap_worst_indlen(ip, temp);
|
||||||
xfs_bmbt_set_allf(ep, new->br_startoff,
|
xfs_bmbt_set_allf(ep, new->br_startoff,
|
||||||
NULLSTARTBLOCK((int)newlen), temp, right.br_state);
|
NULLSTARTBLOCK((int)newlen), temp, right.br_state);
|
||||||
xfs_bmap_trace_post_update(fname, "RC", ip, idx, XFS_DATA_FORK);
|
XFS_BMAP_TRACE_POST_UPDATE("RC", ip, idx, XFS_DATA_FORK);
|
||||||
ip->i_df.if_lastex = idx;
|
ip->i_df.if_lastex = idx;
|
||||||
/* DELTA: One in-core extent grew into a hole. */
|
/* DELTA: One in-core extent grew into a hole. */
|
||||||
temp2 = temp;
|
temp2 = temp;
|
||||||
@ -1990,7 +1964,7 @@ xfs_bmap_add_extent_hole_delay(
|
|||||||
* Insert a new entry.
|
* Insert a new entry.
|
||||||
*/
|
*/
|
||||||
oldlen = newlen = 0;
|
oldlen = newlen = 0;
|
||||||
xfs_bmap_trace_insert(fname, "0", ip, idx, 1, new, NULL,
|
XFS_BMAP_TRACE_INSERT("0", ip, idx, 1, new, NULL,
|
||||||
XFS_DATA_FORK);
|
XFS_DATA_FORK);
|
||||||
xfs_iext_insert(ifp, idx, 1, new);
|
xfs_iext_insert(ifp, idx, 1, new);
|
||||||
ip->i_df.if_lastex = idx;
|
ip->i_df.if_lastex = idx;
|
||||||
@ -2040,9 +2014,6 @@ xfs_bmap_add_extent_hole_real(
|
|||||||
{
|
{
|
||||||
xfs_bmbt_rec_t *ep; /* pointer to extent entry ins. point */
|
xfs_bmbt_rec_t *ep; /* pointer to extent entry ins. point */
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_BMAP_TRACE
|
|
||||||
static char fname[] = "xfs_bmap_add_extent_hole_real";
|
|
||||||
#endif
|
|
||||||
int i; /* temp state */
|
int i; /* temp state */
|
||||||
xfs_ifork_t *ifp; /* inode fork pointer */
|
xfs_ifork_t *ifp; /* inode fork pointer */
|
||||||
xfs_bmbt_irec_t left; /* left neighbor extent entry */
|
xfs_bmbt_irec_t left; /* left neighbor extent entry */
|
||||||
@ -2119,15 +2090,14 @@ xfs_bmap_add_extent_hole_real(
|
|||||||
* left and on the right.
|
* left and on the right.
|
||||||
* Merge all three into a single extent record.
|
* Merge all three into a single extent record.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "LC|RC", ip, idx - 1,
|
XFS_BMAP_TRACE_PRE_UPDATE("LC|RC", ip, idx - 1,
|
||||||
whichfork);
|
whichfork);
|
||||||
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
||||||
left.br_blockcount + new->br_blockcount +
|
left.br_blockcount + new->br_blockcount +
|
||||||
right.br_blockcount);
|
right.br_blockcount);
|
||||||
xfs_bmap_trace_post_update(fname, "LC|RC", ip, idx - 1,
|
XFS_BMAP_TRACE_POST_UPDATE("LC|RC", ip, idx - 1,
|
||||||
whichfork);
|
whichfork);
|
||||||
xfs_bmap_trace_delete(fname, "LC|RC", ip,
|
XFS_BMAP_TRACE_DELETE("LC|RC", ip, idx, 1, whichfork);
|
||||||
idx, 1, whichfork);
|
|
||||||
xfs_iext_remove(ifp, idx, 1);
|
xfs_iext_remove(ifp, idx, 1);
|
||||||
ifp->if_lastex = idx - 1;
|
ifp->if_lastex = idx - 1;
|
||||||
XFS_IFORK_NEXT_SET(ip, whichfork,
|
XFS_IFORK_NEXT_SET(ip, whichfork,
|
||||||
@ -2169,10 +2139,10 @@ xfs_bmap_add_extent_hole_real(
|
|||||||
* on the left.
|
* on the left.
|
||||||
* Merge the new allocation with the left neighbor.
|
* Merge the new allocation with the left neighbor.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "LC", ip, idx - 1, whichfork);
|
XFS_BMAP_TRACE_PRE_UPDATE("LC", ip, idx - 1, whichfork);
|
||||||
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1),
|
||||||
left.br_blockcount + new->br_blockcount);
|
left.br_blockcount + new->br_blockcount);
|
||||||
xfs_bmap_trace_post_update(fname, "LC", ip, idx - 1, whichfork);
|
XFS_BMAP_TRACE_POST_UPDATE("LC", ip, idx - 1, whichfork);
|
||||||
ifp->if_lastex = idx - 1;
|
ifp->if_lastex = idx - 1;
|
||||||
if (cur == NULL) {
|
if (cur == NULL) {
|
||||||
rval = XFS_ILOG_FEXT(whichfork);
|
rval = XFS_ILOG_FEXT(whichfork);
|
||||||
@ -2203,11 +2173,11 @@ xfs_bmap_add_extent_hole_real(
|
|||||||
* on the right.
|
* on the right.
|
||||||
* Merge the new allocation with the right neighbor.
|
* Merge the new allocation with the right neighbor.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "RC", ip, idx, whichfork);
|
XFS_BMAP_TRACE_PRE_UPDATE("RC", ip, idx, whichfork);
|
||||||
xfs_bmbt_set_allf(ep, new->br_startoff, new->br_startblock,
|
xfs_bmbt_set_allf(ep, new->br_startoff, new->br_startblock,
|
||||||
new->br_blockcount + right.br_blockcount,
|
new->br_blockcount + right.br_blockcount,
|
||||||
right.br_state);
|
right.br_state);
|
||||||
xfs_bmap_trace_post_update(fname, "RC", ip, idx, whichfork);
|
XFS_BMAP_TRACE_POST_UPDATE("RC", ip, idx, whichfork);
|
||||||
ifp->if_lastex = idx;
|
ifp->if_lastex = idx;
|
||||||
if (cur == NULL) {
|
if (cur == NULL) {
|
||||||
rval = XFS_ILOG_FEXT(whichfork);
|
rval = XFS_ILOG_FEXT(whichfork);
|
||||||
@ -2238,8 +2208,7 @@ xfs_bmap_add_extent_hole_real(
|
|||||||
* real allocation.
|
* real allocation.
|
||||||
* Insert a new entry.
|
* Insert a new entry.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_insert(fname, "0", ip, idx, 1, new, NULL,
|
XFS_BMAP_TRACE_INSERT("0", ip, idx, 1, new, NULL, whichfork);
|
||||||
whichfork);
|
|
||||||
xfs_iext_insert(ifp, idx, 1, new);
|
xfs_iext_insert(ifp, idx, 1, new);
|
||||||
ifp->if_lastex = idx;
|
ifp->if_lastex = idx;
|
||||||
XFS_IFORK_NEXT_SET(ip, whichfork,
|
XFS_IFORK_NEXT_SET(ip, whichfork,
|
||||||
@ -3104,9 +3073,6 @@ xfs_bmap_del_extent(
|
|||||||
xfs_bmbt_rec_t *ep; /* current extent entry pointer */
|
xfs_bmbt_rec_t *ep; /* current extent entry pointer */
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
int flags; /* inode logging flags */
|
int flags; /* inode logging flags */
|
||||||
#ifdef XFS_BMAP_TRACE
|
|
||||||
static char fname[] = "xfs_bmap_del_extent";
|
|
||||||
#endif
|
|
||||||
xfs_bmbt_irec_t got; /* current extent entry */
|
xfs_bmbt_irec_t got; /* current extent entry */
|
||||||
xfs_fileoff_t got_endoff; /* first offset past got */
|
xfs_fileoff_t got_endoff; /* first offset past got */
|
||||||
int i; /* temp state */
|
int i; /* temp state */
|
||||||
@ -3200,7 +3166,7 @@ xfs_bmap_del_extent(
|
|||||||
/*
|
/*
|
||||||
* Matches the whole extent. Delete the entry.
|
* Matches the whole extent. Delete the entry.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_delete(fname, "3", ip, idx, 1, whichfork);
|
XFS_BMAP_TRACE_DELETE("3", ip, idx, 1, whichfork);
|
||||||
xfs_iext_remove(ifp, idx, 1);
|
xfs_iext_remove(ifp, idx, 1);
|
||||||
ifp->if_lastex = idx;
|
ifp->if_lastex = idx;
|
||||||
if (delay)
|
if (delay)
|
||||||
@ -3221,7 +3187,7 @@ xfs_bmap_del_extent(
|
|||||||
/*
|
/*
|
||||||
* Deleting the first part of the extent.
|
* Deleting the first part of the extent.
|
||||||
*/
|
*/
|
||||||
xfs_bmap_trace_pre_update(fname, "2", ip, idx, whichfork);
|
XFS_BMAP_TRACE_PRE_UPDATE("2", ip, idx, whichfork);
|
||||||
xfs_bmbt_set_startoff(ep, del_endoff);
|
xfs_bmbt_set_startoff(ep, del_endoff);
|
||||||
temp = got.br_blockcount - del->br_blockcount;
|
temp = got.br_blockcount - del->br_blockcount;
|
||||||
xfs_bmbt_set_blockcount(ep, temp);
|
xfs_bmbt_set_blockcount(ep, temp);
|
||||||
@ -3230,13 +3196,13 @@ xfs_bmap_del_extent(
|
|||||||
temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp),
|
temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp),
|
||||||
da_old);
|
da_old);
|
||||||
xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
|
xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
|
||||||
xfs_bmap_trace_post_update(fname, "2", ip, idx,
|
XFS_BMAP_TRACE_POST_UPDATE("2", ip, idx,
|
||||||
whichfork);
|
whichfork);
|
||||||
da_new = temp;
|
da_new = temp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
xfs_bmbt_set_startblock(ep, del_endblock);
|
xfs_bmbt_set_startblock(ep, del_endblock);
|
||||||
xfs_bmap_trace_post_update(fname, "2", ip, idx, whichfork);
|
XFS_BMAP_TRACE_POST_UPDATE("2", ip, idx, whichfork);
|
||||||
if (!cur) {
|
if (!cur) {
|
||||||
flags |= XFS_ILOG_FEXT(whichfork);
|
flags |= XFS_ILOG_FEXT(whichfork);
|
||||||
break;
|
break;
|
||||||
@ -3252,19 +3218,19 @@ xfs_bmap_del_extent(
|
|||||||
* Deleting the last part of the extent.
|
* Deleting the last part of the extent.
|
||||||
*/
|
*/
|
||||||
temp = got.br_blockcount - del->br_blockcount;
|
temp = got.br_blockcount - del->br_blockcount;
|
||||||
xfs_bmap_trace_pre_update(fname, "1", ip, idx, whichfork);
|
XFS_BMAP_TRACE_PRE_UPDATE("1", ip, idx, whichfork);
|
||||||
xfs_bmbt_set_blockcount(ep, temp);
|
xfs_bmbt_set_blockcount(ep, temp);
|
||||||
ifp->if_lastex = idx;
|
ifp->if_lastex = idx;
|
||||||
if (delay) {
|
if (delay) {
|
||||||
temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp),
|
temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp),
|
||||||
da_old);
|
da_old);
|
||||||
xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
|
xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp));
|
||||||
xfs_bmap_trace_post_update(fname, "1", ip, idx,
|
XFS_BMAP_TRACE_POST_UPDATE("1", ip, idx,
|
||||||
whichfork);
|
whichfork);
|
||||||
da_new = temp;
|
da_new = temp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
xfs_bmap_trace_post_update(fname, "1", ip, idx, whichfork);
|
XFS_BMAP_TRACE_POST_UPDATE("1", ip, idx, whichfork);
|
||||||
if (!cur) {
|
if (!cur) {
|
||||||
flags |= XFS_ILOG_FEXT(whichfork);
|
flags |= XFS_ILOG_FEXT(whichfork);
|
||||||
break;
|
break;
|
||||||
@ -3281,7 +3247,7 @@ xfs_bmap_del_extent(
|
|||||||
* Deleting the middle of the extent.
|
* Deleting the middle of the extent.
|
||||||
*/
|
*/
|
||||||
temp = del->br_startoff - got.br_startoff;
|
temp = del->br_startoff - got.br_startoff;
|
||||||
xfs_bmap_trace_pre_update(fname, "0", ip, idx, whichfork);
|
XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx, whichfork);
|
||||||
xfs_bmbt_set_blockcount(ep, temp);
|
xfs_bmbt_set_blockcount(ep, temp);
|
||||||
new.br_startoff = del_endoff;
|
new.br_startoff = del_endoff;
|
||||||
temp2 = got_endoff - del_endoff;
|
temp2 = got_endoff - del_endoff;
|
||||||
@ -3368,8 +3334,8 @@ xfs_bmap_del_extent(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xfs_bmap_trace_post_update(fname, "0", ip, idx, whichfork);
|
XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx, whichfork);
|
||||||
xfs_bmap_trace_insert(fname, "0", ip, idx + 1, 1, &new, NULL,
|
XFS_BMAP_TRACE_INSERT("0", ip, idx + 1, 1, &new, NULL,
|
||||||
whichfork);
|
whichfork);
|
||||||
xfs_iext_insert(ifp, idx + 1, 1, &new);
|
xfs_iext_insert(ifp, idx + 1, 1, &new);
|
||||||
ifp->if_lastex = idx + 1;
|
ifp->if_lastex = idx + 1;
|
||||||
@ -3609,9 +3575,6 @@ xfs_bmap_local_to_extents(
|
|||||||
{
|
{
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
int flags; /* logging flags returned */
|
int flags; /* logging flags returned */
|
||||||
#ifdef XFS_BMAP_TRACE
|
|
||||||
static char fname[] = "xfs_bmap_local_to_extents";
|
|
||||||
#endif
|
|
||||||
xfs_ifork_t *ifp; /* inode fork pointer */
|
xfs_ifork_t *ifp; /* inode fork pointer */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -3666,7 +3629,7 @@ xfs_bmap_local_to_extents(
|
|||||||
xfs_iext_add(ifp, 0, 1);
|
xfs_iext_add(ifp, 0, 1);
|
||||||
ep = xfs_iext_get_ext(ifp, 0);
|
ep = xfs_iext_get_ext(ifp, 0);
|
||||||
xfs_bmbt_set_allf(ep, 0, args.fsbno, 1, XFS_EXT_NORM);
|
xfs_bmbt_set_allf(ep, 0, args.fsbno, 1, XFS_EXT_NORM);
|
||||||
xfs_bmap_trace_post_update(fname, "new", ip, 0, whichfork);
|
XFS_BMAP_TRACE_POST_UPDATE("new", ip, 0, whichfork);
|
||||||
XFS_IFORK_NEXT_SET(ip, whichfork, 1);
|
XFS_IFORK_NEXT_SET(ip, whichfork, 1);
|
||||||
ip->i_d.di_nblocks = 1;
|
ip->i_d.di_nblocks = 1;
|
||||||
XFS_TRANS_MOD_DQUOT_BYINO(args.mp, tp, ip,
|
XFS_TRANS_MOD_DQUOT_BYINO(args.mp, tp, ip,
|
||||||
@ -3789,7 +3752,7 @@ ktrace_t *xfs_bmap_trace_buf;
|
|||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmap_trace_addentry(
|
xfs_bmap_trace_addentry(
|
||||||
int opcode, /* operation */
|
int opcode, /* operation */
|
||||||
char *fname, /* function name */
|
const char *fname, /* function name */
|
||||||
char *desc, /* operation description */
|
char *desc, /* operation description */
|
||||||
xfs_inode_t *ip, /* incore inode pointer */
|
xfs_inode_t *ip, /* incore inode pointer */
|
||||||
xfs_extnum_t idx, /* index of entry(ies) */
|
xfs_extnum_t idx, /* index of entry(ies) */
|
||||||
@ -3848,7 +3811,7 @@ xfs_bmap_trace_addentry(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmap_trace_delete(
|
xfs_bmap_trace_delete(
|
||||||
char *fname, /* function name */
|
const char *fname, /* function name */
|
||||||
char *desc, /* operation description */
|
char *desc, /* operation description */
|
||||||
xfs_inode_t *ip, /* incore inode pointer */
|
xfs_inode_t *ip, /* incore inode pointer */
|
||||||
xfs_extnum_t idx, /* index of entry(entries) deleted */
|
xfs_extnum_t idx, /* index of entry(entries) deleted */
|
||||||
@ -3870,7 +3833,7 @@ xfs_bmap_trace_delete(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmap_trace_insert(
|
xfs_bmap_trace_insert(
|
||||||
char *fname, /* function name */
|
const char *fname, /* function name */
|
||||||
char *desc, /* operation description */
|
char *desc, /* operation description */
|
||||||
xfs_inode_t *ip, /* incore inode pointer */
|
xfs_inode_t *ip, /* incore inode pointer */
|
||||||
xfs_extnum_t idx, /* index of entry(entries) inserted */
|
xfs_extnum_t idx, /* index of entry(entries) inserted */
|
||||||
@ -3899,7 +3862,7 @@ xfs_bmap_trace_insert(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmap_trace_post_update(
|
xfs_bmap_trace_post_update(
|
||||||
char *fname, /* function name */
|
const char *fname, /* function name */
|
||||||
char *desc, /* operation description */
|
char *desc, /* operation description */
|
||||||
xfs_inode_t *ip, /* incore inode pointer */
|
xfs_inode_t *ip, /* incore inode pointer */
|
||||||
xfs_extnum_t idx, /* index of entry updated */
|
xfs_extnum_t idx, /* index of entry updated */
|
||||||
@ -3917,7 +3880,7 @@ xfs_bmap_trace_post_update(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmap_trace_pre_update(
|
xfs_bmap_trace_pre_update(
|
||||||
char *fname, /* function name */
|
const char *fname, /* function name */
|
||||||
char *desc, /* operation description */
|
char *desc, /* operation description */
|
||||||
xfs_inode_t *ip, /* incore inode pointer */
|
xfs_inode_t *ip, /* incore inode pointer */
|
||||||
xfs_extnum_t idx, /* index of entry to be updated */
|
xfs_extnum_t idx, /* index of entry to be updated */
|
||||||
@ -4534,9 +4497,6 @@ xfs_bmap_read_extents(
|
|||||||
xfs_buf_t *bp; /* buffer for "block" */
|
xfs_buf_t *bp; /* buffer for "block" */
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
xfs_exntfmt_t exntf; /* XFS_EXTFMT_NOSTATE, if checking */
|
xfs_exntfmt_t exntf; /* XFS_EXTFMT_NOSTATE, if checking */
|
||||||
#ifdef XFS_BMAP_TRACE
|
|
||||||
static char fname[] = "xfs_bmap_read_extents";
|
|
||||||
#endif
|
|
||||||
xfs_extnum_t i, j; /* index into the extents list */
|
xfs_extnum_t i, j; /* index into the extents list */
|
||||||
xfs_ifork_t *ifp; /* fork structure */
|
xfs_ifork_t *ifp; /* fork structure */
|
||||||
int level; /* btree level, for checking */
|
int level; /* btree level, for checking */
|
||||||
@ -4653,7 +4613,7 @@ xfs_bmap_read_extents(
|
|||||||
}
|
}
|
||||||
ASSERT(i == (ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t)));
|
ASSERT(i == (ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t)));
|
||||||
ASSERT(i == XFS_IFORK_NEXTENTS(ip, whichfork));
|
ASSERT(i == XFS_IFORK_NEXTENTS(ip, whichfork));
|
||||||
xfs_bmap_trace_exlist(fname, ip, i, whichfork);
|
XFS_BMAP_TRACE_EXLIST(ip, i, whichfork);
|
||||||
return 0;
|
return 0;
|
||||||
error0:
|
error0:
|
||||||
xfs_trans_brelse(tp, bp);
|
xfs_trans_brelse(tp, bp);
|
||||||
@ -4666,7 +4626,7 @@ error0:
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
xfs_bmap_trace_exlist(
|
xfs_bmap_trace_exlist(
|
||||||
char *fname, /* function name */
|
const char *fname, /* function name */
|
||||||
xfs_inode_t *ip, /* incore inode pointer */
|
xfs_inode_t *ip, /* incore inode pointer */
|
||||||
xfs_extnum_t cnt, /* count of entries in the list */
|
xfs_extnum_t cnt, /* count of entries in the list */
|
||||||
int whichfork) /* data or attr fork */
|
int whichfork) /* data or attr fork */
|
||||||
@ -4681,7 +4641,7 @@ xfs_bmap_trace_exlist(
|
|||||||
for (idx = 0; idx < cnt; idx++) {
|
for (idx = 0; idx < cnt; idx++) {
|
||||||
ep = xfs_iext_get_ext(ifp, idx);
|
ep = xfs_iext_get_ext(ifp, idx);
|
||||||
xfs_bmbt_get_all(ep, &s);
|
xfs_bmbt_get_all(ep, &s);
|
||||||
xfs_bmap_trace_insert(fname, "exlist", ip, idx, 1, &s, NULL,
|
XFS_BMAP_TRACE_INSERT("exlist", ip, idx, 1, &s, NULL,
|
||||||
whichfork);
|
whichfork);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -144,12 +144,14 @@ extern ktrace_t *xfs_bmap_trace_buf;
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
xfs_bmap_trace_exlist(
|
xfs_bmap_trace_exlist(
|
||||||
char *fname, /* function name */
|
const char *fname, /* function name */
|
||||||
struct xfs_inode *ip, /* incore inode pointer */
|
struct xfs_inode *ip, /* incore inode pointer */
|
||||||
xfs_extnum_t cnt, /* count of entries in list */
|
xfs_extnum_t cnt, /* count of entries in list */
|
||||||
int whichfork); /* data or attr fork */
|
int whichfork); /* data or attr fork */
|
||||||
|
#define XFS_BMAP_TRACE_EXLIST(ip,c,w) \
|
||||||
|
xfs_bmap_trace_exlist(__FUNCTION__,ip,c,w)
|
||||||
#else
|
#else
|
||||||
#define xfs_bmap_trace_exlist(f,ip,c,w)
|
#define XFS_BMAP_TRACE_EXLIST(ip,c,w)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -76,7 +76,7 @@ static char EXIT[] = "exit";
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmbt_trace_enter(
|
xfs_bmbt_trace_enter(
|
||||||
char *func,
|
const char *func,
|
||||||
xfs_btree_cur_t *cur,
|
xfs_btree_cur_t *cur,
|
||||||
char *s,
|
char *s,
|
||||||
int type,
|
int type,
|
||||||
@ -117,7 +117,7 @@ xfs_bmbt_trace_enter(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmbt_trace_argbi(
|
xfs_bmbt_trace_argbi(
|
||||||
char *func,
|
const char *func,
|
||||||
xfs_btree_cur_t *cur,
|
xfs_btree_cur_t *cur,
|
||||||
xfs_buf_t *b,
|
xfs_buf_t *b,
|
||||||
int i,
|
int i,
|
||||||
@ -134,7 +134,7 @@ xfs_bmbt_trace_argbi(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmbt_trace_argbii(
|
xfs_bmbt_trace_argbii(
|
||||||
char *func,
|
const char *func,
|
||||||
xfs_btree_cur_t *cur,
|
xfs_btree_cur_t *cur,
|
||||||
xfs_buf_t *b,
|
xfs_buf_t *b,
|
||||||
int i0,
|
int i0,
|
||||||
@ -153,7 +153,7 @@ xfs_bmbt_trace_argbii(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmbt_trace_argfffi(
|
xfs_bmbt_trace_argfffi(
|
||||||
char *func,
|
const char *func,
|
||||||
xfs_btree_cur_t *cur,
|
xfs_btree_cur_t *cur,
|
||||||
xfs_dfiloff_t o,
|
xfs_dfiloff_t o,
|
||||||
xfs_dfsbno_t b,
|
xfs_dfsbno_t b,
|
||||||
@ -172,7 +172,7 @@ xfs_bmbt_trace_argfffi(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmbt_trace_argi(
|
xfs_bmbt_trace_argi(
|
||||||
char *func,
|
const char *func,
|
||||||
xfs_btree_cur_t *cur,
|
xfs_btree_cur_t *cur,
|
||||||
int i,
|
int i,
|
||||||
int line)
|
int line)
|
||||||
@ -188,7 +188,7 @@ xfs_bmbt_trace_argi(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmbt_trace_argifk(
|
xfs_bmbt_trace_argifk(
|
||||||
char *func,
|
const char *func,
|
||||||
xfs_btree_cur_t *cur,
|
xfs_btree_cur_t *cur,
|
||||||
int i,
|
int i,
|
||||||
xfs_fsblock_t f,
|
xfs_fsblock_t f,
|
||||||
@ -206,7 +206,7 @@ xfs_bmbt_trace_argifk(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmbt_trace_argifr(
|
xfs_bmbt_trace_argifr(
|
||||||
char *func,
|
const char *func,
|
||||||
xfs_btree_cur_t *cur,
|
xfs_btree_cur_t *cur,
|
||||||
int i,
|
int i,
|
||||||
xfs_fsblock_t f,
|
xfs_fsblock_t f,
|
||||||
@ -235,7 +235,7 @@ xfs_bmbt_trace_argifr(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmbt_trace_argik(
|
xfs_bmbt_trace_argik(
|
||||||
char *func,
|
const char *func,
|
||||||
xfs_btree_cur_t *cur,
|
xfs_btree_cur_t *cur,
|
||||||
int i,
|
int i,
|
||||||
xfs_bmbt_key_t *k,
|
xfs_bmbt_key_t *k,
|
||||||
@ -255,7 +255,7 @@ xfs_bmbt_trace_argik(
|
|||||||
*/
|
*/
|
||||||
STATIC void
|
STATIC void
|
||||||
xfs_bmbt_trace_cursor(
|
xfs_bmbt_trace_cursor(
|
||||||
char *func,
|
const char *func,
|
||||||
xfs_btree_cur_t *cur,
|
xfs_btree_cur_t *cur,
|
||||||
char *s,
|
char *s,
|
||||||
int line)
|
int line)
|
||||||
@ -274,21 +274,21 @@ xfs_bmbt_trace_cursor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define XFS_BMBT_TRACE_ARGBI(c,b,i) \
|
#define XFS_BMBT_TRACE_ARGBI(c,b,i) \
|
||||||
xfs_bmbt_trace_argbi(fname, c, b, i, __LINE__)
|
xfs_bmbt_trace_argbi(__FUNCTION__, c, b, i, __LINE__)
|
||||||
#define XFS_BMBT_TRACE_ARGBII(c,b,i,j) \
|
#define XFS_BMBT_TRACE_ARGBII(c,b,i,j) \
|
||||||
xfs_bmbt_trace_argbii(fname, c, b, i, j, __LINE__)
|
xfs_bmbt_trace_argbii(__FUNCTION__, c, b, i, j, __LINE__)
|
||||||
#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) \
|
#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) \
|
||||||
xfs_bmbt_trace_argfffi(fname, c, o, b, i, j, __LINE__)
|
xfs_bmbt_trace_argfffi(__FUNCTION__, c, o, b, i, j, __LINE__)
|
||||||
#define XFS_BMBT_TRACE_ARGI(c,i) \
|
#define XFS_BMBT_TRACE_ARGI(c,i) \
|
||||||
xfs_bmbt_trace_argi(fname, c, i, __LINE__)
|
xfs_bmbt_trace_argi(__FUNCTION__, c, i, __LINE__)
|
||||||
#define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) \
|
#define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) \
|
||||||
xfs_bmbt_trace_argifk(fname, c, i, f, s, __LINE__)
|
xfs_bmbt_trace_argifk(__FUNCTION__, c, i, f, s, __LINE__)
|
||||||
#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) \
|
#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) \
|
||||||
xfs_bmbt_trace_argifr(fname, c, i, f, r, __LINE__)
|
xfs_bmbt_trace_argifr(__FUNCTION__, c, i, f, r, __LINE__)
|
||||||
#define XFS_BMBT_TRACE_ARGIK(c,i,k) \
|
#define XFS_BMBT_TRACE_ARGIK(c,i,k) \
|
||||||
xfs_bmbt_trace_argik(fname, c, i, k, __LINE__)
|
xfs_bmbt_trace_argik(__FUNCTION__, c, i, k, __LINE__)
|
||||||
#define XFS_BMBT_TRACE_CURSOR(c,s) \
|
#define XFS_BMBT_TRACE_CURSOR(c,s) \
|
||||||
xfs_bmbt_trace_cursor(fname, c, s, __LINE__)
|
xfs_bmbt_trace_cursor(__FUNCTION__, c, s, __LINE__)
|
||||||
#else
|
#else
|
||||||
#define XFS_BMBT_TRACE_ARGBI(c,b,i)
|
#define XFS_BMBT_TRACE_ARGBI(c,b,i)
|
||||||
#define XFS_BMBT_TRACE_ARGBII(c,b,i,j)
|
#define XFS_BMBT_TRACE_ARGBII(c,b,i,j)
|
||||||
@ -318,9 +318,6 @@ xfs_bmbt_delrec(
|
|||||||
xfs_fsblock_t bno; /* fs-relative block number */
|
xfs_fsblock_t bno; /* fs-relative block number */
|
||||||
xfs_buf_t *bp; /* buffer for block */
|
xfs_buf_t *bp; /* buffer for block */
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_delrec";
|
|
||||||
#endif
|
|
||||||
int i; /* loop counter */
|
int i; /* loop counter */
|
||||||
int j; /* temp state */
|
int j; /* temp state */
|
||||||
xfs_bmbt_key_t key; /* bmap btree key */
|
xfs_bmbt_key_t key; /* bmap btree key */
|
||||||
@ -694,9 +691,6 @@ xfs_bmbt_insrec(
|
|||||||
xfs_bmbt_block_t *block; /* bmap btree block */
|
xfs_bmbt_block_t *block; /* bmap btree block */
|
||||||
xfs_buf_t *bp; /* buffer for block */
|
xfs_buf_t *bp; /* buffer for block */
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_insrec";
|
|
||||||
#endif
|
|
||||||
int i; /* loop index */
|
int i; /* loop index */
|
||||||
xfs_bmbt_key_t key; /* bmap btree key */
|
xfs_bmbt_key_t key; /* bmap btree key */
|
||||||
xfs_bmbt_key_t *kp=NULL; /* pointer to bmap btree key */
|
xfs_bmbt_key_t *kp=NULL; /* pointer to bmap btree key */
|
||||||
@ -880,9 +874,6 @@ xfs_bmbt_killroot(
|
|||||||
xfs_bmbt_ptr_t *cpp;
|
xfs_bmbt_ptr_t *cpp;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
int error;
|
int error;
|
||||||
#endif
|
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_killroot";
|
|
||||||
#endif
|
#endif
|
||||||
int i;
|
int i;
|
||||||
xfs_bmbt_key_t *kp;
|
xfs_bmbt_key_t *kp;
|
||||||
@ -973,9 +964,6 @@ xfs_bmbt_log_keys(
|
|||||||
int kfirst,
|
int kfirst,
|
||||||
int klast)
|
int klast)
|
||||||
{
|
{
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_log_keys";
|
|
||||||
#endif
|
|
||||||
xfs_trans_t *tp;
|
xfs_trans_t *tp;
|
||||||
|
|
||||||
XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
|
XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
|
||||||
@ -1012,9 +1000,6 @@ xfs_bmbt_log_ptrs(
|
|||||||
int pfirst,
|
int pfirst,
|
||||||
int plast)
|
int plast)
|
||||||
{
|
{
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_log_ptrs";
|
|
||||||
#endif
|
|
||||||
xfs_trans_t *tp;
|
xfs_trans_t *tp;
|
||||||
|
|
||||||
XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
|
XFS_BMBT_TRACE_CURSOR(cur, ENTRY);
|
||||||
@ -1055,9 +1040,6 @@ xfs_bmbt_lookup(
|
|||||||
xfs_daddr_t d;
|
xfs_daddr_t d;
|
||||||
xfs_sfiloff_t diff;
|
xfs_sfiloff_t diff;
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_lookup";
|
|
||||||
#endif
|
|
||||||
xfs_fsblock_t fsbno=0;
|
xfs_fsblock_t fsbno=0;
|
||||||
int high;
|
int high;
|
||||||
int i;
|
int i;
|
||||||
@ -1195,9 +1177,6 @@ xfs_bmbt_lshift(
|
|||||||
int *stat) /* success/failure */
|
int *stat) /* success/failure */
|
||||||
{
|
{
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_lshift";
|
|
||||||
#endif
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
int i; /* loop counter */
|
int i; /* loop counter */
|
||||||
#endif
|
#endif
|
||||||
@ -1331,9 +1310,6 @@ xfs_bmbt_rshift(
|
|||||||
int *stat) /* success/failure */
|
int *stat) /* success/failure */
|
||||||
{
|
{
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_rshift";
|
|
||||||
#endif
|
|
||||||
int i; /* loop counter */
|
int i; /* loop counter */
|
||||||
xfs_bmbt_key_t key; /* bmap btree key */
|
xfs_bmbt_key_t key; /* bmap btree key */
|
||||||
xfs_buf_t *lbp; /* left buffer pointer */
|
xfs_buf_t *lbp; /* left buffer pointer */
|
||||||
@ -1492,9 +1468,6 @@ xfs_bmbt_split(
|
|||||||
{
|
{
|
||||||
xfs_alloc_arg_t args; /* block allocation args */
|
xfs_alloc_arg_t args; /* block allocation args */
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_split";
|
|
||||||
#endif
|
|
||||||
int i; /* loop counter */
|
int i; /* loop counter */
|
||||||
xfs_fsblock_t lbno; /* left sibling block number */
|
xfs_fsblock_t lbno; /* left sibling block number */
|
||||||
xfs_buf_t *lbp; /* left buffer pointer */
|
xfs_buf_t *lbp; /* left buffer pointer */
|
||||||
@ -1640,9 +1613,6 @@ xfs_bmbt_updkey(
|
|||||||
xfs_buf_t *bp;
|
xfs_buf_t *bp;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
int error;
|
int error;
|
||||||
#endif
|
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_updkey";
|
|
||||||
#endif
|
#endif
|
||||||
xfs_bmbt_key_t *kp;
|
xfs_bmbt_key_t *kp;
|
||||||
int ptr;
|
int ptr;
|
||||||
@ -1712,9 +1682,6 @@ xfs_bmbt_decrement(
|
|||||||
xfs_bmbt_block_t *block;
|
xfs_bmbt_block_t *block;
|
||||||
xfs_buf_t *bp;
|
xfs_buf_t *bp;
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_decrement";
|
|
||||||
#endif
|
|
||||||
xfs_fsblock_t fsbno;
|
xfs_fsblock_t fsbno;
|
||||||
int lev;
|
int lev;
|
||||||
xfs_mount_t *mp;
|
xfs_mount_t *mp;
|
||||||
@ -1785,9 +1752,6 @@ xfs_bmbt_delete(
|
|||||||
int *stat) /* success/failure */
|
int *stat) /* success/failure */
|
||||||
{
|
{
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_delete";
|
|
||||||
#endif
|
|
||||||
int i;
|
int i;
|
||||||
int level;
|
int level;
|
||||||
|
|
||||||
@ -2000,9 +1964,6 @@ xfs_bmbt_increment(
|
|||||||
xfs_bmbt_block_t *block;
|
xfs_bmbt_block_t *block;
|
||||||
xfs_buf_t *bp;
|
xfs_buf_t *bp;
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_increment";
|
|
||||||
#endif
|
|
||||||
xfs_fsblock_t fsbno;
|
xfs_fsblock_t fsbno;
|
||||||
int lev;
|
int lev;
|
||||||
xfs_mount_t *mp;
|
xfs_mount_t *mp;
|
||||||
@ -2080,9 +2041,6 @@ xfs_bmbt_insert(
|
|||||||
int *stat) /* success/failure */
|
int *stat) /* success/failure */
|
||||||
{
|
{
|
||||||
int error; /* error return value */
|
int error; /* error return value */
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_insert";
|
|
||||||
#endif
|
|
||||||
int i;
|
int i;
|
||||||
int level;
|
int level;
|
||||||
xfs_fsblock_t nbno;
|
xfs_fsblock_t nbno;
|
||||||
@ -2142,9 +2100,6 @@ xfs_bmbt_log_block(
|
|||||||
int fields)
|
int fields)
|
||||||
{
|
{
|
||||||
int first;
|
int first;
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_log_block";
|
|
||||||
#endif
|
|
||||||
int last;
|
int last;
|
||||||
xfs_trans_t *tp;
|
xfs_trans_t *tp;
|
||||||
static const short offsets[] = {
|
static const short offsets[] = {
|
||||||
@ -2181,9 +2136,6 @@ xfs_bmbt_log_recs(
|
|||||||
{
|
{
|
||||||
xfs_bmbt_block_t *block;
|
xfs_bmbt_block_t *block;
|
||||||
int first;
|
int first;
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_log_recs";
|
|
||||||
#endif
|
|
||||||
int last;
|
int last;
|
||||||
xfs_bmbt_rec_t *rp;
|
xfs_bmbt_rec_t *rp;
|
||||||
xfs_trans_t *tp;
|
xfs_trans_t *tp;
|
||||||
@ -2245,9 +2197,6 @@ xfs_bmbt_newroot(
|
|||||||
xfs_bmbt_key_t *ckp; /* child key pointer */
|
xfs_bmbt_key_t *ckp; /* child key pointer */
|
||||||
xfs_bmbt_ptr_t *cpp; /* child ptr pointer */
|
xfs_bmbt_ptr_t *cpp; /* child ptr pointer */
|
||||||
int error; /* error return code */
|
int error; /* error return code */
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_newroot";
|
|
||||||
#endif
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
int i; /* loop counter */
|
int i; /* loop counter */
|
||||||
#endif
|
#endif
|
||||||
@ -2630,9 +2579,6 @@ xfs_bmbt_update(
|
|||||||
xfs_bmbt_block_t *block;
|
xfs_bmbt_block_t *block;
|
||||||
xfs_buf_t *bp;
|
xfs_buf_t *bp;
|
||||||
int error;
|
int error;
|
||||||
#ifdef XFS_BMBT_TRACE
|
|
||||||
static char fname[] = "xfs_bmbt_update";
|
|
||||||
#endif
|
|
||||||
xfs_bmbt_key_t key;
|
xfs_bmbt_key_t key;
|
||||||
int ptr;
|
int ptr;
|
||||||
xfs_bmbt_rec_t *rp;
|
xfs_bmbt_rec_t *rp;
|
||||||
|
@ -645,8 +645,7 @@ xfs_iformat_extents(
|
|||||||
ep->l1 = INT_GET(get_unaligned((__uint64_t*)&dp->l1),
|
ep->l1 = INT_GET(get_unaligned((__uint64_t*)&dp->l1),
|
||||||
ARCH_CONVERT);
|
ARCH_CONVERT);
|
||||||
}
|
}
|
||||||
xfs_bmap_trace_exlist("xfs_iformat_extents", ip, nex,
|
XFS_BMAP_TRACE_EXLIST(ip, nex, whichfork);
|
||||||
whichfork);
|
|
||||||
if (whichfork != XFS_DATA_FORK ||
|
if (whichfork != XFS_DATA_FORK ||
|
||||||
XFS_EXTFMT_INODE(ip) == XFS_EXTFMT_NOSTATE)
|
XFS_EXTFMT_INODE(ip) == XFS_EXTFMT_NOSTATE)
|
||||||
if (unlikely(xfs_check_nostate_extents(
|
if (unlikely(xfs_check_nostate_extents(
|
||||||
@ -2894,9 +2893,6 @@ xfs_iextents_copy(
|
|||||||
int copied;
|
int copied;
|
||||||
xfs_bmbt_rec_t *dest_ep;
|
xfs_bmbt_rec_t *dest_ep;
|
||||||
xfs_bmbt_rec_t *ep;
|
xfs_bmbt_rec_t *ep;
|
||||||
#ifdef XFS_BMAP_TRACE
|
|
||||||
static char fname[] = "xfs_iextents_copy";
|
|
||||||
#endif
|
|
||||||
int i;
|
int i;
|
||||||
xfs_ifork_t *ifp;
|
xfs_ifork_t *ifp;
|
||||||
int nrecs;
|
int nrecs;
|
||||||
@ -2907,7 +2903,7 @@ xfs_iextents_copy(
|
|||||||
ASSERT(ifp->if_bytes > 0);
|
ASSERT(ifp->if_bytes > 0);
|
||||||
|
|
||||||
nrecs = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t);
|
nrecs = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t);
|
||||||
xfs_bmap_trace_exlist(fname, ip, nrecs, whichfork);
|
XFS_BMAP_TRACE_EXLIST(ip, nrecs, whichfork);
|
||||||
ASSERT(nrecs > 0);
|
ASSERT(nrecs > 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user