X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fviced%2Ffsstats.c;h=efaeb386f75ed58cba2662495d5f5eca82c82b39;hp=1abceca5d2268bdf6ff92a81f423616c32bf8bd2;hb=d43438bb914f267f1c65d81e23efbab6874ae426;hpb=5fbea6da218092ef1942b5ffc8257d7b80311543 diff --git a/src/viced/fsstats.c b/src/viced/fsstats.c index 1abceca..efaeb38 100644 --- a/src/viced/fsstats.c +++ b/src/viced/fsstats.c @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -25,7 +26,7 @@ void fsstats_StartOp(struct fsstats *stats, int index) { - stats->index = index; + assert(index >= 0 && index < FS_STATS_NUM_RPC_OPS); stats->opP = &(afs_FullPerfStats.det.rpcOpTimes[index]); FS_LOCK; (stats->opP->numOps)++; @@ -56,10 +57,11 @@ fsstats_FinishOp(struct fsstats *stats, int code) } void -fsstats_StartXfer(struct fsstats *stats) +fsstats_StartXfer(struct fsstats *stats, int index) { + assert(index >= 0 && index < FS_STATS_NUM_XFER_OPS); FT_GetTimeOfDay(&stats->xferStartTime, NULL); - stats->xferP = &(afs_FullPerfStats.det.xferOpTimes[stats->index]); + stats->xferP = &(afs_FullPerfStats.det.xferOpTimes[index]); } void