Let SRXAFS_GetStatistics64 return correct values for the workstations
authorHartmut Reuter <reuter@rzg.mpg.de>
Tue, 31 Aug 2010 11:30:41 +0000 (13:30 +0200)
committerDerrick Brashear <shadow@dementia.org>
Tue, 31 Aug 2010 16:23:45 +0000 (09:23 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/viced/afsfileprocs.c
src/viced/host.c
src/viced/host.h

index 1eca526..40dea53 100644 (file)
@@ -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));
 
 
 
index 604b3ab..868d272 100644 (file)
@@ -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
index 4b66062..3e7b3c0 100644 (file)
@@ -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,