viced: Use xfer indices for xfer data
authorAndrew Deason <adeason@sinenomine.net>
Thu, 29 Sep 2011 23:31:37 +0000 (18:31 -0500)
committerDerrick Brashear <shadow@dementix.org>
Fri, 30 Sep 2011 23:50:23 +0000 (16:50 -0700)
Use the xfer indices for the xfer-related data, not the op indices, so
we don't try to fill in data beyond the actual storage for the stats.

Change-Id: I075d4eb9439d9bd603489f0aa90b3c18c3959de3
Reviewed-on: http://gerrit.openafs.org/5524
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/viced/afsfileprocs.c
src/viced/fs_stats.h
src/viced/fsstats.c

index fa949f4..00ec9c3 100644 (file)
@@ -2287,7 +2287,7 @@ common_FetchData64(struct rx_call *acall, struct AFSFid *Fid,
        parentwhentargetnotdir = NULL;
     }
 
-    fsstats_StartXfer(&fsstats);
+    fsstats_StartXfer(&fsstats, FS_STATS_XFERIDX_FETCHDATA);
 
     /* actually do the data transfer */
     errorCode =
@@ -2900,7 +2900,7 @@ common_StoreData64(struct rx_call *acall, struct AFSFid *Fid,
        parentwhentargetnotdir = NULL;
     }
 
-    fsstats_StartXfer(&fsstats);
+    fsstats_StartXfer(&fsstats, FS_STATS_XFERIDX_STOREDATA);
 
     errorCode =
        StoreData_RXStyle(volptr, targetptr, Fid, client, acall, Pos, Length,
index 941fe1f..fe6698e 100644 (file)
@@ -340,7 +340,6 @@ extern afs_uint32 FS_HostAddr_HBO;
 
 /* Logging helper functions */
 struct fsstats {
-    int index;
     struct fs_stats_opTimingData *opP;
     struct fs_stats_xferData *xferP;
     struct timeval opStartTime;
@@ -349,7 +348,7 @@ struct fsstats {
 
 extern void fsstats_StartOp(struct fsstats *stats, int index);
 extern void fsstats_FinishOp(struct fsstats *stats, int code);
-extern void fsstats_StartXfer(struct fsstats *stats);
+extern void fsstats_StartXfer(struct fsstats *stats, int index);
 extern void fsstats_FinishXfer(struct fsstats *, int, afs_sfsize_t,
                               afs_sfsize_t, int *);
 
index 1abceca..ec933b9 100644 (file)
@@ -25,7 +25,6 @@
 void
 fsstats_StartOp(struct fsstats *stats, int index)
 {
-    stats->index = index;
     stats->opP = &(afs_FullPerfStats.det.rpcOpTimes[index]);
     FS_LOCK;
     (stats->opP->numOps)++;
@@ -56,10 +55,10 @@ fsstats_FinishOp(struct fsstats *stats, int code)
 }
 
 void
-fsstats_StartXfer(struct fsstats *stats)
+fsstats_StartXfer(struct fsstats *stats, int index)
 {
     FT_GetTimeOfDay(&stats->xferStartTime, NULL);
-    stats->xferP = &(afs_FullPerfStats.det.xferOpTimes[stats->index]);
+    stats->xferP = &(afs_FullPerfStats.det.xferOpTimes[index]);
 }
 
 void