2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include "afs/param.h"
13 #include "afs/sysincludes.h" /* Standard vendor system headers */
14 #ifndef AFS_LINUX22_ENV
15 #include "rpc/types.h"
23 #endif /* AFS_ALPHA_ENV */
24 #include "afsincludes.h" /* Afs-based standard headers */
25 #include "afs/afs_stats.h" /* statistics */
26 #include "afs_prototypes.h"
28 extern int cacheDiskType;
30 /* rock and operations for RX_FILESERVER */
32 struct rxfs_storeVariables {
38 struct AFSStoreStatus InStatus;
42 rxfs_storeUfsPrepare(void *r, afs_uint32 size, afs_uint32 *tlen)
44 *tlen = (size > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : size);
49 rxfs_storeMemPrepare(void *r, afs_uint32 size, afs_uint32 *tlen)
52 struct rxfs_storeVariables *v = (struct rxfs_storeVariables *) r;
54 *tlen = (size > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : size);
56 code = rx_WritevAlloc(v->call, v->tiov, &v->tnio, RX_MAXIOVECS, *tlen);
59 code = rx_Error(v->call);
71 rxfs_storeUfsRead(void *r, struct osi_file *tfile, afs_uint32 offset,
72 afs_uint32 tlen, afs_uint32 *bytesread)
75 struct rxfs_storeVariables *v = (struct rxfs_storeVariables *)r;
78 code = afs_osi_Read(tfile, -1, v->tbuffer, tlen);
84 #if defined(KERNEL_HAVE_UERROR)
92 rxfs_storeMemRead(void *r, struct osi_file *tfile, afs_uint32 offset,
93 afs_uint32 tlen, afs_uint32 *bytesread)
96 struct rxfs_storeVariables *v = (struct rxfs_storeVariables *)r;
97 struct memCacheEntry *mceP = (struct memCacheEntry *)tfile;
100 code = afs_MemReadvBlk(mceP, offset, v->tiov, v->tnio, tlen);
108 rxfs_storeMemWrite(void *r, afs_uint32 l, afs_uint32 *byteswritten)
111 struct rxfs_storeVariables *v = (struct rxfs_storeVariables *)r;
114 code = rx_Writev(v->call, v->tiov, v->tnio, l);
117 code = rx_Error(v->call);
118 return (code ? code : -33);
120 *byteswritten = code;
125 rxfs_storeUfsWrite(void *r, afs_uint32 l, afs_uint32 *byteswritten)
128 struct rxfs_storeVariables *v = (struct rxfs_storeVariables *)r;
131 code = rx_Write(v->call, v->tbuffer, l);
132 /* writing 0 bytes will
133 * push a short packet. Is that really what we want, just because the
134 * data didn't come back from the disk yet? Let's try it and see. */
137 code = rx_Error(v->call);
138 return (code ? code : -33);
140 *byteswritten = code;
145 rxfs_storeStatus(void *rock)
147 struct rxfs_storeVariables *v = (struct rxfs_storeVariables *)rock;
149 if (rx_GetRemoteStatus(v->call) & 1)
155 rxfs_storeClose(void *r, struct AFSFetchStatus *OutStatus, int *doProcessFS)
158 struct AFSVolSync tsync;
159 struct rxfs_storeVariables *v = (struct rxfs_storeVariables *)r;
162 code = EndRXAFS_StoreData(v->call, OutStatus, &tsync);
165 *doProcessFS = 1; /* Flag to run afs_ProcessFS() later on */
171 rxfs_storeDestroy(void **r, afs_int32 error)
173 afs_int32 code = error;
174 struct rxfs_storeVariables *v = (struct rxfs_storeVariables *)*r;
178 osi_FreeLargeSpace(v->tbuffer);
180 osi_FreeSmallSpace(v->tiov);
181 osi_FreeSmallSpace(v);
186 struct storeOps rxfs_storeUfsOps = {
187 rxfs_storeUfsPrepare,
196 struct storeOps rxfs_storeMemOps = {
197 rxfs_storeMemPrepare,
206 rxfs_storeInit(struct vcache *avc, struct storeOps **ops, void **rock)
208 struct rxfs_storeVariables *v;
210 v = (struct rxfs_storeVariables *) osi_AllocSmallSpace(sizeof(struct rxfs_storeVariables));
212 osi_Panic("rxfs_storeInit: osi_AllocSmallSpace returned NULL\n");
213 memset(v, 0, sizeof(struct rxfs_storeVariables));
215 v->InStatus.ClientModTime = avc->f.m.Date;
216 v->InStatus.Mask = AFS_SETMODTIME;
218 if (cacheDiskType == AFS_FCACHE_TYPE_UFS) {
219 v->tbuffer = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
222 ("rxfs_storeInit: osi_AllocLargeSpace for iovecs returned NULL\n");
223 *ops = (struct storeOps *) &rxfs_storeUfsOps;
225 v->tiov = osi_AllocSmallSpace(sizeof(struct iovec) * RX_MAXIOVECS);
228 ("rxfs_storeInit: osi_AllocSmallSpace for iovecs returned NULL\n");
229 *ops = (struct storeOps *) &rxfs_storeMemOps;
231 /* do this at a higher level now -- it's a parameter */
232 /* for now, only do 'continue from close' code if file fits in one
233 * chunk. Could clearly do better: if only one modified chunk
234 * then can still do this. can do this on *last* modified chunk */
235 tlen = avc->f.m.Length - 1; /* byte position of last byte we'll store */
237 if (AFS_CHUNK(tlen) != 0)
248 extern unsigned int storeallmissing;
252 * \param acall Ptr to the Rx call structure involved.
253 * \param dclist pointer to the list of dcaches
254 * \param avc Ptr to the vcache entry.
255 * \param bytes per chunk
256 * \param anewDV Ptr to the dataversion after store
257 * \param doProcessFS Ptr to the processFS flag
258 * \param OutStatus Ptr to the OutStatus structure
259 * \param nchunks number of chunks to store
260 * \param nomoreP pointer to the "nomore" flag
262 * \note Environment: Nothing interesting.
265 afs_CacheStoreProc(register struct rx_call *acall,
266 struct dcache **dclist,
271 struct AFSFetchStatus *OutStatus,
277 struct storeOps *ops;
281 int nomore = *nomoreP;
287 struct afs_stats_xferData *xferP; /* Ptr to this op's xfer struct */
288 osi_timeval_t xferStartTime, /*FS xfer start time */
289 xferStopTime; /*FS xfer stop time */
290 afs_size_t bytesToXfer = 10000; /* # bytes to xfer */
291 afs_size_t bytesXferred = 10000; /* # bytes actually xferred */
292 #endif /* AFS_NOSTATS */
295 code = rxfs_storeInit(avc, &ops, &rock);
297 osi_Panic("afs_CacheStoreProc: rxfs_storeInit failed");
299 ((struct rxfs_storeVariables *)rock)->call = acall;
301 for (i = 0; i < nchunks && !code; i++) {
304 alen = tdc->f.chunkBytes;
306 afs_warn("afs: missing dcache!\n");
308 continue; /* panic? */
310 afs_Trace4(afs_iclSetp, CM_TRACE_STOREALL2, ICL_TYPE_POINTER, avc,
311 ICL_TYPE_INT32, tdc->f.chunk, ICL_TYPE_INT32, tdc->index,
312 ICL_TYPE_INT32, afs_inode2trace(&tdc->f.inode));
315 if (avc->asynchrony == -1) {
316 if (afs_defaultAsynchrony > (bytes - stored))
317 shouldwake = &nomore;
319 else if ((afs_uint32) avc->asynchrony >= (bytes - stored))
320 shouldwake = &nomore;
322 fP = afs_CFileOpen(&tdc->f.inode);
324 afs_Trace4(afs_iclSetp, CM_TRACE_STOREPROC, ICL_TYPE_POINTER, avc,
325 ICL_TYPE_FID, &(avc->f.fid), ICL_TYPE_OFFSET,
326 ICL_HANDLE_OFFSET(avc->f.m.Length), ICL_TYPE_INT32, alen);
328 AFS_STATCNT(CacheStoreProc);
330 XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STOREDATA);
331 avc->f.truncPos = AFS_NOTRUNC;
334 * In this case, alen is *always* the amount of data we'll be trying
340 xferP = &(afs_stats_cmfullperf.rpc.
341 fsXferTimes[AFS_STATS_FS_XFERIDX_STOREDATA]);
342 osi_GetuTime(&xferStartTime);
343 #endif /* AFS_NOSTATS */
346 afs_int32 bytesread, byteswritten;
347 code = (*ops->prepare)(rock, alen, &tlen);
351 code = (*ops->read)(rock, fP, offset, tlen, &bytesread);
356 code = (*ops->write)(rock, tlen, &byteswritten);
360 bytesXferred += byteswritten;
361 #endif /* AFS_NOSTATS */
366 * if file has been locked on server, can allow
369 if (shouldwake && *shouldwake && ((*ops->status)(rock) == 0)) {
370 *shouldwake = 0; /* only do this once */
374 afs_Trace4(afs_iclSetp, CM_TRACE_STOREPROC, ICL_TYPE_POINTER, avc,
375 ICL_TYPE_FID, &(avc->f.fid), ICL_TYPE_OFFSET,
376 ICL_HANDLE_OFFSET(avc->f.m.Length), ICL_TYPE_INT32, alen);
379 osi_GetuTime(&xferStopTime);
382 (xferP->numSuccesses)++;
383 afs_stats_XferSumBytes[AFS_STATS_FS_XFERIDX_STOREDATA] +=
386 (afs_stats_XferSumBytes[AFS_STATS_FS_XFERIDX_STOREDATA] >> 10);
387 afs_stats_XferSumBytes[AFS_STATS_FS_XFERIDX_STOREDATA] &= 0x3FF;
388 if (bytesXferred < xferP->minBytes)
389 xferP->minBytes = bytesXferred;
390 if (bytesXferred > xferP->maxBytes)
391 xferP->maxBytes = bytesXferred;
394 * Tally the size of the object. Note: we tally the actual size,
395 * NOT the number of bytes that made it out over the wire.
397 if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET0)
399 else if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET1)
401 else if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET2)
403 else if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET3)
405 else if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET4)
407 else if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET5)
409 else if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET6)
411 else if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET7)
416 afs_stats_GetDiff(elapsedTime, xferStartTime, xferStopTime);
417 afs_stats_AddTo((xferP->sumTime), elapsedTime);
418 afs_stats_SquareAddTo((xferP->sqrTime), elapsedTime);
419 if (afs_stats_TimeLessThan(elapsedTime, (xferP->minTime))) {
420 afs_stats_TimeAssign((xferP->minTime), elapsedTime);
422 if (afs_stats_TimeGreaterThan(elapsedTime, (xferP->maxTime))) {
423 afs_stats_TimeAssign((xferP->maxTime), elapsedTime);
426 #endif /* AFS_NOSTATS */
429 if ((tdc->f.chunkBytes < afs_OtherCSize)
430 && (i < (nchunks - 1)) && code == 0) {
431 int bsent, tlen, sbytes =
432 afs_OtherCSize - tdc->f.chunkBytes;
434 osi_AllocLargeSpace(AFS_LRALLOCSIZ);
437 tlen = (sbytes > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : sbytes);
438 memset(tbuffer, 0, tlen);
440 bsent = rx_Write(((struct rxfs_storeVariables*)rock)->call,
445 code = -33; /* XXX */
450 osi_FreeLargeSpace(tbuffer);
452 stored += tdc->f.chunkBytes;
454 /* ideally, I'd like to unlock the dcache and turn
455 * off the writing bit here, but that would
456 * require being able to retry StoreAllSegments in
457 * the event of a failure. It only really matters
458 * if user can't read from a 'locked' dcache or
459 * one which has the writing bit turned on. */
462 code = (*ops->close)(rock, OutStatus, doProcessFS);
468 code = (*ops->destroy)(&rock, code);
474 /* rock and operations for RX_FILESERVER */
476 struct rxfs_fetchVariables {
477 struct rx_call *call;
481 afs_int32 hasNo64bit;
487 rxfs_fetchUfsRead(void *r, afs_uint32 size, afs_uint32 *bytesread)
491 struct rxfs_fetchVariables *v = (struct rxfs_fetchVariables *)r;
494 tlen = (size > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : size);
496 code = rx_Read(v->call, v->tbuffer, tlen);
505 rxfs_fetchMemRead(void *r, afs_uint32 tlen, afs_uint32 *bytesread)
508 struct rxfs_fetchVariables *v = (struct rxfs_fetchVariables *)r;
512 code = rx_Readv(v->call, v->iov, &v->nio, RX_MAXIOVECS, tlen);
522 rxfs_fetchMemWrite(void *r, struct osi_file *fP,
523 afs_uint32 offset, afs_uint32 tlen,
524 afs_uint32 *byteswritten)
527 struct rxfs_fetchVariables *v = (struct rxfs_fetchVariables *)r;
528 struct memCacheEntry *mceP = (struct memCacheEntry *)fP;
530 code = afs_MemWritevBlk(mceP, offset, v->iov, v->nio, tlen);
534 *byteswritten = code;
539 rxfs_fetchUfsWrite(void *r, struct osi_file *fP,
540 afs_uint32 offset, afs_uint32 tlen,
541 afs_uint32 *byteswritten)
544 struct rxfs_fetchVariables *v = (struct rxfs_fetchVariables *)r;
546 code = afs_osi_Write(fP, -1, v->tbuffer, tlen);
550 *byteswritten = code;
556 rxfs_fetchClose(void *r, struct vcache *avc, struct dcache * adc,
557 struct afs_FetchOutput *tsmall)
559 afs_int32 code, code1 = 0;
560 struct rxfs_fetchVariables *v = (struct rxfs_fetchVariables *)r;
566 code = EndRXAFS_FetchData(v->call, &tsmall->OutStatus,
573 code1 = rx_EndCall(v->call, code);
584 rxfs_fetchDestroy(void **r, afs_int32 error)
586 afs_int32 code = error;
587 struct rxfs_fetchVariables *v = (struct rxfs_fetchVariables *)*r;
591 osi_FreeLargeSpace(v->tbuffer);
593 osi_FreeSmallSpace(v->iov);
594 osi_FreeSmallSpace(v);
599 rxfs_fetchMore(void *r, afs_uint32 *length, afs_uint32 *moredata)
602 register struct rxfs_fetchVariables *v
603 = (struct rxfs_fetchVariables *)r;
606 code = rx_Read(v->call, (void *)length, sizeof(afs_int32));
607 *length = ntohl(*length);
609 if (code != sizeof(afs_int32)) {
610 code = rx_Error(v->call);
611 return (code ? code : -1); /* try to return code, not -1 */
617 struct fetchOps rxfs_fetchUfsOps = {
626 struct fetchOps rxfs_fetchMemOps = {
635 rxfs_fetchInit(register struct afs_conn *tc, struct vcache *avc,afs_offs_t base,
636 afs_uint32 size, afs_uint32 *out_length, struct dcache *adc,
637 struct osi_file *fP, struct fetchOps **ops, void **rock)
639 struct rxfs_fetchVariables *v;
641 afs_int32 length_hi, length, bytes;
642 #ifdef AFS_64BIT_CLIENT
644 afs_size_t lengthFound; /* as returned from server */
645 #endif /* AFS_64BIT_CLIENT */
647 v = (struct rxfs_fetchVariables *) osi_AllocSmallSpace(sizeof(struct rxfs_fetchVariables));
649 osi_Panic("rxfs_fetchInit: osi_AllocSmallSpace returned NULL\n");
650 memset(v, 0, sizeof(struct rxfs_fetchVariables));
653 v->call = rx_NewCall(tc->id);
656 #ifdef AFS_64BIT_CLIENT
657 length_hi = code = 0;
658 if (!afs_serverHasNo64Bit(tc)) {
661 code = StartRXAFS_FetchData64(v->call, (struct AFSFid *)&avc->f.fid.Fid,
665 afs_Trace2(afs_iclSetp, CM_TRACE_FETCH64CODE,
666 ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, code);
668 bytes = rx_Read(v->call, (char *)&length_hi, sizeof(afs_int32));
670 if (bytes == sizeof(afs_int32)) {
671 length_hi = ntohl(length_hi);
674 code = rx_Error(v->call);
676 code1 = rx_EndCall(v->call, code);
682 if (code == RXGEN_OPCODE || afs_serverHasNo64Bit(tc)) {
683 if (base > 0x7FFFFFFF) {
690 v->call = rx_NewCall(tc->id);
692 StartRXAFS_FetchData(v->call, (struct AFSFid *)
693 &avc->f.fid.Fid, pos,
697 afs_serverSetNo64Bit(tc);
701 bytes = rx_Read(v->call, (char *)&length, sizeof(afs_int32));
703 if (bytes == sizeof(afs_int32))
704 length = ntohl(length);
706 code = rx_Error(v->call);
709 FillInt64(lengthFound, length_hi, length);
710 afs_Trace3(afs_iclSetp, CM_TRACE_FETCH64LENG,
711 ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, code,
713 ICL_HANDLE_OFFSET(lengthFound));
714 #else /* AFS_64BIT_CLIENT */
716 code = StartRXAFS_FetchData(v->call, (struct AFSFid *)&avc->f.fid.Fid,
721 bytes = rx_Read(v->call, (char *)&length, sizeof(afs_int32));
723 if (bytes == sizeof(afs_int32))
724 length = ntohl(length);
726 code = rx_Error(v->call);
728 #endif /* AFS_64BIT_CLIENT */
730 osi_FreeSmallSpace(v);
734 if ( cacheDiskType == AFS_FCACHE_TYPE_UFS ) {
735 v->tbuffer = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
737 osi_Panic("rxfs_fetchInit: osi_AllocLargeSpace for iovecs returned NULL\n");
738 osi_Assert(WriteLocked(&adc->lock));
740 *ops = (struct fetchOps *) &rxfs_fetchUfsOps;
743 afs_Trace4(afs_iclSetp, CM_TRACE_MEMFETCH, ICL_TYPE_POINTER, avc,
744 ICL_TYPE_POINTER, fP, ICL_TYPE_OFFSET,
745 ICL_HANDLE_OFFSET(base), ICL_TYPE_INT32, length);
747 * We need to alloc the iovecs on the heap so that they are "pinned"
748 * rather than declare them on the stack - defect 11272
750 v->iov = (struct iovec *)osi_AllocSmallSpace(sizeof(struct iovec) *
753 osi_Panic("afs_CacheFetchProc: osi_AllocSmallSpace for iovecs returned NULL\n");
754 *ops = (struct fetchOps *) &rxfs_fetchMemOps;
757 *out_length = length;
763 * Routine called on fetch; also tells people waiting for data
764 * that more has arrived.
766 * \param tc Ptr to the Rx connection structure.
767 * \param fP File descriptor for the cache file.
768 * \param abase Base offset to fetch.
769 * \param adc Ptr to the dcache entry for the file, write-locked.
770 * \param avc Ptr to the vcache entry for the file.
771 * \param size Amount of data that should be fetched.
772 * \param tsmall Ptr to the afs_FetchOutput structure.
774 * \note Environment: Nothing interesting.
777 afs_CacheFetchProc(register struct afs_conn *tc,
778 register struct osi_file *fP, afs_size_t abase,
779 struct dcache *adc, struct vcache *avc,
781 struct afs_FetchOutput *tsmall)
783 register afs_int32 code;
785 afs_uint32 bytesread, byteswritten;
786 struct fetchOps *ops = NULL;
789 register int offset = 0;
793 struct afs_stats_xferData *xferP; /* Ptr to this op's xfer struct */
794 osi_timeval_t xferStartTime, /*FS xfer start time */
795 xferStopTime; /*FS xfer stop time */
796 afs_size_t bytesToXfer = 0, bytesXferred = 0;
799 AFS_STATCNT(CacheFetchProc);
801 XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHDATA);
803 code = rxfs_fetchInit(tc, avc, abase, size, &length, adc, fP, &ops, &rock);
807 &(afs_stats_cmfullperf.rpc.fsXferTimes[AFS_STATS_FS_XFERIDX_FETCHDATA]);
808 osi_GetuTime(&xferStartTime);
809 #endif /* AFS_NOSTATS */
811 adc->validPos = abase;
815 code = (*ops->more)(rock, &length, &moredata);
820 * The fetch protocol is extended for the AFS/DFS translator
821 * to allow multiple blocks of data, each with its own length,
822 * to be returned. As long as the top bit is set, there are more
825 * We do not do this for AFS file servers because they sometimes
826 * return large negative numbers as the transfer size.
828 if (avc->f.states & CForeign) {
829 moredata = length & 0x80000000;
830 length &= ~0x80000000;
835 bytesToXfer += length;
836 #endif /* AFS_NOSTATS */
838 #ifdef RX_KERNEL_TRACE
839 afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP, ICL_TYPE_STRING,
842 code = (*ops->read)(rock, length, &bytesread);
843 #ifdef RX_KERNEL_TRACE
844 afs_Trace1(afs_iclSetp, CM_TRACE_TIMESTAMP, ICL_TYPE_STRING,
848 bytesXferred += bytesread;
849 #endif /* AFS_NOSTATS */
851 afs_Trace3(afs_iclSetp, CM_TRACE_FETCH64READ,
852 ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, code,
853 ICL_TYPE_INT32, length);
857 code = (*ops->write)(rock, fP, offset, bytesread, &byteswritten);
863 adc->validPos = abase;
864 if (afs_osi_Wakeup(&adc->validPos) == 0)
865 afs_Trace4(afs_iclSetp, CM_TRACE_DCACHEWAKE, ICL_TYPE_STRING,
866 __FILE__, ICL_TYPE_INT32, __LINE__,
867 ICL_TYPE_POINTER, adc, ICL_TYPE_INT32,
873 code = (*ops->close)(rock, avc, adc, tsmall);
874 (*ops->destroy)(&rock, code);
877 osi_GetuTime(&xferStopTime);
880 (xferP->numSuccesses)++;
881 afs_stats_XferSumBytes[AFS_STATS_FS_XFERIDX_FETCHDATA] += bytesXferred;
883 (afs_stats_XferSumBytes[AFS_STATS_FS_XFERIDX_FETCHDATA] >> 10);
884 afs_stats_XferSumBytes[AFS_STATS_FS_XFERIDX_FETCHDATA] &= 0x3FF;
885 if (bytesXferred < xferP->minBytes)
886 xferP->minBytes = bytesXferred;
887 if (bytesXferred > xferP->maxBytes)
888 xferP->maxBytes = bytesXferred;
891 * Tally the size of the object. Note: we tally the actual size,
892 * NOT the number of bytes that made it out over the wire.
894 if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET0)
896 else if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET1)
898 else if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET2)
900 else if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET3)
902 else if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET4)
904 else if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET5)
906 else if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET6)
908 else if (bytesToXfer <= AFS_STATS_MAXBYTES_BUCKET7)
913 afs_stats_GetDiff(elapsedTime, xferStartTime, xferStopTime);
914 afs_stats_AddTo((xferP->sumTime), elapsedTime);
915 afs_stats_SquareAddTo((xferP->sqrTime), elapsedTime);
916 if (afs_stats_TimeLessThan(elapsedTime, (xferP->minTime))) {
917 afs_stats_TimeAssign((xferP->minTime), elapsedTime);
919 if (afs_stats_TimeGreaterThan(elapsedTime, (xferP->maxTime))) {
920 afs_stats_TimeAssign((xferP->maxTime), elapsedTime);