From f73aebbe8772e62bf8930d70e9edab2f82ff8984 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 5 Jul 2012 11:03:35 -0400 Subject: [PATCH] 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 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsd/cm_callback.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/WINNT/afsd/cm_callback.c b/src/WINNT/afsd/cm_callback.c index 13f0b242e0..f933bb2c91 100644 --- a/src/WINNT/afsd/cm_callback.c +++ b/src/WINNT/afsd/cm_callback.c @@ -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.