]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
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, 7 Sep 2010 18:45:55 +0000 (11:45 -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>
(cherry picked from commit 8006ff8bf4a6f1944243309e5130538e3cbe62d5)
Reviewed-on: http://gerrit.openafs.org/2687

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

index d8d93a724e34e29ba758d6eca655cb514eda9607..84656d81c1aa6b1745dc62f693587c87814002c2 100644 (file)
@@ -5728,10 +5728,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 604b3ab501527052ec260081ddbaf0544daf5831..868d2729d7b3918767261e1dc5af9c8698e4b74a 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 4b660627aeb59c4907977d4773b9b5a0f0b577df..3e7b3c06a6351fad081eaca520aeb28b5be78154 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,