{
register afs_int32 temp;
- FS_LOCK if (PctSpare) {
+ FS_LOCK;
+ if (PctSpare) {
temp = V_maxquota(avolp);
if (temp == 0) {
/* no matter; doesn't check in this case */
- FS_UNLOCK return 0;
+ FS_UNLOCK;
+ return 0;
}
temp = (temp * PctSpare) / 100;
- FS_UNLOCK return temp;
+ FS_UNLOCK;
+ return temp;
} else {
- FS_UNLOCK return BlocksSpare;
+ FS_UNLOCK;
+ return BlocksSpare;
}
} /*SpareComp */
static void
SetVolumeSync(register struct AFSVolSync *async, register Volume * avol)
{
- FS_LOCK
- /* date volume instance was created */
- if (async) {
+ FS_LOCK;
+ /* date volume instance was created */
+ if (async) {
if (avol)
async->spare1 = avol->header->diskstuff.creationDate;
else
async->spare5 = 0;
async->spare6 = 0;
}
-FS_UNLOCK} /*SetVolumeSync */
+ FS_UNLOCK;
+} /*SetVolumeSync */
/*
* Note that this function always returns a held host, so
}
*tconn = rx_ConnectionOf(acall);
- H_LOCK retry:tclient = h_FindClient_r(*tconn);
+ H_LOCK;
+ retry:
+ tclient = h_FindClient_r(*tconn);
if (tclient->prfail == 1) { /* couldn't get the CPS */
if (!retry_flag) {
h_ReleaseClient_r(tclient);
ViceLog(0, ("CallPreamble: Couldn't get CPS. Fail\n"));
- H_UNLOCK return -1001;
+ H_UNLOCK;
+ return -1001;
}
retry_flag = 0; /* Retry once */
/* Take down the old connection and re-read the key file */
ViceLog(0,
("CallPreamble: Couldn't get CPS. Reconnect to ptserver\n"));
- H_UNLOCK code = pr_Initialize(2, AFSDIR_SERVER_ETC_DIRPATH, 0);
- H_LOCK if (code) {
+ H_UNLOCK;
+ code = pr_Initialize(2, AFSDIR_SERVER_ETC_DIRPATH, 0);
+ H_LOCK;
+ if (code) {
h_ReleaseClient_r(tclient);
- H_UNLOCK ViceLog(0,
- ("CallPreamble: couldn't reconnect to ptserver\n"));
+ H_UNLOCK;
+ ViceLog(0, ("CallPreamble: couldn't reconnect to ptserver\n"));
return -1001;
}
h_ReleaseClient_r(tclient);
h_Unlock_r(thost);
- H_UNLOCK return code;
+ H_UNLOCK;
+ return code;
} /*CallPreamble */
struct client *tclient;
int translate = 0;
- H_LOCK tclient = h_FindClient_r(aconn);
+ H_LOCK;
+ tclient = h_FindClient_r(aconn);
thost = tclient->host;
if (thost->hostFlags & HERRORTRANS)
translate = 1;
h_ReleaseClient_r(tclient);
h_Release_r(thost);
- H_UNLOCK return (translate ? sys_error_to_et(ret) : ret);
+ H_UNLOCK;
+ return (translate ? sys_error_to_et(ret) : ret);
} /*CallPostamble */
/*
acl_CheckRights(ACL, &client->CPS, rights);
/* wait if somebody else is already doing the getCPS call */
- H_LOCK while (client->host->hostFlags & HCPS_INPROGRESS) {
+ H_LOCK;
+ while (client->host->hostFlags & HCPS_INPROGRESS) {
client->host->hostFlags |= HCPS_WAITING; /* I am waiting */
#ifdef AFS_PTHREAD_ENV
pthread_cond_wait(&client->host->cond, &host_glock_mutex);
client->host->hcps.prlist_len, client->host->host));
} else
acl_CheckRights(ACL, &client->host->hcps, &hrights);
- H_UNLOCK
- /* Allow system:admin the rights given with the -implicit option */
- if (acl_IsAMember(SystemId, &client->CPS))
+ H_UNLOCK;
+ /* Allow system:admin the rights given with the -implicit option */
+ if (acl_IsAMember(SystemId, &client->CPS))
*rights |= implicitAdminRights;
*rights |= hrights;
*anyrights |= hrights;
static
FreeSendBuffer(register struct afs_buffer *adata)
{
- FS_LOCK afs_buffersAlloced--;
+ FS_LOCK;
+ afs_buffersAlloced--;
adata->next = freeBufferList;
freeBufferList = adata;
- FS_UNLOCK return 0;
+ FS_UNLOCK;
+ return 0;
} /*FreeSendBuffer */
{
register struct afs_buffer *tp;
- FS_LOCK afs_buffersAlloced++;
+ FS_LOCK;
+ afs_buffersAlloced++;
if (!freeBufferList) {
char *tmp;
- FS_UNLOCK tmp = malloc(sendBufSize);
+ FS_UNLOCK;
+ tmp = malloc(sendBufSize);
if (!tmp) {
ViceLog(0, ("Failed malloc in AllocSendBuffer\n"));
assert(0);
}
tp = freeBufferList;
freeBufferList = tp->next;
- FS_UNLOCK return (char *)tp;
+ FS_UNLOCK;
+ return (char *)tp;
} /*AllocSendBuffer */
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_FETCHDATA]);
xferP = &(afs_FullPerfStats.det.xferOpTimes[FS_STATS_XFERIDX_FETCHDATA]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
ViceLog(1,
("SRXAFS_FetchData, Fid = %u.%u.%u\n", Fid->Volume, Fid->Vnode,
Fid->Unique));
- FS_LOCK AFSCallStats.FetchData++, AFSCallStats.TotalCalls++;
- FS_UNLOCK if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
+ FS_LOCK;
+ AFSCallStats.FetchData++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
goto Bad_FetchData;
/* Get ptr to client data for user Id for logging */
/*
* Remember that another read operation was performed.
*/
- FS_LOCK if (client->InSameNetwork)
- readIdx = VOL_STATS_SAME_NET;
+ FS_LOCK;
+ if (client->InSameNetwork)
+ readIdx = VOL_STATS_SAME_NET;
else
readIdx = VOL_STATS_DIFF_NET;
V_stat_reads(volptr, readIdx)++;
if (client->ViceId != AnonymousID) {
V_stat_reads(volptr, readIdx + 1)++;
}
- FS_UNLOCK
+ FS_UNLOCK;
#endif /* FS_STATS_DETAILED */
- /* Check whether the caller has permission access to fetch the data */
- if ((errorCode =
- Check_PermissionRights(targetptr, client, rights, CHK_FETCHDATA,
- 0)))
+ /* Check whether the caller has permission access to fetch the data */
+ if ((errorCode =
+ Check_PermissionRights(targetptr, client, rights, CHK_FETCHDATA, 0)))
goto Bad_FetchData;
/*
* operation failed, we jump to the appropriate point.
*/
TM_GetTimeOfDay(&xferStopTime, 0);
- FS_LOCK(xferP->numXfers)++;
+ FS_LOCK;
+ (xferP->numXfers)++;
if (!errorCode) {
(xferP->numSuccesses)++;
fs_stats_TimeAssign((xferP->maxTime), elapsedTime);
}
}
- FS_UNLOCK
- /*
- * Finally, go off to tell our caller the bad news in case the
- * fetch failed.
- */
- if (errorCode)
+ FS_UNLOCK;
+ /*
+ * Finally, go off to tell our caller the bad news in case the
+ * fetch failed.
+ */
+ if (errorCode)
goto Bad_FetchData;
#endif /* FS_STATS_DETAILED */
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, FetchDataEvent, errorCode, AUD_FID, Fid, AUD_END);
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_FETCHACL]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
ViceLog(1,
("SAFS_FetchACL, Fid = %u.%u.%u\n", Fid->Volume, Fid->Vnode,
Fid->Unique));
- FS_LOCK AFSCallStats.FetchACL++, AFSCallStats.TotalCalls++;
- FS_UNLOCK if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
+ FS_LOCK;
+ AFSCallStats.FetchACL++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
goto Bad_FetchACL;
/* Get ptr to client data for user Id for logging */
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, FetchACLEvent, errorCode, AUD_FID, Fid, AUD_END);
("SAFS_FetchStatus, Fid = %u.%u.%u, Host %s, Id %d\n",
Fid->Volume, Fid->Vnode, Fid->Unique, inet_ntoa(logHostAddr),
t_client->ViceId));
- FS_LOCK AFSCallStats.FetchStatus++, AFSCallStats.TotalCalls++;
- FS_UNLOCK
- /*
- * Get volume/vnode for the fetched file; caller's rights to it are
- * also returned
- */
- if ((errorCode =
- GetVolumePackage(tcon, Fid, &volptr, &targetptr, DONTCHECK,
- &parentwhentargetnotdir, &client, READ_LOCK,
- &rights, &anyrights)))
+ FS_LOCK;
+ AFSCallStats.FetchStatus++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ /*
+ * Get volume/vnode for the fetched file; caller's rights to it are
+ * also returned
+ */
+ if ((errorCode =
+ GetVolumePackage(tcon, Fid, &volptr, &targetptr, DONTCHECK,
+ &parentwhentargetnotdir, &client, READ_LOCK,
+ &rights, &anyrights)))
goto Bad_FetchStatus;
/* set volume synchronization information */
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_BULKSTATUS]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
ViceLog(1, ("SAFS_BulkStatus\n"));
- FS_LOCK AFSCallStats.TotalCalls++;
- FS_UNLOCK nfiles = Fids->AFSCBFids_len; /* # of files in here */
+ FS_LOCK;
+ AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ nfiles = Fids->AFSCBFids_len; /* # of files in here */
if (nfiles <= 0) { /* Sanity check */
errorCode = EINVAL;
goto Audit_and_Return;
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
Audit_and_Return:
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_BULKSTATUS]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
ViceLog(1, ("SAFS_InlineBulkStatus\n"));
- FS_LOCK AFSCallStats.TotalCalls++;
- FS_UNLOCK nfiles = Fids->AFSCBFids_len; /* # of files in here */
+ FS_LOCK;
+ AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ nfiles = Fids->AFSCBFids_len; /* # of files in here */
if (nfiles <= 0) { /* Sanity check */
errorCode = EINVAL;
goto Audit_and_Return;
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
Audit_and_Return:
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_FETCHSTATUS]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, FetchStatusEvent, code, AUD_FID, Fid, AUD_END);
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_STOREDATA]);
xferP = &(afs_FullPerfStats.det.xferOpTimes[FS_STATS_XFERIDX_STOREDATA]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK ViceLog(1,
- ("StoreData: Fid = %u.%u.%u\n", Fid->Volume, Fid->Vnode,
- Fid->Unique));
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ ViceLog(1,
+ ("StoreData: Fid = %u.%u.%u\n", Fid->Volume, Fid->Vnode,
+ Fid->Unique));
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- FS_LOCK AFSCallStats.StoreData++, AFSCallStats.TotalCalls++;
- FS_UNLOCK if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
+ FS_LOCK;
+ AFSCallStats.StoreData++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
goto Bad_StoreData;
/* Get ptr to client data for user Id for logging */
assert(!fileCode || (fileCode == VSALVAGE));
parentwhentargetnotdir = NULL;
}
-
#if FS_STATS_DETAILED
/*
* Remember when the data transfer started.
* operation failed, we jump to the appropriate point.
*/
TM_GetTimeOfDay(&xferStopTime, 0);
- FS_LOCK(xferP->numXfers)++;
+ FS_LOCK;
+ (xferP->numXfers)++;
if (!errorCode) {
(xferP->numSuccesses)++;
fs_stats_TimeAssign((xferP->maxTime), elapsedTime);
}
}
- FS_UNLOCK
- /*
- * Finally, go off to tell our caller the bad news in case the
- * store failed.
- */
- if (errorCode && (!targetptr->changed_newTime))
+ FS_UNLOCK;
+ /*
+ * Finally, go off to tell our caller the bad news in case the
+ * store failed.
+ */
+ if (errorCode && (!targetptr->changed_newTime))
goto Bad_StoreData;
#endif /* FS_STATS_DETAILED */
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, StoreDataEvent, errorCode, AUD_FID, Fid, AUD_END);
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_STOREACL]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
goto Bad_StoreACL;
("SAFS_StoreACL, Fid = %u.%u.%u, ACL=%s, Host %s, Id %d\n",
Fid->Volume, Fid->Vnode, Fid->Unique, AccessList->AFSOpaque_val,
inet_ntoa(logHostAddr), t_client->ViceId));
- FS_LOCK AFSCallStats.StoreACL++, AFSCallStats.TotalCalls++;
- FS_UNLOCK InStatus.Mask = 0; /* not storing any status */
+ FS_LOCK;
+ AFSCallStats.StoreACL++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ InStatus.Mask = 0; /* not storing any status */
/*
* Get associated volume/vnode for the target dir; caller's rights
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, StoreACLEvent, errorCode, AUD_FID, Fid, AUD_END);
("SAFS_StoreStatus, Fid = %u.%u.%u, Host %s, Id %d\n",
Fid->Volume, Fid->Vnode, Fid->Unique, inet_ntoa(logHostAddr),
t_client->ViceId));
- FS_LOCK AFSCallStats.StoreStatus++, AFSCallStats.TotalCalls++;
- FS_UNLOCK
- /*
- * Get volume/vnode for the target file; caller's rights to it are
- * also returned
- */
- if ((errorCode =
- GetVolumePackage(tcon, Fid, &volptr, &targetptr, DONTCHECK,
- &parentwhentargetnotdir, &client, WRITE_LOCK,
- &rights, &anyrights))) {
+ FS_LOCK;
+ AFSCallStats.StoreStatus++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ /*
+ * Get volume/vnode for the target file; caller's rights to it are
+ * also returned
+ */
+ if ((errorCode =
+ GetVolumePackage(tcon, Fid, &volptr, &targetptr, DONTCHECK,
+ &parentwhentargetnotdir, &client, WRITE_LOCK,
+ &rights, &anyrights))) {
goto Bad_StoreStatus;
}
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_STORESTATUS]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, StoreStatusEvent, code, AUD_FID, Fid, AUD_END);
("SAFS_RemoveFile %s, Did = %u.%u.%u, Host %s, Id %d\n", Name,
DirFid->Volume, DirFid->Vnode, DirFid->Unique,
inet_ntoa(logHostAddr), t_client->ViceId));
- FS_LOCK AFSCallStats.RemoveFile++, AFSCallStats.TotalCalls++;
- FS_UNLOCK
- /*
- * Get volume/vnode for the parent dir; caller's access rights are
- * also returned
- */
- if ((errorCode =
- GetVolumePackage(tcon, DirFid, &volptr, &parentptr, MustBeDIR,
- &parentwhentargetnotdir, &client, WRITE_LOCK,
- &rights, &anyrights))) {
+ FS_LOCK;
+ AFSCallStats.RemoveFile++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ /*
+ * Get volume/vnode for the parent dir; caller's access rights are
+ * also returned
+ */
+ if ((errorCode =
+ GetVolumePackage(tcon, DirFid, &volptr, &parentptr, MustBeDIR,
+ &parentwhentargetnotdir, &client, WRITE_LOCK,
+ &rights, &anyrights))) {
goto Bad_RemoveFile;
}
/* set volume synchronization information */
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_REMOVEFILE]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, RemoveFileEvent, code, AUD_FID, DirFid, AUD_STR, Name,
("SAFS_CreateFile %s, Did = %u.%u.%u, Host %s, Id %d\n", Name,
DirFid->Volume, DirFid->Vnode, DirFid->Unique,
inet_ntoa(logHostAddr), t_client->ViceId));
- FS_LOCK AFSCallStats.CreateFile++, AFSCallStats.TotalCalls++;
- FS_UNLOCK if (!FileNameOK(Name)) {
+ FS_LOCK;
+ AFSCallStats.CreateFile++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ if (!FileNameOK(Name)) {
errorCode = EINVAL;
goto Bad_CreateFile;
}
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_CREATEFILE]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, CreateFileEvent, code, AUD_FID, DirFid, AUD_STR, Name,
OldName, NewName, OldDirFid->Volume, OldDirFid->Vnode,
OldDirFid->Unique, NewDirFid->Volume, NewDirFid->Vnode,
NewDirFid->Unique, inet_ntoa(logHostAddr), t_client->ViceId));
- FS_LOCK AFSCallStats.Rename++, AFSCallStats.TotalCalls++;
- FS_UNLOCK if (!FileNameOK(NewName)) {
+ FS_LOCK;
+ AFSCallStats.Rename++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ if (!FileNameOK(NewName)) {
errorCode = EINVAL;
goto Bad_Rename;
}
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_RENAME]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, RenameFileEvent, code, AUD_FID, OldDirFid, AUD_STR,
("SAFS_Symlink %s to %s, Did = %u.%u.%u, Host %s, Id %d\n", Name,
LinkContents, DirFid->Volume, DirFid->Vnode, DirFid->Unique,
inet_ntoa(logHostAddr), t_client->ViceId));
- FS_LOCK AFSCallStats.Symlink++, AFSCallStats.TotalCalls++;
- FS_UNLOCK if (!FileNameOK(Name)) {
+ FS_LOCK;
+ AFSCallStats.Symlink++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ if (!FileNameOK(Name)) {
errorCode = EINVAL;
goto Bad_SymLink;
}
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_SYMLINK]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, SymlinkEvent, code, AUD_FID, DirFid, AUD_STR, Name,
Name, DirFid->Volume, DirFid->Vnode, DirFid->Unique,
ExistingFid->Volume, ExistingFid->Vnode, ExistingFid->Unique,
inet_ntoa(logHostAddr), t_client->ViceId));
- FS_LOCK AFSCallStats.Link++, AFSCallStats.TotalCalls++;
- FS_UNLOCK if (DirFid->Volume != ExistingFid->Volume) {
+ FS_LOCK;
+ AFSCallStats.Link++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ if (DirFid->Volume != ExistingFid->Volume) {
errorCode = EXDEV;
goto Bad_Link;
}
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_LINK]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, LinkEvent, code, AUD_FID, DirFid, AUD_STR, Name,
("SAFS_MakeDir %s, Did = %u.%u.%u, Host %s, Id %d\n", Name,
DirFid->Volume, DirFid->Vnode, DirFid->Unique,
inet_ntoa(logHostAddr), t_client->ViceId));
- FS_LOCK AFSCallStats.MakeDir++, AFSCallStats.TotalCalls++;
- FS_UNLOCK if (!FileNameOK(Name)) {
+ FS_LOCK;
+ AFSCallStats.MakeDir++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ if (!FileNameOK(Name)) {
errorCode = EINVAL;
goto Bad_MakeDir;
}
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_MAKEDIR]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
goto Bad_MakeDir;
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, MakeDirEvent, code, AUD_FID, DirFid, AUD_STR, Name,
("SAFS_RemoveDir %s, Did = %u.%u.%u, Host %s, Id %d\n", Name,
DirFid->Volume, DirFid->Vnode, DirFid->Unique,
inet_ntoa(logHostAddr), t_client->ViceId));
- FS_LOCK AFSCallStats.RemoveDir++, AFSCallStats.TotalCalls++;
- FS_UNLOCK
- /*
- * Get the vnode and volume for the parent dir along with the caller's
- * rights to it
- */
- if ((errorCode =
- GetVolumePackage(tcon, DirFid, &volptr, &parentptr, MustBeDIR,
- &parentwhentargetnotdir, &client, WRITE_LOCK,
- &rights, &anyrights))) {
+ FS_LOCK;
+ AFSCallStats.RemoveDir++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ /*
+ * Get the vnode and volume for the parent dir along with the caller's
+ * rights to it
+ */
+ if ((errorCode =
+ GetVolumePackage(tcon, DirFid, &volptr, &parentptr, MustBeDIR,
+ &parentwhentargetnotdir, &client, WRITE_LOCK,
+ &rights, &anyrights))) {
goto Bad_RemoveDir;
}
debugvnode1 = *parentptr;
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_REMOVEDIR]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, RemoveDirEvent, code, AUD_FID, DirFid, AUD_STR, Name,
("SAFS_SetLock type = %s Fid = %u.%u.%u, Host %s, Id %d\n",
locktype[(int)type], Fid->Volume, Fid->Vnode, Fid->Unique,
inet_ntoa(logHostAddr), t_client->ViceId));
- FS_LOCK AFSCallStats.SetLock++, AFSCallStats.TotalCalls++;
- FS_UNLOCK
- /*
- * Get the vnode and volume for the desired file along with the caller's
- * rights to it
- */
- if ((errorCode =
- GetVolumePackage(tcon, Fid, &volptr, &targetptr, DONTCHECK,
- &parentwhentargetnotdir, &client, WRITE_LOCK,
- &rights, &anyrights))) {
+ FS_LOCK;
+ AFSCallStats.SetLock++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ /*
+ * Get the vnode and volume for the desired file along with the caller's
+ * rights to it
+ */
+ if ((errorCode =
+ GetVolumePackage(tcon, Fid, &volptr, &targetptr, DONTCHECK,
+ &parentwhentargetnotdir, &client, WRITE_LOCK,
+ &rights, &anyrights))) {
goto Bad_SetLock;
}
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_SETLOCK]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, SetLockEvent, code, AUD_FID, Fid, AUD_LONG, type,
("SAFS_ExtendLock Fid = %u.%u.%u, Host %s, Id %d\n", Fid->Volume,
Fid->Vnode, Fid->Unique, inet_ntoa(logHostAddr),
t_client->ViceId));
- FS_LOCK AFSCallStats.ExtendLock++, AFSCallStats.TotalCalls++;
- FS_UNLOCK
- /*
- * Get the vnode and volume for the desired file along with the caller's
- * rights to it
- */
- if ((errorCode =
- GetVolumePackage(tcon, Fid, &volptr, &targetptr, DONTCHECK,
- &parentwhentargetnotdir, &client, WRITE_LOCK,
- &rights, &anyrights))) {
+ FS_LOCK;
+ AFSCallStats.ExtendLock++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ /*
+ * Get the vnode and volume for the desired file along with the caller's
+ * rights to it
+ */
+ if ((errorCode =
+ GetVolumePackage(tcon, Fid, &volptr, &targetptr, DONTCHECK,
+ &parentwhentargetnotdir, &client, WRITE_LOCK,
+ &rights, &anyrights))) {
goto Bad_ExtendLock;
}
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_EXTENDLOCK]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, ExtendLockEvent, code, AUD_FID, Fid, AUD_END);
("SAFS_ReleaseLock Fid = %u.%u.%u, Host %s, Id %d\n", Fid->Volume,
Fid->Vnode, Fid->Unique, inet_ntoa(logHostAddr),
t_client->ViceId));
- FS_LOCK AFSCallStats.ReleaseLock++, AFSCallStats.TotalCalls++;
- FS_UNLOCK
- /*
- * Get the vnode and volume for the desired file along with the caller's
- * rights to it
- */
- if ((errorCode =
- GetVolumePackage(tcon, Fid, &volptr, &targetptr, DONTCHECK,
- &parentwhentargetnotdir, &client, WRITE_LOCK,
- &rights, &anyrights))) {
+ FS_LOCK;
+ AFSCallStats.ReleaseLock++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ /*
+ * Get the vnode and volume for the desired file along with the caller's
+ * rights to it
+ */
+ if ((errorCode =
+ GetVolumePackage(tcon, Fid, &volptr, &targetptr, DONTCHECK,
+ &parentwhentargetnotdir, &client, WRITE_LOCK,
+ &rights, &anyrights))) {
goto Bad_ReleaseLock;
}
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_RELEASELOCK]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, ReleaseLockEvent, code, AUD_FID, Fid, AUD_END);
extern afs_int32 StartTime, CurrentConnections;
int seconds;
- FS_LOCK stats->CurrentMsgNumber = 0;
+ FS_LOCK;
+ stats->CurrentMsgNumber = 0;
stats->OldestMsgNumber = 0;
stats->StartTime = StartTime;
stats->CurrentConnections = CurrentConnections;
#else
stats->ProcessSize = (afs_int32) ((long)sbrk(0) >> 10);
#endif
- FS_UNLOCK h_GetWorkStats((int *)&(stats->WorkStations),
- (int *)&(stats->ActiveWorkStations), (int *)0,
- (afs_int32) (FT_ApproxTime()) - (15 * 60));
+ FS_UNLOCK;
+ h_GetWorkStats((int *)&(stats->WorkStations),
+ (int *)&(stats->ActiveWorkStations), (int *)0,
+ (afs_int32) (FT_ApproxTime()) - (15 * 60));
} /*SetAFSStats */
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_GETSTATISTICS]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, NOTACTIVECALL, &tcon)))
goto Bad_GetStatistics;
ViceLog(1, ("SAFS_GetStatistics Received\n"));
- FS_LOCK AFSCallStats.GetStatistics++, AFSCallStats.TotalCalls++;
- FS_UNLOCK memset(Statistics, 0, sizeof(*Statistics));
+ FS_LOCK;
+ AFSCallStats.GetStatistics++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ memset(Statistics, 0, sizeof(*Statistics));
SetAFSStats((struct AFSStatistics *)Statistics);
SetVolumeStats((struct AFSStatistics *)Statistics);
SetSystemStats((struct AFSStatistics *)Statistics);
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
return code;
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_XSTATSVERSION]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
*a_versionP = AFS_XSTAT_VERSION;
if (fs_stats_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_LOCK(opP->numSuccesses)++;
- FS_UNLOCK
+ FS_LOCK;
+ (opP->numSuccesses)++;
+ FS_UNLOCK;
#endif /* FS_STATS_DETAILED */
- return (0);
+ return (0);
} /*SRXAFS_XStatsVersion */
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_GETXSTATS]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
/*
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
return (code);
*/
opP =
&(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_GIVEUPCALLBACKS]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if (FidArray)
("SAFS_GiveUpCallBacks (Noffids=%d)\n",
FidArray->AFSCBFids_len));
- FS_LOCK AFSCallStats.GiveUpCallBacks++, AFSCallStats.TotalCalls++;
- FS_UNLOCK if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
+ FS_LOCK;
+ AFSCallStats.GiveUpCallBacks++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
goto Bad_GiveUpCallBacks;
if (!FidArray && !CallBackArray) {
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
out:
return errorCode;
struct rx_connection *tcon = rx_ConnectionOf(acall);
ViceLog(1, ("SRXAFS_FlushCPS\n"));
- FS_LOCK AFSCallStats.TotalCalls++;
- FS_UNLOCK nids = vids->ViceIds_len; /* # of users in here */
+ FS_LOCK;
+ AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ nids = vids->ViceIds_len; /* # of users in here */
naddrs = addrs->IPAddrs_len; /* # of hosts in here */
if (nids < 0 || naddrs < 0) {
errorCode = EINVAL;
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_GETVOLUMEINFO]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
goto Bad_GetVolumeInfo;
- FS_LOCK AFSCallStats.GetVolumeInfo++, AFSCallStats.TotalCalls++;
- FS_UNLOCK code = TryLocalVLServer(avolid, avolinfo);
+ FS_LOCK;
+ AFSCallStats.GetVolumeInfo++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ code = TryLocalVLServer(avolid, avolinfo);
ViceLog(1,
("SAFS_GetVolumeInfo returns %d, Volume %u, type %x, servers %x %x %x %x...\n",
code, avolinfo->Vid, avolinfo->Type, avolinfo->Server0,
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
return code;
*/
opP =
&(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_GETVOLUMESTATUS]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
ViceLog(1, ("SAFS_GetVolumeStatus for volume %u\n", avolid));
if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
goto Bad_GetVolumeStatus;
- FS_LOCK AFSCallStats.GetVolumeStatus++, AFSCallStats.TotalCalls++;
- FS_UNLOCK if (avolid == 0) {
+ FS_LOCK;
+ AFSCallStats.GetVolumeStatus++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ if (avolid == 0) {
errorCode = EINVAL;
goto Bad_GetVolumeStatus;
}
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
return (errorCode);
*/
opP =
&(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_SETVOLUMESTATUS]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
ViceLog(1, ("SAFS_SetVolumeStatus for volume %u\n", avolid));
if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
goto Bad_SetVolumeStatus;
- FS_LOCK AFSCallStats.SetVolumeStatus++, AFSCallStats.TotalCalls++;
- FS_UNLOCK if (avolid == 0) {
+ FS_LOCK;
+ AFSCallStats.SetVolumeStatus++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ if (avolid == 0) {
errorCode = EINVAL;
goto Bad_SetVolumeStatus;
}
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
osi_auditU(acall, SetVolumeStatusEvent, errorCode, AUD_LONG, avolid,
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_GETROOTVOLUME]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
return FSERR_EOPNOTSUPP;
#ifdef notdef
if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
goto Bad_GetRootVolume;
- FS_LOCK AFSCallStats.GetRootVolume++, AFSCallStats.TotalCalls++;
- FS_UNLOCK temp = malloc(256);
+ FS_LOCK;
+ AFSCallStats.GetRootVolume++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ temp = malloc(256);
fd = open(AFSDIR_SERVER_ROOTVOL_FILEPATH, O_RDONLY, 0666);
if (fd <= 0)
strcpy(temp, DEFAULTVOLUME);
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
return (errorCode);
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_CHECKTOKEN]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ 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_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
return code;
* tally the operation.
*/
opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_GETTIME]);
- FS_LOCK(opP->numOps)++;
- FS_UNLOCK TM_GetTimeOfDay(&opStartTime, 0);
+ FS_LOCK;
+ (opP->numOps)++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
if ((code = CallPreamble(acall, NOTACTIVECALL, &tcon)))
goto Bad_GetTime;
- FS_LOCK AFSCallStats.GetTime++, AFSCallStats.TotalCalls++;
- FS_UNLOCK TM_GetTimeOfDay(&tpl, 0);
+ FS_LOCK;
+ AFSCallStats.GetTime++, AFSCallStats.TotalCalls++;
+ FS_UNLOCK;
+ TM_GetTimeOfDay(&tpl, 0);
*Seconds = tpl.tv_sec;
*USeconds = tpl.tv_usec;
TM_GetTimeOfDay(&opStopTime, 0);
fs_stats_GetDiff(elapsedTime, opStartTime, opStopTime);
if (code == 0) {
- FS_LOCK(opP->numSuccesses)++;
+ FS_LOCK;
+ (opP->numSuccesses)++;
fs_stats_AddTo((opP->sumTime), elapsedTime);
fs_stats_SquareAddTo((opP->sqrTime), elapsedTime);
if (fs_stats_TimeLessThan(elapsedTime, (opP->minTime))) {
if (fs_stats_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
fs_stats_TimeAssign((opP->maxTime), elapsedTime);
}
- FS_UNLOCK}
+ FS_UNLOCK;
+ }
#endif /* FS_STATS_DETAILED */
return code;
TM_GetTimeOfDay(&StopTime, 0);
/* Adjust all Fetch Data related stats */
- FS_LOCK if (AFSCallStats.TotalFetchedBytes > 2000000000) /* Reset if over 2 billion */
- AFSCallStats.TotalFetchedBytes = AFSCallStats.AccumFetchTime = 0;
+ FS_LOCK;
+ if (AFSCallStats.TotalFetchedBytes > 2000000000) /* Reset if over 2 billion */
+ AFSCallStats.TotalFetchedBytes = AFSCallStats.AccumFetchTime = 0;
AFSCallStats.AccumFetchTime +=
((StopTime.tv_sec - StartTime.tv_sec) * 1000) +
((StopTime.tv_usec - StartTime.tv_usec) / 1000);
else
AFSCallStats.FetchSize5++;
}
- FS_UNLOCK return (0);
+ FS_UNLOCK;
+ return (0);
} /*FetchData_RXStyle */
VN_SET_LEN(targetptr, NewLength);
/* Update all StoreData related stats */
- FS_LOCK if (AFSCallStats.TotalStoredBytes > 2000000000) /* reset if over 2 billion */
- AFSCallStats.TotalStoredBytes = AFSCallStats.AccumStoreTime = 0;
+ FS_LOCK;
+ if (AFSCallStats.TotalStoredBytes > 2000000000) /* reset if over 2 billion */
+ AFSCallStats.TotalStoredBytes = AFSCallStats.AccumStoreTime = 0;
AFSCallStats.StoreSize1++; /* Piggybacked data */
{
afs_fsize_t targLen;
else
AFSCallStats.StoreSize5++;
}
- FS_UNLOCK return (errorCode);
+ FS_UNLOCK;
+ return (errorCode);
} /*StoreData_RXStyle */