Windows: AFSVerifyEntry get rid of bPurgeExtents
authorJeffrey Altman <jaltman@your-file-system.com>
Sun, 25 Aug 2013 23:54:52 +0000 (19:54 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 30 Aug 2013 19:11:18 +0000 (12:11 -0700)
The logic in AFSVerifyEntry is such that bPurgeExtents is always
set to true so simplify the code by removing it.

Change-Id: Idfa90f47158eadb71560122aa3d04b80b7410e03
Reviewed-on: http://gerrit.openafs.org/10187
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp

index 699e835..d87aff2 100644 (file)
@@ -2941,29 +2941,27 @@ AFSVerifyEntry( IN GUID *AuthGroup,
         // Check the data version of the file
         //
 
-        if( pObjectInfo->DataVersion.QuadPart == pDirEnumEntry->DataVersion.QuadPart)
-        {
-            if ( !BooleanFlagOn( pObjectInfo->Flags, AFS_OBJECT_FLAGS_VERIFY_DATA))
-            {
+       if( pObjectInfo->DataVersion.QuadPart == pDirEnumEntry->DataVersion.QuadPart &&
+           !BooleanFlagOn( pObjectInfo->Flags, AFS_OBJECT_FLAGS_VERIFY_DATA))
+       {
 
-                AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
-                              AFS_TRACE_LEVEL_VERBOSE,
-                              "AFSVerifyEntry No DV change %I64X for Fcb %wZ FID %08lX-%08lX-%08lX-%08lX\n",
-                              pObjectInfo->DataVersion.QuadPart,
-                              &DirEntry->NameInformation.FileName,
-                              pObjectInfo->FileId.Cell,
-                              pObjectInfo->FileId.Volume,
-                              pObjectInfo->FileId.Vnode,
-                              pObjectInfo->FileId.Unique));
+           AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
+                         AFS_TRACE_LEVEL_VERBOSE,
+                         "AFSVerifyEntry No DV change %I64X for Fcb %wZ FID %08lX-%08lX-%08lX-%08lX\n",
+                         pObjectInfo->DataVersion.QuadPart,
+                         &DirEntry->NameInformation.FileName,
+                         pObjectInfo->FileId.Cell,
+                         pObjectInfo->FileId.Volume,
+                         pObjectInfo->FileId.Vnode,
+                         pObjectInfo->FileId.Unique));
 
-                //
-                // We are ok, just get out
-                //
+           //
+           // We are ok, just get out
+           //
 
-                ClearFlag( pObjectInfo->Flags, AFS_OBJECT_FLAGS_VERIFY);
+           ClearFlag( pObjectInfo->Flags, AFS_OBJECT_FLAGS_VERIFY);
 
-                try_return( ntStatus = STATUS_SUCCESS);
-            }
+           try_return( ntStatus = STATUS_SUCCESS);
         }
 
         //
@@ -3024,30 +3022,10 @@ AFSVerifyEntry( IN GUID *AuthGroup,
             case AFS_FILE_TYPE_FILE:
             {
                 FILE_OBJECT * pCCFileObject = NULL;
-                BOOLEAN bPurgeExtents = FALSE;
-
-                if ( pObjectInfo->DataVersion.QuadPart != pDirEnumEntry->DataVersion.QuadPart)
-                {
-
-                    AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
-                                  AFS_TRACE_LEVEL_VERBOSE,
-                                  "AFSVerifyEntry DV Change %wZ FID %08lX-%08lX-%08lX-%08lX (%08lX != %08lX)\n",
-                                  &DirEntry->NameInformation.FileName,
-                                  pObjectInfo->FileId.Cell,
-                                  pObjectInfo->FileId.Volume,
-                                  pObjectInfo->FileId.Vnode,
-                                  pObjectInfo->FileId.Unique,
-                                  pObjectInfo->DataVersion.LowPart,
-                                  pDirEnumEntry->DataVersion.LowPart));
-
-                    bPurgeExtents = TRUE;
-                }
 
                 if ( BooleanFlagOn( pObjectInfo->Flags, AFS_OBJECT_FLAGS_VERIFY_DATA))
                 {
 
-                    bPurgeExtents = TRUE;
-
                     AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
                                   AFS_TRACE_LEVEL_VERBOSE,
                                   "AFSVerifyEntry Clearing VERIFY_DATA flag %wZ FID %08lX-%08lX-%08lX-%08lX\n",
@@ -3106,8 +3084,7 @@ AFSVerifyEntry( IN GUID *AuthGroup,
                             ntStatus = stIoStatus.Status;
                         }
 
-                        if ( bPurgeExtents &&
-                             pObjectInfo->Fcb->NPFcb->SectionObjectPointers.DataSectionObject != NULL)
+                       if ( pObjectInfo->Fcb->NPFcb->SectionObjectPointers.DataSectionObject != NULL)
                         {
 
                             if ( !CcPurgeCacheSection( &pObjectInfo->Fcb->NPFcb->SectionObjectPointers,
@@ -3154,11 +3131,8 @@ AFSVerifyEntry( IN GUID *AuthGroup,
 
                     AFSReleaseResource( &pObjectInfo->Fcb->NPFcb->SectionObjectResource);
 
-                    if ( bPurgeExtents)
-                    {
-                        AFSFlushExtents( pObjectInfo->Fcb,
-                                         AuthGroup);
-                    }
+                   AFSFlushExtents( pObjectInfo->Fcb,
+                                    AuthGroup);
 
                     //
                    // Acquire the Fcb to purge the cache