Windows: Dir Enum only validate when necessary
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 29 Nov 2012 08:13:11 +0000 (03:13 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Mon, 3 Dec 2012 22:05:35 +0000 (14:05 -0800)
During a directory enumeration, do not call AFSValidateEntry()
for every DirectoryCB.  Instead only do so when the
AFS_OBJECT_FLAGS_VERIFY is set on the ObjectInformationCB.

Change-Id: I5653cbf8703da03aeaee24c0c7bf8817e66b8f9e
Reviewed-on: http://gerrit.openafs.org/8567
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/afsrdr/kernel/lib/AFSDirControl.cpp

index 2ac140e..c76bd74 100644 (file)
@@ -782,10 +782,24 @@ AFSQueryDirectory( IN PIRP Irp)
             // We don't worry about entries while enumerating the directory
             //
 
-            AFSValidateEntry( pDirEntry,
-                              &pCcb->AuthGroup,
-                              FALSE,
-                              FALSE);
+            if ( BooleanFlagOn( pDirEntry->ObjectInformation->Flags, AFS_OBJECT_FLAGS_VERIFY))
+            {
+
+                ntStatus = AFSValidateEntry( pDirEntry,
+                                             &pCcb->AuthGroup,
+                                             FALSE,
+                                             FALSE);
+                if ( NT_SUCCESS( ntStatus))
+                {
+
+                    ClearFlag( pDirEntry->ObjectInformation->Flags, AFS_OBJECT_FLAGS_VERIFY);
+                }
+                else
+                {
+
+                    ntStatus = STATUS_SUCCESS;
+                }
+            }
 
             pObjectInfo = pDirEntry->ObjectInformation;