Windows: cm_HaveCallback optimize .readonly

If the cm_scache_t has a registered callback, there is no reason
to obtain a volume reference for a .readonly.  Just use the
callback.

Change-Id: I40a696b9c5fa2e8104837871236c41c338dfbdf9
Reviewed-on: http://gerrit.openafs.org/7716
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
Jeffrey Altman 2012-07-05 11:03:35 -04:00
parent 561b9ce809
commit f73aebbe87

View File

@ -1576,6 +1576,9 @@ int cm_HaveCallback(cm_scache_t *scp)
return (cm_data.fakeDirVersion == scp->dataVersion);
}
#endif
if (scp->cbServerp != NULL)
return 1;
if (scp->flags & CM_SCACHEFLAG_PURERO) {
cm_volume_t *volp = cm_GetVolumeByFID(&scp->fid);
if (volp) {
@ -1600,10 +1603,7 @@ int cm_HaveCallback(cm_scache_t *scp)
return haveCB;
}
}
if (scp->cbServerp != NULL)
return 1;
else
return 0;
return 0;
}
/* need to detect a broken callback that races with our obtaining a callback.