if (restartedat.tv_sec == 0) {
/* I'm not really worried about when we restarted, I'm */
/* just worried about when the first VBUSY was returned. */
- TM_GetTimeOfDay(&restartedat, 0);
+ FT_GetTimeOfDay(&restartedat, 0);
if (busyonrst) {
FS_LOCK;
afs_perfstats.fs_nBusies++;
return (busyonrst ? VBUSY : restarting);
} else {
struct timeval now;
- TM_GetTimeOfDay(&now, 0);
+ FT_GetTimeOfDay(&now, 0);
if ((now.tv_sec - restartedat.tv_sec) < (11 * 60)) {
if (busyonrst) {
FS_LOCK;
AdjustDiskUsage(volptr, BlocksPreallocatedForVnode,
BlocksPreallocatedForVnode))) {
ViceLog(25,
- ("Insufficient space to allocate %lld blocks\n",
+ ("Insufficient space to allocate %" AFS_INT64_FMT " blocks\n",
(afs_intmax_t) BlocksPreallocatedForVnode));
return (errorCode);
}
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
ViceLog(1,
/*
* Remember when the data transfer started.
*/
- TM_GetTimeOfDay(&xferStartTime, 0);
+ FT_GetTimeOfDay(&xferStartTime, 0);
#endif /* FS_STATS_DETAILED */
/* actually do the data transfer */
* integrate the transfer size and elapsed time into the stats. If the
* operation failed, we jump to the appropriate point.
*/
- TM_GetTimeOfDay(&xferStopTime, 0);
+ FT_GetTimeOfDay(&xferStopTime, 0);
FS_LOCK;
(xferP->numXfers)++;
if (!errorCode) {
errorCode = CallPostamble(tcon, errorCode, thost);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
ViceLog(1,
errorCode = CallPostamble(tcon, errorCode, thost);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
ViceLog(1, ("SAFS_BulkStatus\n"));
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
ViceLog(1, ("SAFS_InlineBulkStatus\n"));
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
ViceLog(1,
("StoreData: Fid = %u.%u.%u\n", Fid->Volume, Fid->Vnode,
Fid->Unique));
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
FS_LOCK;
/*
* Remember when the data transfer started.
*/
- TM_GetTimeOfDay(&xferStartTime, 0);
+ FT_GetTimeOfDay(&xferStartTime, 0);
#endif /* FS_STATS_DETAILED */
/* Do the actual storing of the data */
* integrate the transfer size and elapsed time into the stats. If the
* operation failed, we jump to the appropriate point.
*/
- TM_GetTimeOfDay(&xferStopTime, 0);
+ FT_GetTimeOfDay(&xferStopTime, 0);
FS_LOCK;
(xferP->numXfers)++;
if (!errorCode) {
errorCode = CallPostamble(tcon, errorCode, thost);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_StoreACL;
errorCode = CallPostamble(tcon, errorCode, thost);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
memset(OutFid, 0, sizeof(struct AFSFid));
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_MakeDir;
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
struct timeval time;
/* this works on all system types */
- TM_GetTimeOfDay(&time, 0);
+ FT_GetTimeOfDay(&time, 0);
stats->CurrentTime = time.tv_sec;
} /*SetSystemStats */
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, NOTACTIVECALL, &tcon, &thost)))
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, NOTACTIVECALL, &tcon, &thost)))
/* this works on all system types */
- TM_GetTimeOfDay(&time, 0);
+ FT_GetTimeOfDay(&time, 0);
Statistics->ViceStatistics64_val[STATS64_CURRENTTIME] = time.tv_sec;
Bad_GetStatistics64:
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
*a_versionP = AFS_XSTAT_VERSION;
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
fs_stats_GetDiff(elapsedTime, opStartTime, opStopTime);
fs_stats_AddTo((opP->sumTime), elapsedTime);
fs_stats_SquareAddTo((opP->sqrTime), elapsedTime);
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
/*
} /*Switch on collection number */
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if (FidArray)
errorCode = CallPostamble(tcon, errorCode, thost);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_GetVolumeInfo;
code = CallPostamble(tcon, code, thost);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
ViceLog(1, ("SAFS_GetVolumeStatus for volume %u\n", avolid));
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
ViceLog(1, ("SAFS_SetVolumeStatus for volume %u\n", avolid));
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
return FSERR_EOPNOTSUPP;
errorCode = CallPostamble(tcon, errorCode, thost);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
code = CallPostamble(tcon, code, thost);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
FS_LOCK;
(opP->numSuccesses)++;
FS_LOCK;
(opP->numOps)++;
FS_UNLOCK;
- TM_GetTimeOfDay(&opStartTime, 0);
+ FT_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, NOTACTIVECALL, &tcon, &thost)))
FS_LOCK;
AFSCallStats.GetTime++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
- TM_GetTimeOfDay(&tpl, 0);
+ FT_GetTimeOfDay(&tpl, 0);
*Seconds = tpl.tv_sec;
*USeconds = tpl.tv_usec;
code = CallPostamble(tcon, code, thost);
#if FS_STATS_DETAILED
- TM_GetTimeOfDay(&opStopTime, 0);
+ FT_GetTimeOfDay(&opStopTime, 0);
fs_stats_GetDiff(elapsedTime, opStartTime, opStopTime);
if (code == 0) {
FS_LOCK;
rx_Write(Call, (char *)&zero, sizeof(afs_int32)); /* send 0-length */
return (0);
}
- TM_GetTimeOfDay(&StartTime, 0);
+ FT_GetTimeOfDay(&StartTime, 0);
ihP = targetptr->handle;
fdP = IH_OPEN(ihP);
if (fdP == NULL) {
FreeSendBuffer((struct afs_buffer *)tbuffer);
#endif /* AFS_NT40_ENV */
FDH_CLOSE(fdP);
- TM_GetTimeOfDay(&StopTime, 0);
+ FT_GetTimeOfDay(&StopTime, 0);
/* Adjust all Fetch Data related stats */
FS_LOCK;
afs_sfsize_t tlen; /* temp for xfr length */
Inode tinode; /* inode for I/O */
afs_int32 optSize; /* optimal transfer size */
- afs_sfsize_t DataLength; /* size of inode */
+ afs_sfsize_t DataLength = 0; /* size of inode */
afs_sfsize_t TruncatedLength; /* size after ftruncate */
afs_fsize_t NewLength; /* size after this store completes */
afs_sfsize_t adjustSize; /* bytes to call VAdjust... with */
- int linkCount; /* link count on inode */
+ int linkCount = 0; /* link count on inode */
FdHandle_t *fdP;
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
/* this bit means that the locks are set and protections are OK */
rx_SetLocalStatus(Call, 1);
- TM_GetTimeOfDay(&StartTime, 0);
+ FT_GetTimeOfDay(&StartTime, 0);
optSize = sendBufSize;
ViceLog(25,
}
FDH_CLOSE(fdP);
- TM_GetTimeOfDay(&StopTime, 0);
+ FT_GetTimeOfDay(&StopTime, 0);
VN_SET_LEN(targetptr, NewLength);