From: Andrew Deason Date: Thu, 29 Sep 2011 23:31:37 +0000 (-0500) Subject: viced: Use xfer indices for xfer data X-Git-Tag: upstream/1.8.0_pre1^2~3208 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=22d94407ea06a3213b7f0f6d57edd48d1977b2e1;p=packages%2Fo%2Fopenafs.git viced: Use xfer indices for xfer data 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 Reviewed-by: Derrick Brashear --- diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index fa949f416..00ec9c3d5 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -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, diff --git a/src/viced/fs_stats.h b/src/viced/fs_stats.h index 941fe1fb4..fe6698e0e 100644 --- a/src/viced/fs_stats.h +++ b/src/viced/fs_stats.h @@ -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 *); diff --git a/src/viced/fsstats.c b/src/viced/fsstats.c index 1abceca5d..ec933b917 100644 --- a/src/viced/fsstats.c +++ b/src/viced/fsstats.c @@ -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