When checking for ACL Entry expiration, obtain the current time
once per call to cm_FindACLCache() instead of once per ACL entry.
Change-Id: I4da9e290a43315bd226f6c1b5dc12abe45ed19f5
Reviewed-on: http://gerrit.openafs.org/7016
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
{
cm_aclent_t *aclp;
long retval = -1;
+ time_t now = time(NULL);
lock_ObtainWrite(&cm_aclLock);
*rightsp = 0; /* get a new acl from server if we don't find a
for (aclp = scp->randomACLp; aclp; aclp = aclp->nextp) {
if (aclp->userp == userp) {
- if (aclp->tgtLifetime && aclp->tgtLifetime <= time(NULL)) {
+ if (aclp->tgtLifetime && aclp->tgtLifetime <= now) {
/* ticket expired */
osi_QRemoveHT((osi_queue_t **) &cm_data.aclLRUp, (osi_queue_t **) &cm_data.aclLRUEndp, &aclp->q);
CleanupACLEnt(aclp);