From c9eab4b1ee947067bfcc3678bb89896b66f404f8 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Tue, 2 Jun 2020 11:12:58 -0500 Subject: [PATCH] afs: Remove osi_GetuTime osi_GetuTime has always been #define'd to be the same thing as osi_GetTime, ever since OpenAFS 1.0. Get rid of this redundant macro, and just use osi_GetTime instead. Change-Id: Ic826aeaa17314019b79cfb2df04a79309aa31db5 Reviewed-on: https://gerrit.openafs.org/14236 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk --- src/afs/afs_callback.c | 2 +- src/afs/afs_dcache.c | 6 +++--- src/afs/afs_fetchstore.c | 6 +++--- src/afs/afs_lock.c | 4 ++-- src/afs/afs_osi.h | 5 ----- src/afs/afs_server.c | 6 +++--- src/afs/afs_stats.h | 6 +++--- 7 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c index b441abc..73e9cfd 100644 --- a/src/afs/afs_callback.c +++ b/src/afs/afs_callback.c @@ -556,7 +556,7 @@ loop2: #ifdef CBDEBUG lastCallBack_vnode = afid->Vnode; lastCallBack_dv = tvc->mstat.DataVersion.low; - osi_GetuTime(&lastCallBack_time); + osi_GetTime(&lastCallBack_time); #endif /* CBDEBUG */ #ifdef AFS_DARWIN80_ENV vnode_put(AFSTOV(tvc)); diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index d88b811..8d97143 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -457,7 +457,7 @@ afs_CacheTruncateDaemon(void) afs_min_cache = (((10 * AFS_CHUNKSIZE(0)) + afs_fsfragsize) & ~afs_fsfragsize) >> 10; - osi_GetuTime(&CTD_stats.CTD_afterSleep); + osi_GetTime(&CTD_stats.CTD_afterSleep); afs_TruncateDaemonRunning = 1; while (1) { cb_lowat = PERCENT((CM_DCACHESPACEFREEPCT - CM_DCACHEEXTRAPCT), afs_cacheBlocks); @@ -525,7 +525,7 @@ afs_CacheTruncateDaemon(void) && (afs_termState != AFSOP_STOP_TRUNCDAEMON)) { /* Collect statistics on truncate daemon. */ CTD_stats.CTD_nSleeps++; - osi_GetuTime(&CTD_stats.CTD_beforeSleep); + osi_GetTime(&CTD_stats.CTD_beforeSleep); afs_stats_GetDiff(CTD_tmpTime, CTD_stats.CTD_afterSleep, CTD_stats.CTD_beforeSleep); afs_stats_AddTo(CTD_stats.CTD_runTime, CTD_tmpTime); @@ -534,7 +534,7 @@ afs_CacheTruncateDaemon(void) afs_osi_Sleep((int *)afs_CacheTruncateDaemon); afs_TruncateDaemonRunning = 1; - osi_GetuTime(&CTD_stats.CTD_afterSleep); + osi_GetTime(&CTD_stats.CTD_afterSleep); afs_stats_GetDiff(CTD_tmpTime, CTD_stats.CTD_beforeSleep, CTD_stats.CTD_afterSleep); afs_stats_AddTo(CTD_stats.CTD_sleepTime, CTD_tmpTime); diff --git a/src/afs/afs_fetchstore.c b/src/afs/afs_fetchstore.c index 686d4b0..06325b9 100644 --- a/src/afs/afs_fetchstore.c +++ b/src/afs/afs_fetchstore.c @@ -33,7 +33,7 @@ FillStoreStats(int code, int idx, osi_timeval32_t xferStartTime, osi_timeval32_t elapsedTime; xferP = &(afs_stats_cmfullperf.rpc.fsXferTimes[idx]); - osi_GetuTime(&xferStopTime); + osi_GetTime(&xferStopTime); (xferP->numXfers)++; if (!code) { (xferP->numSuccesses)++; @@ -492,7 +492,7 @@ afs_CacheStoreDCaches(struct vcache *avc, struct dcache **dclist, */ bytesToXfer = size; - osi_GetuTime(&xferStartTime); + osi_GetTime(&xferStartTime); #endif /* AFS_NOSTATS */ bytesXferred = 0; @@ -1132,7 +1132,7 @@ afs_CacheFetchProc(struct afs_conn *tc, struct rx_connection *rxconn, tc, rxconn, avc, base, size, &length, adc, fP, &ops, &rock); #ifndef AFS_NOSTATS - osi_GetuTime(&xferStartTime); + osi_GetTime(&xferStartTime); #endif /* AFS_NOSTATS */ adc->validPos = base; diff --git a/src/afs/afs_lock.c b/src/afs/afs_lock.c index 4489853..e45023f 100644 --- a/src/afs/afs_lock.c +++ b/src/afs/afs_lock.c @@ -128,7 +128,7 @@ Afs_Lock_Obtain(struct afs_lock *lock, int how) AFS_STATCNT(Lock_Obtain); AFS_ASSERT_GLOCK(); - osi_GetuTime(&tt1); + osi_GetTime(&tt1); switch (how) { @@ -176,7 +176,7 @@ Afs_Lock_Obtain(struct afs_lock *lock, int how) osi_Panic("afs locktype"); } - osi_GetuTime(&tt2); + osi_GetTime(&tt2); afs_stats_GetDiff(et, tt1, tt2); afs_stats_AddTo((lock->time_waiting), et); us = (et.tv_sec << 20) + et.tv_usec; diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h index afc4440..2b0a841 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -174,11 +174,6 @@ extern int osi_vnhold(struct vcache *); #endif /* - * Time related macros - */ -#define osi_GetuTime(x) osi_GetTime(x) - -/* * We use osi_timeval32_t because the native timeval varies in size on * different platforms. We require a fixed size timeval, at least for the * xstats. diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c index cc57f36..24ec053 100644 --- a/src/afs/afs_server.c +++ b/src/afs/afs_server.c @@ -172,7 +172,7 @@ afs_MarkServerUpOrDown(struct srvAddr *sa, int a_isDown) * updated; we'll need them one way or another. */ currTimeP = &currTime; - osi_GetuTime(currTimeP); + osi_GetTime(currTimeP); upDownP = GetUpDownStats(a_serverP); @@ -400,7 +400,7 @@ afs_CountServers(void) * Compute the current time, used to figure out server record ages. */ currTimeP = &currTime; - osi_GetuTime(currTimeP); + osi_GetTime(currTimeP); /* * Sweep the server hash table, tallying all we need to know. @@ -1827,7 +1827,7 @@ afs_ActivateServer(struct srvAddr *sap) */ aserver->flags |= AFS_SERVER_FLAG_ACTIVATED; currTimeP = &currTime; - osi_GetuTime(currTimeP); + osi_GetTime(currTimeP); aserver->activationTime = currTime.tv_sec; upDownP = GetUpDownStats(aserver); if (aserver->flags & SRVR_ISDOWN) { diff --git a/src/afs/afs_stats.h b/src/afs/afs_stats.h index bc9403b..0fd5298 100644 --- a/src/afs/afs_stats.h +++ b/src/afs/afs_stats.h @@ -54,13 +54,13 @@ typedef struct { #define XSTATS_START_TIME(arg) \ opP = &(afs_stats_cmfullperf.rpc.fsRPCTimes[arg]); \ - osi_GetuTime(&opStartTime); + osi_GetTime(&opStartTime); #define XSTATS_START_CMTIME(arg) \ opP = &(afs_stats_cmfullperf.rpc.cmRPCTimes[arg]); \ - osi_GetuTime(&opStartTime); + osi_GetTime(&opStartTime); -#define XSTATS_END_TIME osi_GetuTime(&opStopTime); \ +#define XSTATS_END_TIME osi_GetTime(&opStopTime); \ (opP->numOps)++; \ if (!code) { (opP->numSuccesses)++; \ afs_stats_GetDiff(elapsedTime, opStartTime, opStopTime); \ -- 1.9.4