From: Nathan Scott Date: Thu, 19 Apr 2001 02:41:37 +0000 (+0000) Subject: sync with no-op kernel change - stats macro usage change, not used in userspace. X-Git-Tag: Release-1_0_0~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7a3bffe49f3d25bbb98d4e76b591c2a91441633b;p=thirdparty%2Fxfsprogs-dev.git sync with no-op kernel change - stats macro usage change, not used in userspace. --- diff --git a/include/xfs_types.h b/include/xfs_types.h index 86f5237a1..b7aafb4ff 100644 --- a/include/xfs_types.h +++ b/include/xfs_types.h @@ -238,24 +238,19 @@ struct xfsstats { __uint32_t vn_reclaim; /* # times vn_reclaim called */ __uint32_t vn_remove; /* # times vn_remove called */ __uint32_t vn_free; /* # times vn_free called */ - struct xfsstats_xpc { - __uint64_t xs_xstrat_bytes; - __uint64_t xs_write_bytes; - __uint64_t xs_read_bytes; - } xpc; +/* Extra precision counters */ + __uint64_t xs_xstrat_bytes; + __uint64_t xs_write_bytes; + __uint64_t xs_read_bytes; } xfsstats; -# define XFS_STATS_INC(count) ( xfsstats.##count ++ ) -# define XFS_STATS_DEC(count) ( xfsstats.##count -- ) -# define XFS_STATS_ADD(count, inc) ( xfsstats.##count += (inc) ) -# define XFS_STATS64_INC(count) ( xfsstats.xpc.##count ++ ) -# define XFS_STATS64_ADD(count, inc) ( xfsstats.xpc.##count += (inc) ) +# define XFS_STATS_INC(count) ( (count)++ ) +# define XFS_STATS_DEC(count) ( (count)-- ) +# define XFS_STATS_ADD(count, inc) ( (count) += (inc) ) #else /* !CONFIG_PROC_FS */ # define XFS_STATS_INC(count) # define XFS_STATS_DEC(count) # define XFS_STATS_ADD(count, inc) -# define XFS_STATS64_INC(count) -# define XFS_STATS64_ADD(count, inc) #endif /* !CONFIG_PROC_FS */ diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c index aa2000cc6..7bae28a43 100644 --- a/libxfs/xfs_alloc.c +++ b/libxfs/xfs_alloc.c @@ -531,8 +531,8 @@ xfs_alloc_ag_vextent( xfs_trans_mod_sb(args->tp, args->wasdel ? XFS_TRANS_SB_RES_FDBLOCKS : XFS_TRANS_SB_FDBLOCKS, -slen); - XFS_STATS_INC(xs_allocx); - XFS_STATS_ADD(xs_allocb, args->len); + XFS_STATS_INC(xfsstats.xs_allocx); + XFS_STATS_ADD(xfsstats.xs_allocb, args->len); } return 0; } @@ -1687,8 +1687,8 @@ xfs_free_ag_extent( xfs_alloc_log_agf(tp, agbp, XFS_AGF_FREEBLKS); if (!isfl) xfs_trans_mod_sb(tp, XFS_TRANS_SB_FDBLOCKS, (long)len); - XFS_STATS_INC(xs_freex); - XFS_STATS_ADD(xs_freeb, len); + XFS_STATS_INC(xfsstats.xs_freex); + XFS_STATS_ADD(xfsstats.xs_freeb, len); } TRACE_FREE(haveleft ? (haveright ? "both" : "left") : @@ -1995,7 +1995,7 @@ xfs_alloc_pagf_init( xfs_agnumber_t agno, /* allocation group number */ int flags) /* XFS_ALLOC_FLAGS_... */ { - xfs_buf_t *bp; + xfs_buf_t *bp; int error; if ((error = xfs_alloc_read_agf(mp, tp, agno, flags, &bp))) diff --git a/libxfs/xfs_alloc_btree.c b/libxfs/xfs_alloc_btree.c index a51c97bc8..e1a5c035f 100644 --- a/libxfs/xfs_alloc_btree.c +++ b/libxfs/xfs_alloc_btree.c @@ -97,7 +97,7 @@ xfs_alloc_delrec( *stat = 0; return 0; } - XFS_STATS_INC(xs_abt_delrec); + XFS_STATS_INC(xfsstats.xs_abt_delrec); /* * It's a nonleaf. Excise the key and ptr being deleted, by * sliding the entries past them down one. @@ -491,7 +491,7 @@ xfs_alloc_delrec( */ if (INT_GET(left->bb_rightsib, ARCH_CONVERT) != NULLAGBLOCK) { xfs_alloc_block_t *rrblock; - xfs_buf_t *rrbp; + xfs_buf_t *rrbp; if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, cur->bc_private.a.agno, INT_GET(left->bb_rightsib, ARCH_CONVERT), 0, @@ -563,7 +563,7 @@ xfs_alloc_insrec( * and we're done. */ if (level >= cur->bc_nlevels) { - XFS_STATS_INC(xs_abt_insrec); + XFS_STATS_INC(xfsstats.xs_abt_insrec); if ((error = xfs_alloc_newroot(cur, &i))) return error; *bnop = NULLAGBLOCK; @@ -583,7 +583,7 @@ xfs_alloc_insrec( *stat = 0; return 0; } - XFS_STATS_INC(xs_abt_insrec); + XFS_STATS_INC(xfsstats.xs_abt_insrec); /* * Get pointers to the btree buffer and block. */ @@ -883,7 +883,7 @@ xfs_alloc_lookup( int level; /* level in the btree */ xfs_mount_t *mp; /* file system mount point */ - XFS_STATS_INC(xs_abt_lookup); + XFS_STATS_INC(xfsstats.xs_abt_lookup); /* * Get the allocation group header, and the root block number. */ @@ -903,8 +903,8 @@ xfs_alloc_lookup( * pointer down to the next level. */ for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) { - xfs_buf_t *bp; /* buffer pointer for btree block */ - xfs_daddr_t d; /* disk address of btree block */ + xfs_buf_t *bp; /* buffer pointer for btree block */ + xfs_daddr_t d; /* disk address of btree block */ /* * Get the disk address we're looking for. @@ -978,7 +978,7 @@ xfs_alloc_lookup( xfs_extlen_t blockcount; /* key value */ xfs_agblock_t startblock; /* key value */ - XFS_STATS_INC(xs_abt_compare); + XFS_STATS_INC(xfsstats.xs_abt_compare); /* * keyno is average of low and high. */ @@ -1096,10 +1096,10 @@ xfs_alloc_lshift( int i; /* loop index */ #endif xfs_alloc_key_t key; /* key value for leaf level upward */ - xfs_buf_t *lbp; /* buffer for left neighbor block */ + xfs_buf_t *lbp; /* buffer for left neighbor block */ xfs_alloc_block_t *left; /* left neighbor btree block */ int nrec; /* new number of left block entries */ - xfs_buf_t *rbp; /* buffer for right (current) block */ + xfs_buf_t *rbp; /* buffer for right (current) block */ xfs_alloc_block_t *right; /* right (current) btree block */ xfs_alloc_key_t *rkp=NULL; /* key pointer for right block */ xfs_alloc_ptr_t *rpp=NULL; /* address pointer for right block */ @@ -1232,15 +1232,15 @@ xfs_alloc_newroot( { int error; /* error return value */ xfs_agblock_t lbno; /* left block number */ - xfs_buf_t *lbp; /* left btree buffer */ + xfs_buf_t *lbp; /* left btree buffer */ xfs_alloc_block_t *left; /* left btree block */ xfs_mount_t *mp; /* mount structure */ xfs_agblock_t nbno; /* new block number */ - xfs_buf_t *nbp; /* new (root) buffer */ + xfs_buf_t *nbp; /* new (root) buffer */ xfs_alloc_block_t *new; /* new (root) btree block */ int nptr; /* new value for key index, 1 or 2 */ xfs_agblock_t rbno; /* right block number */ - xfs_buf_t *rbp; /* right btree buffer */ + xfs_buf_t *rbp; /* right btree buffer */ xfs_alloc_block_t *right; /* right btree block */ mp = cur->bc_mp; @@ -1389,9 +1389,9 @@ xfs_alloc_rshift( int error; /* error return value */ int i; /* loop index */ xfs_alloc_key_t key; /* key value for leaf level upward */ - xfs_buf_t *lbp; /* buffer for left (current) block */ + xfs_buf_t *lbp; /* buffer for left (current) block */ xfs_alloc_block_t *left; /* left (current) btree block */ - xfs_buf_t *rbp; /* buffer for right neighbor block */ + xfs_buf_t *rbp; /* buffer for right neighbor block */ xfs_alloc_block_t *right; /* right neighbor btree block */ xfs_alloc_key_t *rkp; /* key pointer for right block */ xfs_btree_cur_t *tcur; /* temporary cursor */ @@ -1523,10 +1523,10 @@ xfs_alloc_split( int error; /* error return value */ int i; /* loop index/record number */ xfs_agblock_t lbno; /* left (current) block number */ - xfs_buf_t *lbp; /* buffer for left block */ + xfs_buf_t *lbp; /* buffer for left block */ xfs_alloc_block_t *left; /* left (current) btree block */ xfs_agblock_t rbno; /* right (new) block number */ - xfs_buf_t *rbp; /* buffer for right block */ + xfs_buf_t *rbp; /* buffer for right block */ xfs_alloc_block_t *right; /* right (new) btree block */ /* @@ -1626,7 +1626,7 @@ xfs_alloc_split( */ if (INT_GET(right->bb_rightsib, ARCH_CONVERT) != NULLAGBLOCK) { xfs_alloc_block_t *rrblock; /* rr btree block */ - xfs_buf_t *rrbp; /* buffer for rrblock */ + xfs_buf_t *rrbp; /* buffer for rrblock */ if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, cur->bc_private.a.agno, INT_GET(right->bb_rightsib, ARCH_CONVERT), 0, @@ -1680,7 +1680,7 @@ xfs_alloc_updkey( */ for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { xfs_alloc_block_t *block; /* btree block */ - xfs_buf_t *bp; /* buffer for block */ + xfs_buf_t *bp; /* buffer for block */ #ifdef DEBUG int error; /* error return value */ #endif @@ -1770,7 +1770,7 @@ xfs_alloc_decrement( */ for (block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[lev]); lev > level; ) { xfs_agblock_t agbno; /* block number of btree block */ - xfs_buf_t *bp; /* buffer pointer for block */ + xfs_buf_t *bp; /* buffer pointer for block */ agbno = INT_GET(*XFS_ALLOC_PTR_ADDR(block, cur->bc_ptrs[lev], cur), ARCH_CONVERT); if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, @@ -1878,7 +1878,7 @@ xfs_alloc_increment( int *stat) /* success/failure */ { xfs_alloc_block_t *block; /* btree block */ - xfs_buf_t *bp; /* tree block buffer */ + xfs_buf_t *bp; /* tree block buffer */ int error; /* error return value */ int lev; /* btree level */ diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index f32718e17..8d9836750 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -61,7 +61,7 @@ xfs_bmap_add_extent( int logflags; /* returned value */ xfs_extnum_t nextents; /* number of extents in file now */ - XFS_STATS_INC(xs_add_exlist); + XFS_STATS_INC(xfsstats.xs_add_exlist); cur = *curp; ifp = XFS_IFORK_PTR(ip, whichfork); nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); @@ -2259,7 +2259,7 @@ xfs_bmap_btree_to_extents( /* REFERENCED */ xfs_bmbt_block_t *cblock;/* child btree block */ xfs_fsblock_t cbno; /* child block number */ - xfs_buf_t *cbp; /* child block's buffer */ + xfs_buf_t *cbp; /* child block's buffer */ int error; /* error return value */ xfs_ifork_t *ifp; /* inode fork data */ xfs_mount_t *mp; /* mount point structure */ @@ -2348,7 +2348,7 @@ xfs_bmap_del_extent( xfs_filblks_t temp; /* for indirect length calculations */ xfs_filblks_t temp2; /* for indirect length calculations */ - XFS_STATS_INC(xs_del_exlist); + XFS_STATS_INC(xfsstats.xs_del_exlist); mp = ip->i_mount; ifp = XFS_IFORK_PTR(ip, whichfork); nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); @@ -2709,7 +2709,7 @@ xfs_bmap_extents_to_btree( int whichfork) /* data or attr fork */ { xfs_bmbt_block_t *ablock; /* allocated (child) bt block */ - xfs_buf_t *abp; /* buffer for ablock */ + xfs_buf_t *abp; /* buffer for ablock */ xfs_alloc_arg_t args; /* allocation arguments */ xfs_bmbt_rec_t *arp; /* child record pointer */ xfs_bmbt_block_t *block; /* btree root block */ @@ -2892,7 +2892,7 @@ xfs_bmap_local_to_extents( error = 0; if (ifp->if_bytes) { xfs_alloc_arg_t args; /* allocation arguments */ - xfs_buf_t *bp; /* buffer for extent list block */ + xfs_buf_t *bp; /* buffer for extent list block */ xfs_bmbt_rec_t *ep; /* extent list pointer */ args.tp = tp; @@ -2994,7 +2994,7 @@ xfs_bmap_do_search_extents( low = 0; high = nextents - 1; while (low <= high) { - XFS_STATS_INC(xs_cmp_exlist); + XFS_STATS_INC(xfsstats.xs_cmp_exlist); lastx = (low + high) >> 1; ep = base + lastx; got.br_startoff = xfs_bmbt_get_startoff(ep); @@ -3064,7 +3064,7 @@ xfs_bmap_search_extents( xfs_extnum_t lastx; /* last extent index used */ xfs_extnum_t nextents; /* extent list size */ - XFS_STATS_INC(xs_look_exlist); + XFS_STATS_INC(xfsstats.xs_look_exlist); ifp = XFS_IFORK_PTR(ip, whichfork); lastx = ifp->if_lastex; nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); @@ -3388,7 +3388,7 @@ xfs_bmap_read_extents( { xfs_bmbt_block_t *block; /* current btree block */ xfs_fsblock_t bno; /* block # of "block" */ - xfs_buf_t *bp; /* buffer for "block" */ + xfs_buf_t *bp; /* buffer for "block" */ int error; /* error return value */ xfs_exntfmt_t exntf; /* XFS_EXTFMT_NOSTATE, if checking */ #ifdef XFS_BMAP_TRACE @@ -3599,9 +3599,9 @@ xfs_bmapi( ASSERT(ifp->if_ext_max == XFS_IFORK_SIZE(ip, whichfork) / (uint)sizeof(xfs_bmbt_rec_t)); if ((wr = (flags & XFS_BMAPI_WRITE)) != 0) - XFS_STATS_INC(xs_blk_mapw); + XFS_STATS_INC(xfsstats.xs_blk_mapw); else - XFS_STATS_INC(xs_blk_mapr); + XFS_STATS_INC(xfsstats.xs_blk_mapr); delay = (flags & XFS_BMAPI_DELAY) != 0; trim = (flags & XFS_BMAPI_ENTIRE) == 0; userdata = (flags & XFS_BMAPI_METADATA) == 0; @@ -4080,7 +4080,7 @@ xfs_bmapi_single( return XFS_ERROR(EFSCORRUPTED); if (XFS_FORCED_SHUTDOWN(ip->i_mount)) return XFS_ERROR(EIO); - XFS_STATS_INC(xs_blk_mapr); + XFS_STATS_INC(xfsstats.xs_blk_mapr); if (!(ifp->if_flags & XFS_IFEXTENTS) && (error = xfs_iread_extents(tp, ip, whichfork))) return error; @@ -4167,7 +4167,7 @@ xfs_bunmapi( *done = 1; return 0; } - XFS_STATS_INC(xs_blk_unmap); + XFS_STATS_INC(xfsstats.xs_blk_unmap); isrt = (whichfork == XFS_DATA_FORK) && (ip->i_d.di_flags & XFS_DIFLAG_REALTIME); start = bno; diff --git a/libxfs/xfs_bmap_btree.c b/libxfs/xfs_bmap_btree.c index 1e86fb44f..3fed3a7ff 100644 --- a/libxfs/xfs_bmap_btree.c +++ b/libxfs/xfs_bmap_btree.c @@ -96,7 +96,7 @@ xfs_bmbt_delrec( *stat = 0; return 0; } - XFS_STATS_INC(xs_bmbt_delrec); + XFS_STATS_INC(xfsstats.xs_bmbt_delrec); if (level > 0) { kp = XFS_BMAP_KEY_IADDR(block, 1, cur); pp = XFS_BMAP_PTR_IADDR(block, 1, cur); @@ -450,7 +450,7 @@ xfs_bmbt_insrec( *stat = 0; return 0; } - XFS_STATS_INC(xs_bmbt_insrec); + XFS_STATS_INC(xfsstats.xs_bmbt_insrec); block = xfs_bmbt_get_block(cur, level, &bp); #ifdef DEBUG if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { @@ -805,7 +805,7 @@ xfs_bmbt_lookup( xfs_fileoff_t startoff; xfs_trans_t *tp; - XFS_STATS_INC(xs_bmbt_lookup); + XFS_STATS_INC(xfsstats.xs_bmbt_lookup); XFS_BMBT_TRACE_CURSOR(cur, ENTRY); XFS_BMBT_TRACE_ARGI(cur, (int)dir); tp = cur->bc_tp; @@ -850,7 +850,7 @@ xfs_bmbt_lookup( return 0; } while (low <= high) { - XFS_STATS_INC(xs_bmbt_compare); + XFS_STATS_INC(xfsstats.xs_bmbt_compare); keyno = (low + high) >> 1; if (level > 0) { kkp = kkbase + keyno - 1; diff --git a/libxfs/xfs_dir.c b/libxfs/xfs_dir.c index 7d28b25d5..6d7859c65 100644 --- a/libxfs/xfs_dir.c +++ b/libxfs/xfs_dir.c @@ -113,7 +113,7 @@ xfs_dir_createname(xfs_trans_t *trans, xfs_inode_t *dp, char *name, if ((retval = xfs_dir_ino_validate(trans->t_mountp, inum))) return (retval); - XFS_STATS_INC(xs_dir_create); + XFS_STATS_INC(xfsstats.xs_dir_create); /* * Fill in the arg structure for this request. */ @@ -175,7 +175,7 @@ xfs_dir_removename(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int count, totallen, newsize, retval; ASSERT((dp->i_d.di_mode & IFMT) == IFDIR); - XFS_STATS_INC(xs_dir_remove); + XFS_STATS_INC(xfsstats.xs_dir_remove); /* * Fill in the arg structure for this request. */ @@ -222,7 +222,7 @@ xfs_dir_lookup(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int namelen, return(XFS_ERROR(EINVAL)); } - XFS_STATS_INC(xs_dir_lookup); + XFS_STATS_INC(xfsstats.xs_dir_lookup); /* * Fill in the arg structure for this request. */ diff --git a/libxfs/xfs_dir2.c b/libxfs/xfs_dir2.c index 0dfece9ef..f41b3c1f8 100644 --- a/libxfs/xfs_dir2.c +++ b/libxfs/xfs_dir2.c @@ -103,7 +103,7 @@ xfs_dir2_createname( if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum))) { return rval; } - XFS_STATS_INC(xs_dir_create); + XFS_STATS_INC(xfsstats.xs_dir_create); /* * Fill in the arg structure for this request. */ @@ -156,7 +156,7 @@ xfs_dir2_lookup( if (namelen >= MAXNAMELEN) { return XFS_ERROR(EINVAL); } - XFS_STATS_INC(xs_dir_lookup); + XFS_STATS_INC(xfsstats.xs_dir_lookup); /* * Fill in the arg structure for this request. */ @@ -213,7 +213,7 @@ xfs_dir2_removename( int v; /* type-checking value */ ASSERT((dp->i_d.di_mode & IFMT) == IFDIR); - XFS_STATS_INC(xs_dir_remove); + XFS_STATS_INC(xfsstats.xs_dir_remove); /* * Fill in the arg structure for this request. */