Windows: cm_HaveCallback optimize .readonly
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 5 Jul 2012 15:03:35 +0000 (11:03 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 5 Jul 2012 17:09:54 +0000 (10:09 -0700)
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>

src/WINNT/afsd/cm_callback.c

index 13f0b24..f933bb2 100644 (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.