Windows: AFS_INVALIDATE_DATA_VERSION only by service
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 6 Apr 2013 20:31:07 +0000 (16:31 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Tue, 9 Apr 2013 17:38:39 +0000 (10:38 -0700)
Let the service make all decisions regarding when a data version
invalidation should be initiated.  If during directory enumeration
or entry validation a data version change is noticed, that is an
indication that the meta data should be updated.

Change-Id: I8872fb5500b08ef2c6b64ab5fd13beeee4267aa2
Reviewed-on: http://gerrit.openafs.org/9743
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

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

index f9edbbf..d860701 100644 (file)
@@ -310,28 +310,6 @@ AFSEnumerateDirectory( IN GUID *AuthGroup,
                         if( pDirNode->ObjectInformation->DataVersion.QuadPart != pCurrentDirEntry->DataVersion.QuadPart)
                         {
 
-                            LONG lCount;
-                            AFSObjectInfoCB *pObjectInfo = pDirNode->ObjectInformation;
-
-                            //
-                            // The ObjectReferenceCount will be freed by AFSPerformObjectInvalidate
-                            //
-
-                            lCount = AFSObjectInfoIncrement( pObjectInfo,
-                                                             AFS_OBJECT_REFERENCE_INVALIDATION);
-
-                            AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
-                                          AFS_TRACE_LEVEL_VERBOSE,
-                                          "AFSEnumerateDirectory calling AFSPerformObjectInvalidate Increment count on object %p Cnt %d\n",
-                                          pObjectInfo,
-                                          lCount));
-
-                            AFSPerformObjectInvalidate( pObjectInfo,
-                                                        AFS_INVALIDATE_DATA_VERSION);
-                        }
-                        else
-                        {
-
                             AFSUpdateMetaData( pDirNode,
                                                pCurrentDirEntry);
                         }
@@ -1103,42 +1081,6 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
                         if( pObjectInfo->DataVersion.QuadPart != pCurrentDirEntry->DataVersion.QuadPart)
                         {
 
-                            //
-                            // The ObjectReferenceCount will be freed by AFSPerformObjectInvalidate
-                            // if successfully queued.  Cannot call AFSPerformObjectInvalidate directly
-                            // because ObjectInfoCB->Specific.Directory.DirectoryNodeHdr.TreeLock is
-                            // held during the sequence AFSVerifyEntry->AFSValidateDirectoryCache->
-                            // AFSVerifyDirectoryContent and AFSPerformObjectInvalidate requires the
-                            // Fcb->NPFcb->Resource which must be held prior to the TreeLock in the
-                            // lock hierarchy.
-                            //
-
-                            lCount = AFSObjectInfoIncrement( pObjectInfo,
-                                                             AFS_OBJECT_REFERENCE_INVALIDATION);
-
-                            AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
-                                          AFS_TRACE_LEVEL_VERBOSE,
-                                          "AFSVerifyDirectoryContent calling AFSQueueInvalidateObject Increment count on object %p Cnt %d\n",
-                                          pObjectInfo,
-                                          lCount));
-
-                            if ( !NT_SUCCESS( AFSQueueInvalidateObject( pObjectInfo,
-                                                                        AFS_INVALIDATE_DATA_VERSION)))
-                            {
-
-                                lCount = AFSObjectInfoDecrement( pObjectInfo,
-                                                                 AFS_OBJECT_REFERENCE_INVALIDATION);
-
-                                AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
-                                              AFS_TRACE_LEVEL_VERBOSE,
-                                              "AFSVerifyDirectoryContent AFSQueueInvalidateObject failed Decrement count on object %p Cnt %d\n",
-                                              pObjectInfo,
-                                              lCount));
-                            }
-                        }
-                        else
-                        {
-
                             AFSUpdateMetaData( pDirNode,
                                                pCurrentDirEntry);
                         }