From 44261b25648a419abbc61b2a9d2d3f0373428080 Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Tue, 4 Oct 2011 17:35:18 -0400 Subject: [PATCH] viced: remove FS_STATS_DETAILED FS_STATS_DETAILED has been unconditionally defined since the IBM days. Adjust the code to assume it is set. Change-Id: If7fb913bbb42dba5d749e7c30b8d9b7d81e4b4f8 Reviewed-on: http://gerrit.openafs.org/5550 Reviewed-by: Derrick Brashear Tested-by: BuildBot --- src/tviced/serialize_state.c | 11 ------- src/tviced/serialize_state.h | 4 --- src/tviced/state_analyzer.c | 4 --- src/viced/afsfileprocs.c | 62 ++---------------------------------- src/viced/fs_stats.h | 6 ---- src/viced/fsstats.c | 34 -------------------- src/viced/host.c | 12 ------- src/viced/host.h | 6 ---- src/viced/viced.c | 4 --- 9 files changed, 2 insertions(+), 141 deletions(-) diff --git a/src/tviced/serialize_state.c b/src/tviced/serialize_state.c index 3fbb5f130..5c86e3f88 100644 --- a/src/tviced/serialize_state.c +++ b/src/tviced/serialize_state.c @@ -934,11 +934,7 @@ fs_stateFillHeader(struct fs_state_header * hdr) #else hdr->endianness = 0; #endif -#ifdef FS_STATS_DETAILED hdr->stats_detailed = 1; -#else - hdr->stats_detailed = 0; -#endif if (strlcpy(hdr->server_version_string, cml_version_number, sizeof(hdr->server_version_string)) >= sizeof(hdr->server_version_string)) { ViceLog(0, ("fs_stateFillHeader: WARNING -- cml_version_number field truncated\n")); @@ -976,17 +972,10 @@ fs_stateCheckHeader(struct fs_state_header * hdr) ret = 1; } -#ifdef FS_STATS_DETAILED else if (!hdr->stats_detailed) { ViceLog(0, ("fs_stateCheckHeader: wrong config flags\n")); ret = 1; } -#else /* FS_STATS_DETAILED */ - else if (hdr->stats_detailed) { - ViceLog(0, ("fs_stateCheckHeader: wrong config flags\n")); - ret = 1; - } -#endif /* FS_STATS_DETAILED */ else if (!afs_uuid_equal(&hdr->server_uuid, &FS_HostUUID)) { ViceLog(0, ("fs_stateCheckHeader: server UUID does not match this server's UUID\n")); diff --git a/src/tviced/serialize_state.h b/src/tviced/serialize_state.h index 2a34723d4..2d095dfdc 100644 --- a/src/tviced/serialize_state.h +++ b/src/tviced/serialize_state.h @@ -102,12 +102,8 @@ struct hostDiskEntry { byte Console; /* XXXX This host is a console */ byte hcpsfailed; /* Retry the cps call next time */ byte hcps_valid; /* prlist_val not null */ -#if FS_STATS_DETAILED byte InSameNetwork; /*Is host's addr in the same network as * the File Server's? */ -#else - byte padding1[1]; /* for padding */ -#endif /* FS_STATS_DETAILED */ afs_uint32 hcps_len; /* length of hcps */ afs_uint32 LastCall; /* time of last call from host */ afs_uint32 ActiveCall; /* time of any call but gettime */ diff --git a/src/tviced/state_analyzer.c b/src/tviced/state_analyzer.c index 0db628fe2..5302d1d11 100644 --- a/src/tviced/state_analyzer.c +++ b/src/tviced/state_analyzer.c @@ -1248,11 +1248,7 @@ dump_he_entry(void) DPFV1("hcpsfailed", "u", he_cursor.he.hcpsfailed); DPFV1("hcps_valid", "u", he_cursor.he.hcps_valid); if (hdrs.hdr.stats_detailed) { -#ifdef FS_STATS_DETAILED DPFV1("InSameNetwork", "u", he_cursor.he.InSameNetwork); -#else - DPFV1("InSameNetwork", "u", he_cursor.he.padding1[0]); -#endif } DPFV1("hcps_len", "u", he_cursor.he.hcps_len); DPFT1("LastCall", he_cursor.he.LastCall); diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 792d6afd1..9d1d5165b 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -151,10 +151,8 @@ extern afs_int32 dataVersionHigh; extern int SystemId; static struct AFSCallStatistics AFSCallStats; -#if FS_STATS_DETAILED struct fs_stats_FullPerfStats afs_FullPerfStats; extern int AnonymousID; -#endif /* FS_STATS_DETAILED */ #if OPENAFS_VOL_STATS static const char nullString[] = ""; #endif /* OPENAFS_VOL_STATS */ @@ -1469,20 +1467,14 @@ DeleteTarget(Vnode * parentptr, Volume * volptr, Vnode ** targetptr, */ static void Update_ParentVnodeStatus(Vnode * parentptr, Volume * volptr, DirHandle * dir, - int author, int linkcount, -#if FS_STATS_DETAILED - char a_inSameNetwork -#endif /* FS_STATS_DETAILED */ - ) + int author, int linkcount, char a_inSameNetwork) { afs_fsize_t newlength; /* Holds new directory length */ afs_fsize_t parentLength; Error errorCode; -#if FS_STATS_DETAILED Date currDate; /*Current date */ int writeIdx; /*Write index to bump */ int timeIdx; /*Authorship time index to bump */ -#endif /* FS_STATS_DETAILED */ parentptr->disk.dataVersion++; newlength = (afs_fsize_t) afs_dir_Length(dir); @@ -1500,7 +1492,6 @@ Update_ParentVnodeStatus(Vnode * parentptr, Volume * volptr, DirHandle * dir, } VN_SET_LEN(parentptr, newlength); -#if FS_STATS_DETAILED /* * Update directory write stats for this volume. Note that the auth * counter is located immediately after its associated ``distance'' @@ -1532,7 +1523,6 @@ Update_ParentVnodeStatus(Vnode * parentptr, Volume * volptr, DirHandle * dir, } else { V_stat_dirDiffAuthor(volptr, timeIdx)++; } -#endif /* FS_STATS_DETAILED */ parentptr->disk.author = author; parentptr->disk.linkCount = linkcount; @@ -1555,11 +1545,9 @@ Update_TargetVnodeStatus(Vnode * targetptr, afs_uint32 Caller, Vnode * parentptr, Volume * volptr, afs_fsize_t length) { -#if FS_STATS_DETAILED Date currDate; /*Current date */ int writeIdx; /*Write index to bump */ int timeIdx; /*Authorship time index to bump */ -#endif /* FS_STATS_DETAILED */ if (Caller & (TVS_CFILE | TVS_SLINK | TVS_MKDIR)) { /* initialize new file */ targetptr->disk.parent = parentptr->vnodeNumber; @@ -1571,7 +1559,6 @@ Update_TargetVnodeStatus(Vnode * targetptr, afs_uint32 Caller, targetptr->disk.linkCount = (Caller & TVS_MKDIR ? 2 : 1); /* the inode was created in Alloc_NewVnode() */ } -#if FS_STATS_DETAILED /* * Update file write stats for this volume. Note that the auth * counter is located immediately after its associated ``distance'' @@ -1612,7 +1599,6 @@ Update_TargetVnodeStatus(Vnode * targetptr, afs_uint32 Caller, V_stat_fileDiffAuthor(volptr, timeIdx)++; } } -#endif /* FS_STATS_DETAILED */ if (!(Caller & TVS_SSTATUS)) targetptr->disk.author = client->ViceId; @@ -1947,7 +1933,7 @@ RXUpdate_VolumeStatus(Volume * volptr, AFSStoreVolumeStatus * StoreVolStatus, if (strlen(Motd) > 0) { strcpy(V_motd(volptr), Motd); } -#endif /* FS_STATS_DETAILED */ +#endif VUpdateVolume(&errorCode, volptr); return (errorCode); @@ -2174,10 +2160,7 @@ common_FetchData64(struct rx_call *acall, struct AFSFid *Fid, struct fsstats fsstats; afs_sfsize_t bytesToXfer; /* # bytes to xfer */ afs_sfsize_t bytesXferred; /* # bytes actually xferred */ - -#if FS_STATS_DETAILED int readIdx; /* Index of read stats array to bump */ -#endif /* FS_STATS_DETAILED */ fsstats_StartOp(&fsstats, FS_STATS_RPCIDX_FETCHDATA); @@ -2214,7 +2197,6 @@ common_FetchData64(struct rx_call *acall, struct AFSFid *Fid, SetVolumeSync(Sync, volptr); -#if FS_STATS_DETAILED /* * Remember that another read operation was performed. */ @@ -2228,7 +2210,6 @@ common_FetchData64(struct rx_call *acall, struct AFSFid *Fid, V_stat_reads(volptr, readIdx + 1)++; } FS_UNLOCK; -#endif /* FS_STATS_DETAILED */ /* Check whether the caller has permission access to fetch the data */ if ((errorCode = Check_PermissionRights(targetptr, client, rights, CHK_FETCHDATA, 0))) @@ -3197,14 +3178,9 @@ SAFSS_RemoveFile(struct rx_call *acall, struct AFSFid *DirFid, char *Name, } /* Update the vnode status of the parent dir */ -#if FS_STATS_DETAILED Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId, parentptr->disk.linkCount, client->InSameNetwork); -#else - Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId, - parentptr->disk.linkCount); -#endif /* FS_STATS_DETAILED */ /* Return the updated parent dir's status back to caller */ GetStatus(parentptr, OutDirStatus, rights, anyrights, 0); @@ -3340,14 +3316,9 @@ SAFSS_CreateFile(struct rx_call *acall, struct AFSFid *DirFid, char *Name, } /* update the status of the parent vnode */ -#if FS_STATS_DETAILED Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId, parentptr->disk.linkCount, client->InSameNetwork); -#else - Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId, - parentptr->disk.linkCount); -#endif /* FS_STATS_DETAILED */ /* update the status of the new file's vnode */ Update_TargetVnodeStatus(targetptr, TVS_CFILE, client, InStatus, @@ -3785,17 +3756,10 @@ SAFSS_Rename(struct rx_call *acall, struct AFSFid *OldDirFid, char *OldName, osi_Assert(afs_dir_Delete(&olddir, OldName) == 0); /* if the directory length changes, reflect it in the statistics */ -#if FS_STATS_DETAILED Update_ParentVnodeStatus(oldvptr, volptr, &olddir, client->ViceId, oldvptr->disk.linkCount, client->InSameNetwork); Update_ParentVnodeStatus(newvptr, volptr, &newdir, client->ViceId, newvptr->disk.linkCount, client->InSameNetwork); -#else - Update_ParentVnodeStatus(oldvptr, volptr, &olddir, client->ViceId, - oldvptr->disk.linkCount); - Update_ParentVnodeStatus(newvptr, volptr, &newdir, client->ViceId, - newvptr->disk.linkCount); -#endif /* FS_STATS_DETAILED */ if (oldvptr == newvptr) oldvptr->disk.dataVersion--; /* Since it was bumped by 2! */ @@ -4016,14 +3980,9 @@ SAFSS_Symlink(struct rx_call *acall, struct AFSFid *DirFid, char *Name, } /* update the status of the parent vnode */ -#if FS_STATS_DETAILED Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId, parentptr->disk.linkCount, client->InSameNetwork); -#else - Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId, - parentptr->disk.linkCount); -#endif /* FS_STATS_DETAILED */ /* update the status of the new symbolic link file vnode */ Update_TargetVnodeStatus(targetptr, TVS_SLINK, client, InStatus, @@ -4212,14 +4171,9 @@ SAFSS_Link(struct rx_call *acall, struct AFSFid *DirFid, char *Name, /* update the status in the parent vnode */ /**WARNING** --> disk.author SHOULDN'T be modified???? */ -#if FS_STATS_DETAILED Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId, parentptr->disk.linkCount, client->InSameNetwork); -#else - Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId, - parentptr->disk.linkCount); -#endif /* FS_STATS_DETAILED */ targetptr->disk.linkCount++; targetptr->disk.author = client->ViceId; @@ -4373,14 +4327,9 @@ SAFSS_MakeDir(struct rx_call *acall, struct AFSFid *DirFid, char *Name, } /* Update the status for the parent dir */ -#if FS_STATS_DETAILED Update_ParentVnodeStatus(parentptr, volptr, &parentdir, client->ViceId, parentptr->disk.linkCount + 1, client->InSameNetwork); -#else - Update_ParentVnodeStatus(parentptr, volptr, &parentdir, client->ViceId, - parentptr->disk.linkCount + 1); -#endif /* FS_STATS_DETAILED */ /* Point to target's ACL buffer and copy the parent's ACL contents to it */ osi_Assert((SetAccessList @@ -4523,14 +4472,9 @@ SAFSS_RemoveDir(struct rx_call *acall, struct AFSFid *DirFid, char *Name, } /* Update the status for the parent dir; link count is also adjusted */ -#if FS_STATS_DETAILED Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId, parentptr->disk.linkCount - 1, client->InSameNetwork); -#else - Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId, - parentptr->disk.linkCount - 1); -#endif /* FS_STATS_DETAILED */ /* Return to the caller the updated parent dir status */ GetStatus(parentptr, OutDirStatus, rights, anyrights, NULL); @@ -5391,7 +5335,6 @@ SRXAFS_GetXStats(struct rx_call *a_call, afs_int32 a_clientVersionNum, */ afs_perfstats.numPerfCalls++; -#if FS_STATS_DETAILED afs_FullPerfStats.overall.numPerfCalls = afs_perfstats.numPerfCalls; FillPerfValues(&afs_FullPerfStats.overall); @@ -5404,7 +5347,6 @@ SRXAFS_GetXStats(struct rx_call *a_call, afs_int32 a_clientVersionNum, memcpy(dataBuffP, &afs_FullPerfStats, dataBytes); a_dataP->AFS_CollData_len = dataBytes >> 2; a_dataP->AFS_CollData_val = dataBuffP; -#endif break; case AFS_XSTATSCOLL_CBSTATS: diff --git a/src/viced/fs_stats.h b/src/viced/fs_stats.h index fe6698e0e..e3c0c3fb3 100644 --- a/src/viced/fs_stats.h +++ b/src/viced/fs_stats.h @@ -21,10 +21,6 @@ #include /*System configuration info */ -/* - * Decide if we're keeping detailed File Server stats. - */ -#define FS_STATS_DETAILED 1 /* * Performance numbers. @@ -136,7 +132,6 @@ struct afs_PerfStats { afs_int32 spare[28]; }; -#if FS_STATS_DETAILED /* * Assign each of the File Server's RPC interface routines an index. */ @@ -321,7 +316,6 @@ struct fs_stats_FullPerfStats { * AFS_XSTATSCOLL_FULL_PERF_INFO collection to the xstat package. */ extern struct fs_stats_FullPerfStats afs_FullPerfStats; -#endif /* FS_STATS_DETAILED */ /* diff --git a/src/viced/fsstats.c b/src/viced/fsstats.c index efaeb386f..d48c3702e 100644 --- a/src/viced/fsstats.c +++ b/src/viced/fsstats.c @@ -21,7 +21,6 @@ #include "viced.h" #include "fs_stats.h" -#if FS_STATS_DETAILED void fsstats_StartOp(struct fsstats *stats, int index) @@ -131,36 +130,3 @@ fsstats_FinishXfer(struct fsstats *stats, int code, } FS_UNLOCK; } - -#else - -void -fsstats_StartOp(struct fsstats *stats, int index) -{ - return; -} - -void -fsstats_FinishOp(struct fsstats *stats, int code) -{ - return; -} - -void -fsstats_StartXfer(struct fsstats *stats) -{ - return; -} - -void -fsstats_FinishXfer(struct fsstats *stats, int code, - afs_sfsize_t bytesToXfer, afs_sfsize_t bytesXferred, - int *remainder) -{ - return; -} - - - - -#endif diff --git a/src/viced/host.c b/src/viced/host.c index 2502331dc..c1b8da9a6 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -492,7 +492,6 @@ h_NBLock_r(struct host *host) } -#if FS_STATS_DETAILED /*------------------------------------------------------------------------ * PRIVATE h_AddrInSameNetwork * @@ -568,7 +567,6 @@ h_AddrInSameNetwork(afs_uint32 a_targetAddr, afs_uint32 a_candAddr) return (0); } /*h_AddrInSameNetwork */ -#endif /* FS_STATS_DETAILED */ /* Assumptions: called with held host */ @@ -680,9 +678,7 @@ h_Alloc_r(struct rx_connection *r_con) { struct servent *serverentry; struct host *host; -#if FS_STATS_DETAILED afs_uint32 newHostAddr_HBO; /*New host IP addr, in host byte order */ -#endif /* FS_STATS_DETAILED */ host = GetHT(); if (!host) @@ -722,7 +718,6 @@ h_Alloc_r(struct rx_connection *r_con) h_Hold_r(host); h_Lock_r(host); h_InsertList_r(host); /* update global host List */ -#if FS_STATS_DETAILED /* * Compare the new host's IP address (in host byte order) with ours * (the File Server's), remembering if they are in the same network. @@ -730,7 +725,6 @@ h_Alloc_r(struct rx_connection *r_con) newHostAddr_HBO = (afs_uint32) ntohl(host->host); host->InSameNetwork = h_AddrInSameNetwork(FS_HostAddr_HBO, newHostAddr_HBO); -#endif /* FS_STATS_DETAILED */ return host; } /*h_Alloc_r */ @@ -2473,9 +2467,7 @@ h_FindClient_r(struct rx_connection *tcon) ObtainWriteLock(&client->lock); client->refCount = 1; client->host = host; -#if FS_STATS_DETAILED client->InSameNetwork = host->InSameNetwork; -#endif /* FS_STATS_DETAILED */ client->ViceId = viceid; client->expTime = expTime; /* rx only */ client->authClass = authClass; /* rx only */ @@ -3480,9 +3472,7 @@ h_hostToDiskEntry_r(struct host * in, struct hostDiskEntry * out) out->ActiveCall = in->ActiveCall; out->cpsCall = in->cpsCall; out->cblist = in->cblist; -#ifdef FS_STATS_DETAILED out->InSameNetwork = in->InSameNetwork; -#endif /* special fields we save, but are not memcpy'd back on restore */ out->index = in->index; @@ -3503,9 +3493,7 @@ h_diskEntryToHost_r(struct hostDiskEntry * in, struct host * out) out->ActiveCall = in->ActiveCall; out->cpsCall = in->cpsCall; out->cblist = in->cblist; -#ifdef FS_STATS_DETAILED out->InSameNetwork = in->InSameNetwork; -#endif } /* index translation routines */ diff --git a/src/viced/host.h b/src/viced/host.h index ac4eb4dc0..e6c63cdef 100644 --- a/src/viced/host.h +++ b/src/viced/host.h @@ -67,11 +67,9 @@ struct host { afs_uint16 port; /* port address of host */ char Console; /* XXXX This host is a console */ unsigned short hostFlags; /* bit map */ -#if FS_STATS_DETAILED char InSameNetwork; /*Is host's addr in the same network as * the File Server's? */ char dummy[3]; /* for padding */ -#endif /* FS_STATS_DETAILED */ char hcpsfailed; /* Retry the cps call next time */ prlist hcps; /* cps for hostip acls */ afs_uint32 LastCall; /* time of last call from host */ @@ -127,12 +125,8 @@ struct client { * structure */ char authClass; /* auth type, RX-only */ char prfail; /* True if prserver couldn't be contacted */ -#if FS_STATS_DETAILED char InSameNetwork; /* Is client's IP address in the same * network as ours? */ -#else /* FS_STATS_DETAILED */ - char dummy; /* For padding */ -#endif /* FS_STATS_DETAILED */ struct Lock lock; /* lock to ensure CPS valid if entry * on host's clients list. */ }; diff --git a/src/viced/viced.c b/src/viced/viced.c index ec117d72e..da464fe08 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -624,7 +624,6 @@ ClearXStatValues(void) * Zero all xstat-related structures. */ memset((&afs_perfstats), 0, sizeof(struct afs_PerfStats)); -#if FS_STATS_DETAILED memset((&afs_FullPerfStats), 0, sizeof(struct fs_stats_FullPerfStats)); @@ -656,7 +655,6 @@ ClearXStatValues(void) # endif afs_perfstats.sysname_ID = SYS_NAME_ID_UNDEFINED; # endif /* SYS_NAME_ID */ -#endif } /*ClearXStatValues */ @@ -2290,9 +2288,7 @@ main(int argc, char *argv[]) strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y", localtime_r(&t, &tm)); ViceLog(0, ("File Server started %s\n", tbuffer)); -#if FS_STATS_DETAILED afs_FullPerfStats.det.epoch.tv_sec = StartTime = tp.tv_sec; -#endif #ifdef AFS_PTHREAD_ENV while (1) { sleep(1000); /* long time */ -- 2.39.5