From edbe891abfb00be2c9f4de474db2dd784f2d5a61 Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Wed, 10 Aug 2011 21:52:44 -0400 Subject: [PATCH] libafs: FillStoreStats doesn't need to be global; avoid pass-by-pointer FillStoreStats is only used in afs_fetchstore.c, so make it static. Parameter xferStartTime is an osi_timeval, which should be small enough to pass by value, so do so. Change-Id: Ic47eae8babb3b7cadbbbca2f10e2e070e2457590 Reviewed-on: http://gerrit.openafs.org/5199 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/afs/afs_fetchstore.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/afs/afs_fetchstore.c b/src/afs/afs_fetchstore.c index 0f794f3366..7f85c73ce0 100644 --- a/src/afs/afs_fetchstore.c +++ b/src/afs/afs_fetchstore.c @@ -27,8 +27,8 @@ extern int cacheDiskType; #ifndef AFS_NOSTATS -void -FillStoreStats(int code, int idx, osi_timeval_t *xferStartTime, +static void +FillStoreStats(int code, int idx, osi_timeval_t xferStartTime, afs_size_t bytesToXfer, afs_size_t bytesXferred) { struct afs_stats_xferData *xferP; @@ -63,7 +63,7 @@ FillStoreStats(int code, int idx, osi_timeval_t *xferStartTime, else (xferP->count[8])++; - afs_stats_GetDiff(elapsedTime, (*xferStartTime), xferStopTime); + afs_stats_GetDiff(elapsedTime, xferStartTime, xferStopTime); afs_stats_AddTo((xferP->sumTime), elapsedTime); afs_stats_SquareAddTo((xferP->sqrTime), elapsedTime); if (afs_stats_TimeLessThan(elapsedTime, (xferP->minTime))) { @@ -522,7 +522,7 @@ afs_CacheStoreDCaches(struct vcache *avc, struct dcache **dclist, #ifndef AFS_NOSTATS FillStoreStats(code, AFS_STATS_FS_XFERIDX_STOREDATA, - &xferStartTime, bytesToXfer, bytesXferred); + xferStartTime, bytesToXfer, bytesXferred); #endif /* AFS_NOSTATS */ if ((tdc->f.chunkBytes < afs_OtherCSize) @@ -1159,7 +1159,7 @@ afs_CacheFetchProc(struct afs_conn *tc, struct rx_connection *rxconn, (*ops->destroy)(&rock, code); #ifndef AFS_NOSTATS - FillStoreStats(code, AFS_STATS_FS_XFERIDX_FETCHDATA, &xferStartTime, + FillStoreStats(code, AFS_STATS_FS_XFERIDX_FETCHDATA, xferStartTime, bytesToXfer, bytesXferred); #endif XSTATS_END_TIME;