]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
xstat: cm xstat time values are 32 bit
authorMichael Meffie <mmeffie@sinenomine.net>
Fri, 12 Aug 2011 18:29:48 +0000 (14:29 -0400)
committerDerrick Brashear <shadow@dementix.org>
Sat, 7 Jan 2012 14:21:05 +0000 (06:21 -0800)
The kernel space cm xstat time structures are implemented as 32
bit values in memory and on the wire.  Define the client side
xstat userspace structures as 32 bit time values as well to avoid
size mismatches on systems with native 64 bit time values.

Reviewed-on: http://gerrit.openafs.org/5237
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 130144850c6d05bc69e06257a5d7219eb98697d8)

Change-Id: I8726efdd7123e9a1e0e4536bf2766c441964475d
Reviewed-on: http://gerrit.openafs.org/6386
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/afs/afs_osi.h
src/afs/afs_stats.h

index c1b04adcb4c7683f293ba51bb97c6b1ad88115f8..17966eeaa7ccf04f57079608381d3ccfcc03afba 100644 (file)
@@ -178,10 +178,16 @@ typedef struct {
     afs_int32 tv_sec;
     afs_int32 tv_usec;
 } osi_timeval_t;
+typedef struct {
+    afs_int32 tv_sec;
+    afs_int32 tv_usec;
+} osi_timeval32_t;
 #elif defined(AFS_SUN57_ENV)
 typedef struct timeval32 osi_timeval_t;
+typedef struct timeval32 osi_timeval32_t;
 #else
 typedef struct timeval osi_timeval_t;
+typedef struct timeval osi_timeval32_t;
 #endif /* AFS_SGI61_ENV */
 
 #ifndef UKERNEL
index f59963bc78be4fe470e41bfb0e81d75eab1055c5..92a1ba8a47e039a9bc38beedbf912dd2f160aa99 100644 (file)
 #define AFS_STATS(arg) arg
 #ifndef KERNEL
 /* NOTE: Ensure this is the same size in user and kernel mode. */
-typedef struct timeval osi_timeval_t;
+typedef struct {
+    afs_int32 tv_sec;
+    afs_int32 tv_usec;
+} osi_timeval32_t;
 #endif /* !KERNEL */
 
 #define XSTATS_DECLS struct afs_stats_opTimingData *opP = NULL; \
@@ -886,10 +889,10 @@ struct afs_stats_CMPerf {
 struct afs_stats_opTimingData {
     afs_int32 numOps;          /*Number of operations executed */
     afs_int32 numSuccesses;    /*Number of successful ops */
-    osi_timeval_t sumTime;     /*Sum of sample timings */
-    osi_timeval_t sqrTime;     /*Sum of squares of sample timings */
-    osi_timeval_t minTime;     /*Minimum timing value observed */
-    osi_timeval_t maxTime;     /*Minimum timing value observed */
+    osi_timeval32_t sumTime;   /*Sum of sample timings */
+    osi_timeval32_t sqrTime;   /*Sum of squares of sample timings */
+    osi_timeval32_t minTime;   /*Minimum timing value observed */
+    osi_timeval32_t maxTime;   /*Minimum timing value observed */
 };
 
 /*
@@ -912,10 +915,10 @@ struct afs_stats_opTimingData {
 struct afs_stats_xferData {
     afs_int32 numXfers;                /*Number of successful xfers */
     afs_int32 numSuccesses;    /*Number of successful xfers */
-    osi_timeval_t sumTime;     /*Sum of timing values */
-    osi_timeval_t sqrTime;     /*Sum of squares of timing values */
-    osi_timeval_t minTime;     /*Minimum xfer time recorded */
-    osi_timeval_t maxTime;     /*Maximum xfer time recorded */
+    osi_timeval32_t sumTime;   /*Sum of timing values */
+    osi_timeval32_t sqrTime;   /*Sum of squares of timing values */
+    osi_timeval32_t minTime;   /*Minimum xfer time recorded */
+    osi_timeval32_t maxTime;   /*Maximum xfer time recorded */
     afs_int32 sumBytes;                /*Sum of KBytes transferred */
     afs_int32 minBytes;                /*Minimum value observed */
     afs_int32 maxBytes;                /*Maximum value observed */