Windows: ObjectInfoCB update last access time
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 13 Apr 2013 05:55:26 +0000 (01:55 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 26 Apr 2013 13:23:36 +0000 (06:23 -0700)
Each time the ObjectInformationCB object is looked up
from the ObjectInfoTree the LastAccessCount field should be updated
except in cases of invalidation, garbage collection, and extent
processing.  This is particularly important when an ObjectInfoCB
is attached to DirectoryCB in AFSInitDirEntry and when constructing
directory snapshots or validating directory content.

Change-Id: Ife412b723a1bdc922ffdfeca71061fcfd1ce721a
Reviewed-on: http://gerrit.openafs.org/9784
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSCommSupport.cpp
src/WINNT/afsrdr/kernel/lib/AFSDirControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSFSControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp

index c7ba719..e11fecd 100644 (file)
@@ -1017,6 +1017,8 @@ AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB,
 
                         SetFlag( pDirNode->Flags, AFS_DIR_ENTRY_VALID);
 
+                        KeQueryTickCount( &ObjectInfoCB->LastAccessCount);
+
                         if( pCurrentDirEntry->ShortNameLength > 0 &&
                             pDirNode->NameInformation.ShortNameLength > 0)
                         {
index 39ddc08..2ef7b71 100644 (file)
@@ -1699,6 +1699,12 @@ AFSSnapshotDirectory( IN AFSFcb *Fcb,
                 pSnapshotEntry->NameHash = (ULONG)pDirEntry->CaseSensitiveTreeEntry.HashIndex;
 
                 pSnapshotEntry++;
+
+                if ( pDirEntry->ObjectInformation != NULL)
+                {
+
+                    KeQueryTickCount( &pDirEntry->ObjectInformation->LastAccessCount);
+                }
             }
             else
             {
index 16012f7..dc14141 100644 (file)
@@ -1023,6 +1023,8 @@ AFSProcessUserFsRequest( IN PIRP Irp)
                                   "AFSProcessUserFsRequest Increment count on object %p Cnt %d\n",
                                   pParentObjectInfo,
                                   lCount));
+
+                    KeQueryTickCount( &pParentObjectInfo->LastAccessCount);
                 }
 
                 AFSReleaseResource( pFcb->ObjectInformation->VolumeCB->ObjectInfoTree.TreeLock);
index 6417b19..42770e6 100644 (file)
@@ -1159,6 +1159,8 @@ AFSInitDirEntry( IN AFSObjectInfoCB *ParentObjectInfo,
                       pObjectInfoCB,
                       lCount));
 
+        KeQueryTickCount( &pObjectInfoCB->LastAccessCount);
+
         AFSReleaseResource( ParentObjectInfo->VolumeCB->ObjectInfoTree.TreeLock);
 
         ntStatus = STATUS_SUCCESS;
@@ -8040,6 +8042,8 @@ AFSGetObjectStatus( IN AFSGetStatusInfoCB *GetStatusInfo,
                                   "AFSGetObjectStatus Increment2 count on object %p Cnt %d\n",
                                   pObjectInfo,
                                   lCount));
+
+                    KeQueryTickCount( &pObjectInfo->LastAccessCount);
                 }
 
                 AFSReleaseResource( pVolumeCB->ObjectInfoTree.TreeLock);