extern int VInit;
while (1) {
+ int restarting =
+#ifdef AFS_DEMAND_ATTACH_FS
+ VSALVAGE
+#else
+ VRESTARTING
+#endif
+ ;
+
errorCode = 0;
*volptr = VGetVolume(&local_errorCode, &errorCode, (afs_int32) fid->Volume);
if (!errorCode) {
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++;
FS_UNLOCK;
}
- return (busyonrst ? VBUSY : VRESTARTING);
+ 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;
afs_perfstats.fs_nBusies++;
FS_UNLOCK;
}
- return (busyonrst ? VBUSY : VRESTARTING);
+ return (busyonrst ? VBUSY : restarting);
} else {
- return (VRESTARTING);
+ return (restarting);
}
}
}
* must check local_errorCode because demand attach fs
* can have local_errorCode == VSALVAGING, errorCode == VBUSY */
else if (local_errorCode == VBUSY && lock == READ_LOCK) {
+#ifdef AFS_DEMAND_ATTACH_FS
+ /* DAFS case is complicated by the fact that local_errorCode can
+ * be VBUSY in cases where the volume is truly offline */
+ if (!*volptr) {
+ /* volume is in VOL_STATE_UNATTACHED */
+ return (errorCode);
+ }
+#endif /* AFS_DEMAND_ATTACH_FS */
errorCode = 0;
break;
} else if (errorCode)
if (IsEmpty(&childdir) != 0)
return (EEXIST);
DZap(&childdir);
+ FidZap(&childdir);
(*targetptr)->delete = 1;
} else if ((--(*targetptr)->disk.linkCount) == 0)
(*targetptr)->delete = 1;
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);
}
!(rights & PRSFS_WRITE) &&
!(OWNSp(client, targetptr) && (rights & PRSFS_INSERT)) )
return(EACCES);
- return(EACCES);
if (targetptr->disk.lock.lockCount >= 0) {
++(targetptr->disk.lock.lockCount);
status->MinQuota = V_minquota(volptr);
status->MaxQuota = V_maxquota(volptr);
status->BlocksInUse = V_diskused(volptr);
- status->PartBlocksAvail = volptr->partition->free;
- status->PartMaxBlocks = volptr->partition->totalUsable;
+ status->PartBlocksAvail = RoundInt64ToInt32(volptr->partition->free);
+ status->PartMaxBlocks = RoundInt64ToInt32(volptr->partition->totalUsable);
/* now allocate and copy these things; they're freed by the RXGEN stub */
temp = strlen(V_name(volptr)) + 1;
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 */
void
SetVolumeStats(struct AFSStatistics *stats)
{
- struct DiskPartition *part;
+ struct DiskPartition64 *part;
int i = 0;
for (part = DiskPartitionList; part && i < AFS_MSTATDISKS;
part = part->next) {
- stats->Disks[i].TotalBlocks = part->totalUsable;
- stats->Disks[i].BlocksAvailable = part->free;
+ stats->Disks[i].TotalBlocks = RoundInt64ToInt32(part->totalUsable);
+ stats->Disks[i].BlocksAvailable = RoundInt64ToInt32(part->free);
memset(stats->Disks[i].Name, 0, AFS_DISKNAMESIZE);
strncpy(stats->Disks[i].Name, part->name, AFS_DISKNAMESIZE);
i++;
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_stats_GetDiff(elapsedTime, opStartTime, opStopTime);
+ fs_stats_AddTo((opP->sumTime), elapsedTime);
+ fs_stats_SquareAddTo((opP->sqrTime), elapsedTime);
+ if (fs_stats_TimeLessThan(elapsedTime, (opP->minTime))) {
+ fs_stats_TimeAssign((opP->minTime), elapsedTime);
+ }
+ if (fs_stats_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
+ fs_stats_TimeAssign((opP->maxTime), elapsedTime);
+ }
+ FS_UNLOCK;
+ }
+#endif /* FS_STATS_DETAILED */
+
+ osi_auditU(acall, GetStatisticsEvent, code,
+ AUD_ID, t_client ? t_client->ViceId : 0, AUD_END);
+ return code;
+} /*SRXAFS_GetStatistics */
+
+
+afs_int32
+SRXAFS_GetStatistics64(struct rx_call *acall, afs_int32 statsVersion, ViceStatistics64 *Statistics)
+{
+ extern afs_int32 StartTime, CurrentConnections;
+ int seconds;
+ afs_int32 code;
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
+ struct host *thost;
+ struct client *t_client = NULL; /* tmp ptr to client data */
+ struct timeval time;
+#if FS_STATS_DETAILED
+ struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
+ struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
+ struct timeval elapsedTime; /* Transfer time */
+
+ /*
+ * Set our stats pointer, remember when the RPC operation started, and
+ * tally the operation.
+ */
+ opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_GETSTATISTICS]);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ FT_GetTimeOfDay(&opStartTime, 0);
+#endif /* FS_STATS_DETAILED */
+
+ if ((code = CallPreamble(acall, NOTACTIVECALL, &tcon, &thost)))
+ goto Bad_GetStatistics64;
+
+ ViceLog(1, ("SAFS_GetStatistics64 Received\n"));
+ Statistics->ViceStatistics64_val =
+ malloc(statsVersion*sizeof(afs_int64));
+ Statistics->ViceStatistics64_len = statsVersion;
+ FS_LOCK;
+ AFSCallStats.GetStatistics++, AFSCallStats.TotalCalls++;
+ Statistics->ViceStatistics64_val[STATS64_STARTTIME] = StartTime;
+ Statistics->ViceStatistics64_val[STATS64_CURRENTCONNECTIONS] =
+ CurrentConnections;
+ Statistics->ViceStatistics64_val[STATS64_TOTALVICECALLS] =
+ AFSCallStats.TotalCalls;
+ Statistics->ViceStatistics64_val[STATS64_TOTALFETCHES] =
+ AFSCallStats.FetchData + AFSCallStats.FetchACL +
+ AFSCallStats.FetchStatus;
+ Statistics->ViceStatistics64_val[STATS64_FETCHDATAS] =
+ AFSCallStats.FetchData;
+ Statistics->ViceStatistics64_val[STATS64_FETCHEDBYTES] =
+ AFSCallStats.TotalFetchedBytes;
+ seconds = AFSCallStats.AccumFetchTime / 1000;
+ if (seconds <= 0)
+ seconds = 1;
+ Statistics->ViceStatistics64_val[STATS64_FETCHDATARATE] =
+ AFSCallStats.TotalFetchedBytes / seconds;
+ Statistics->ViceStatistics64_val[STATS64_TOTALSTORES] =
+ AFSCallStats.StoreData + AFSCallStats.StoreACL +
+ AFSCallStats.StoreStatus;
+ Statistics->ViceStatistics64_val[STATS64_STOREDATAS] =
+ AFSCallStats.StoreData;
+ Statistics->ViceStatistics64_val[STATS64_STOREDBYTES] =
+ AFSCallStats.TotalStoredBytes;
+ seconds = AFSCallStats.AccumStoreTime / 1000;
+ if (seconds <= 0)
+ seconds = 1;
+ Statistics->ViceStatistics64_val[STATS64_STOREDATARATE] =
+ AFSCallStats.TotalStoredBytes / seconds;
+#ifdef AFS_NT40_ENV
+ Statistics->ViceStatistics64_val[STATS64_PROCESSSIZE] = -1;
+#else
+ Statistics->ViceStatistics64_val[STATS64_PROCESSSIZE] =
+ (afs_int32) ((long)sbrk(0) >> 10);
+#endif
+ FS_UNLOCK;
+ h_GetWorkStats((int *)&(Statistics->ViceStatistics64_val[STATS64_WORKSTATIONS]),
+ (int *)&(Statistics->ViceStatistics64_val[STATS64_ACTIVEWORKSTATIONS]),
+ (int *)0,
+ (afs_int32) (FT_ApproxTime()) - (15 * 60));
+
+
+
+ /* this works on all system types */
+ FT_GetTimeOfDay(&time, 0);
+ Statistics->ViceStatistics64_val[STATS64_CURRENTTIME] = time.tv_sec;
+
+ Bad_GetStatistics64:
+ code = CallPostamble(tcon, code, thost);
+
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
+#if FS_STATS_DETAILED
+ 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);