From 8006ff8bf4a6f1944243309e5130538e3cbe62d5 Mon Sep 17 00:00:00 2001 From: Hartmut Reuter Date: Tue, 31 Aug 2010 13:30:41 +0200 Subject: [PATCH] Let SRXAFS_GetStatistics64 return correct values for the workstations h_GetWorkstats was called also for 64bit which let random contents in the other half of the 64bit field. Worse: little and big endian machines filled different parts of the field so that a later masking in fsprobe would net help for all kinds of servers. Now a small wrapper h_GetWorkstats64 is called which calls h_GetWorkstats correctly. Change-Id: Iaeafd77dfa03d88caa98e4e352f95bfb33d736df Reviewed-on: http://gerrit.openafs.org/2629 Tested-by: BuildBot Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/viced/afsfileprocs.c | 8 ++++---- src/viced/host.c | 13 +++++++++++++ src/viced/host.h | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 1eca526e5..40dea53ae 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -5731,10 +5731,10 @@ SRXAFS_GetStatistics64(struct rx_call *acall, afs_int32 statsVersion, ViceStatis (afs_int32) ((long)sbrk(0) >> 10); #endif FS_UNLOCK; - h_GetWorkStats((int *)&(Statistics->ViceStatistics64_val[STATS64_WORKSTATIONS]), - (int *)&(Statistics->ViceStatistics64_val[STATS64_ACTIVEWORKSTATIONS]), - (int *)0, - (afs_int32) (FT_ApproxTime()) - (15 * 60)); + h_GetWorkStats64(&(Statistics->ViceStatistics64_val[STATS64_WORKSTATIONS]), + &(Statistics->ViceStatistics64_val[STATS64_ACTIVEWORKSTATIONS]), + 0, + (afs_int32) (FT_ApproxTime()) - (15 * 60)); diff --git a/src/viced/host.c b/src/viced/host.c index 604b3ab50..868d2729d 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -3504,6 +3504,19 @@ h_GetWorkStats(int *nump, int *activep, int *delp, afs_int32 cutofftime) } /*h_GetWorkStats */ +void +h_GetWorkStats64(afs_uint64 *nump, afs_uint64 *activep, afs_uint64 *delp, + afs_int32 cutofftime) +{ + int num, active, del; + h_GetWorkStats(&num, &active, &del, cutofftime); + if (nump) + *nump = num; + if (activep) + *activep = active; + if (delp) + *delp = del; +} /*------------------------------------------------------------------------ * PRIVATE h_ClassifyAddress diff --git a/src/viced/host.h b/src/viced/host.h index 4b660627a..3e7b3c06a 100644 --- a/src/viced/host.h +++ b/src/viced/host.h @@ -234,6 +234,7 @@ extern int PutClient(struct client **cp); extern void h_PrintStats(void); extern void h_PrintClients(void); extern void h_GetWorkStats(int *, int *, int *, afs_int32); +extern void h_GetWorkStats64(afs_uint64 *, afs_uint64 *, afs_uint64 *, afs_int32); extern void h_flushhostcps(afs_uint32 hostaddr, afs_uint16 hport); extern void h_GetHostNetStats(afs_int32 * a_numHostsP, afs_int32 * a_sameNetOrSubnetP, -- 2.39.5