From e93786b01b358dce419fa7f446cf154e6e40f5a0 Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Tue, 4 Oct 2011 17:47:48 -0400 Subject: [PATCH 1/1] vol: remove OPENAFS_VOL_STATS OPENAFS_VOL_STATS has been unconditionally defined since the IBM days. Adjust the code to assume it is set. Change-Id: I3b5ff99a469e6865ff1e10405a7f77d8c3890f59 Reviewed-on: http://gerrit.openafs.org/5551 Reviewed-by: Derrick Brashear Tested-by: BuildBot --- src/viced/afsfileprocs.c | 17 ----------------- src/vol/fssync-debug.c | 4 ---- src/vol/volume.c | 10 +--------- src/vol/volume.h | 16 ---------------- 4 files changed, 1 insertion(+), 46 deletions(-) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 582d508..730d371 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -157,9 +157,7 @@ extern int SystemId; static struct AFSCallStatistics AFSCallStats; struct fs_stats_FullPerfStats afs_FullPerfStats; extern int AnonymousID; -#if OPENAFS_VOL_STATS static const char nullString[] = ""; -#endif /* OPENAFS_VOL_STATS */ struct afs_FSStats { afs_int32 NothingYet; @@ -1976,16 +1974,10 @@ RXUpdate_VolumeStatus(Volume * volptr, AFSStoreVolumeStatus * StoreVolStatus, if (strlen(Name) > 0) { strcpy(V_name(volptr), Name); } -#if OPENAFS_VOL_STATS /* * We don't overwrite the motd field, since it's now being used * for stats */ -#else - if (strlen(Motd) > 0) { - strcpy(V_motd(volptr), Motd); - } -#endif VUpdateVolume(&errorCode, volptr); return (errorCode); @@ -2027,20 +2019,11 @@ RXGetVolumeStatus(AFSFetchVolumeStatus * status, char **name, char **offMsg, ViceLogThenPanic(0, ("Failed malloc in RXGetVolumeStatus\n")); } strcpy(*offMsg, V_offlineMessage(volptr)); -#if OPENAFS_VOL_STATS *motd = malloc(1); if (!*motd) { ViceLogThenPanic(0, ("Failed malloc in RXGetVolumeStatus\n")); } strcpy(*motd, nullString); -#else - temp = strlen(V_motd(volptr)) + 1; - *motd = malloc(temp); - if (!*motd) { - ViceLogThenPanic(0, ("Failed malloc in RXGetVolumeStatus\n")); - } - strcpy(*motd, V_motd(volptr)); -#endif /* OPENAFS_VOL_STATS */ return 0; } /*RXGetVolumeStatus */ diff --git a/src/vol/fssync-debug.c b/src/vol/fssync-debug.c index 820a1f7..beddeb6 100644 --- a/src/vol/fssync-debug.c +++ b/src/vol/fssync-debug.c @@ -856,11 +856,7 @@ VolHdrQuery(struct cmd_syndesc * as, void * rock) printf("\texpirationDate = %u\n", v.expirationDate); printf("\tbackupDate = %u\n", v.backupDate); printf("\tcopyDate = %u\n", v.copyDate); -#ifdef OPENAFS_VOL_STATS printf("\tstat_initialized = %d\n", v.stat_initialized); -#else - printf("\tmtd = '%s'\n", v.motd); -#endif printf("}\n"); } diff --git a/src/vol/volume.c b/src/vol/volume.c index 65af01d..4a07e07 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -3202,7 +3202,6 @@ attach2(Error * ec, VolId volumeId, char *path, struct DiskPartition64 *partp, if (!*ec) { struct IndexFileHeader iHead; -#if OPENAFS_VOL_STATS /* * We just read in the diskstuff part of the header. If the detailed * volume stats area has not yet been initialized, we should bzero the @@ -3212,7 +3211,6 @@ attach2(Error * ec, VolId volumeId, char *path, struct DiskPartition64 *partp, memset((V_stat_area(vp)), 0, VOL_STATS_BYTES); V_stat_initialized(vp) = 1; } -#endif /* OPENAFS_VOL_STATS */ (void)ReadHeader(ec, vp->vnodeIndex[vSmall].handle, (char *)&iHead, sizeof(iHead), @@ -6640,11 +6638,7 @@ VolumeExternalName_r(VolumeId volumeId, char * name, size_t len) /* Volume Usage Statistics routines */ /***************************************************/ -#if OPENAFS_VOL_STATS #define OneDay (86400) /* 24 hours' worth of seconds */ -#else -#define OneDay (24*60*60) /* 24 hours */ -#endif /* OPENAFS_VOL_STATS */ static time_t Midnight(time_t t) { @@ -6715,14 +6709,12 @@ VAdjustVolumeStatistics_r(Volume * vp) V_dayUse(vp) = 0; V_dayUseDate(vp) = Midnight(now); -#if OPENAFS_VOL_STATS /* * All we need to do is bzero the entire VOL_STATS_BYTES of * the detailed volume statistics area. */ memset((V_stat_area(vp)), 0, VOL_STATS_BYTES); -#endif /* OPENAFS_VOL_STATS */ - } + } /*It's been more than a day of collection */ /* diff --git a/src/vol/volume.h b/src/vol/volume.h index 4ba4494..f9b6473 100644 --- a/src/vol/volume.h +++ b/src/vol/volume.h @@ -293,12 +293,7 @@ typedef struct VolumePackageOptions { #define ACLVERSION 1 #define LINKTABLEVERSION 1 -/* - * Define whether we are keeping detailed statistics on volume dealings. - */ -#define OPENAFS_VOL_STATS 1 -#if OPENAFS_VOL_STATS /* * Define various indices and counts used in keeping volume-level statistics. */ @@ -327,7 +322,6 @@ typedef struct VolumePackageOptions { #define VOL_STATS_TIME_IDX_3 3 /*1 hr to 24 hrs */ #define VOL_STATS_TIME_IDX_4 4 /*1 day to 7 days */ #define VOL_STATS_TIME_IDX_5 5 /*Greater than 1 week */ -#endif /* OPENAFS_VOL_STATS */ /* Volume header. This is the contents of the named file representing * the volume. Read-only by the file server! @@ -465,17 +459,12 @@ typedef struct VolumeDiskData { * set when the copy is created */ Date copyDate; -#if OPENAFS_VOL_STATS bit32 stat_initialized; /*Are the stat fields below set up? */ bit32 reserved4[7]; -#else - bit32 reserved4[8]; -#endif /* OPENAFS_VOL_STATS */ /* messages */ #define VMSGSIZE 128 char offlineMessage[VMSGSIZE]; /* Why the volume is offline */ -#if OPENAFS_VOL_STATS #define VOL_STATS_BYTES 128 /* * Keep per-volume aggregate statistics on type and distance of access, @@ -487,9 +476,6 @@ typedef struct VolumeDiskData { bit32 stat_fileDiffAuthor[VOL_STATS_NUM_TIME_FIELDS]; bit32 stat_dirSameAuthor[VOL_STATS_NUM_TIME_FIELDS]; bit32 stat_dirDiffAuthor[VOL_STATS_NUM_TIME_FIELDS]; -#else - char motd[VMSGSIZE]; /* Volume "message of the day" */ -#endif /* OPENAFS_VOL_STATS */ } VolumeDiskData; @@ -782,7 +768,6 @@ struct volHeader { #define V_offlineMessage(vp) ((vp)->header->diskstuff.offlineMessage) #define V_disk(vp) ((vp)->header->diskstuff) #define V_motd(vp) ((vp)->header->diskstuff.motd) -#if OPENAFS_VOL_STATS #define V_stat_initialized(vp) ((vp)->header->diskstuff.stat_initialized) #define V_stat_area(vp) (((vp)->header->diskstuff.stat_reads)) #define V_stat_reads(vp, idx) (((vp)->header->diskstuff.stat_reads)[idx]) @@ -791,7 +776,6 @@ struct volHeader { #define V_stat_fileDiffAuthor(vp, idx) (((vp)->header->diskstuff.stat_fileDiffAuthor)[idx]) #define V_stat_dirSameAuthor(vp, idx) (((vp)->header->diskstuff.stat_dirSameAuthor)[idx]) #define V_stat_dirDiffAuthor(vp, idx) (((vp)->header->diskstuff.stat_dirDiffAuthor)[idx]) -#endif /* OPENAFS_VOL_STATS */ #define V_volUpCounter(vp) ((vp)->header->diskstuff.volUpdateCounter) /* File offset computations. The offset values in the volume header are -- 1.9.4