macos disable bulkstat
[openafs.git] / src / afs / VNOPS / afs_vnop_lookup.c
index 06a79e9..f40f46c 100644 (file)
@@ -1261,20 +1261,27 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
            tvcp = afs_FindVCache(&afid, &retry, 0 /* !stats&!lru */ );
            ReleaseReadLock(&afs_xvcache);
        } while (tvcp && retry);
-       if (tvcp != NULL && (tvcp->f.states & CBulkFetching)
-           && (tvcp->f.m.Length == statSeqNo)) {
-           tvcp->f.states &= ~CBulkFetching;
-       }
        if (tvcp != NULL) {
-#ifdef AFS_DARWIN80_ENV            
-           if ((!(tvcp->f.states & CDeadVnode)&&!(tvcp->f.states & CVInit))) {
-               /* re-acquire the io&usecount that the other finalizevnode disposed of */
-               vnode_get(AFSTOV(tvcp));
-               vnode_ref(AFSTOV(tvcp));
-           }
+           if ((tvcp->f.states & CBulkFetching)
+               && (tvcp->f.m.Length == statSeqNo)) {
+               tvcp->f.states &= ~CBulkFetching;
+#ifdef AFS_DARWIN80_ENV
+               if ((!(tvcp->f.states & CDeadVnode)&&!(tvcp->f.states & CVInit))) {
+                   /* re-acquire the io&usecount that finalizevnode dropped */
+                   vnode_get(AFSTOV(tvcp));
+                   vnode_ref(AFSTOV(tvcp));
+               }
 #endif
+           }
            afs_PutVCache(tvcp);
        }
+#ifdef AFS_DARWIN80_ENV            
+       else {
+           if ((!(tvcp->f.states & CDeadVnode)&&!(tvcp->f.states & CVInit)))
+               osi_Panic("vnode finalized without clearing BulkFetching!");
+       }
+#endif
+
     }
     if (volp)
        afs_PutVolume(volp, READ_LOCK);
@@ -1297,7 +1304,11 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp)
 }
 
 /* was: (AFS_DEC_ENV) || defined(AFS_OSF30_ENV) || defined(AFS_NCR_ENV) */
+#ifdef AFS_DARWIN_ENV
+static int AFSDOBULK = 0;
+#else
 static int AFSDOBULK = 1;
+#endif
 
 int
 #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)