Windows: remove unnecessary DirectoryEnumEvent

The DirectoryEnumEvent is not required to implement:

  AFSSetEnumerationEvent
  AFSClearEnumerationEvent
  AFSIsEnumerationInProgress

The DirectoryEnumCount is modified by interlocked operations
and can be used as a marker for when an enumeration is in progress.

Change-Id: I414ce2bc753b0fd60a3fac51c2cf3d264a32ab05
Reviewed-on: http://gerrit.openafs.org/6725
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
This commit is contained in:
Jeffrey Altman 2012-02-17 10:37:34 -05:00 committed by Jeffrey Altman
parent 780e497b32
commit 168d730a6f
3 changed files with 1 additions and 70 deletions

View File

@ -217,8 +217,6 @@ typedef struct _AFS_NONPAGED_FCB
struct
{
KEVENT DirectoryEnumEvent;
LONG DirectoryEnumCount;
} Directory;

View File

@ -179,14 +179,6 @@ AFSInitFcb( IN AFSDirectoryCB *DirEntry)
//
pFcb->Header.NodeTypeCode = AFS_DIRECTORY_FCB;
//
// Initialize enumeration information
//
KeInitializeEvent( &pFcb->NPFcb->Specific.Directory.DirectoryEnumEvent,
NotificationEvent,
FALSE);
}
else if( pObjectInfo->FileType == AFS_FILE_TYPE_FILE)
{
@ -957,14 +949,6 @@ AFSInitRootFcb( IN ULONGLONG ProcessID,
pFcb->NPFcb = pNPFcb;
//
// Initialize enumeration information
//
KeInitializeEvent( &pFcb->NPFcb->Specific.Directory.DirectoryEnumEvent,
NotificationEvent,
FALSE);
//
// Save the root Fcb in the VolumeCB
//

View File

@ -5398,25 +5398,10 @@ AFSSetEnumerationEvent( IN AFSFcb *Fcb)
{
case AFS_DIRECTORY_FCB:
{
KeSetEvent( &Fcb->NPFcb->Specific.Directory.DirectoryEnumEvent,
0,
FALSE);
lCount = InterlockedIncrement( &Fcb->NPFcb->Specific.Directory.DirectoryEnumCount);
break;
}
case AFS_ROOT_FCB:
case AFS_ROOT_ALL:
{
KeSetEvent( &Fcb->NPFcb->Specific.Directory.DirectoryEnumEvent,
0,
FALSE);
lCount = InterlockedIncrement( &Fcb->NPFcb->Specific.Directory.DirectoryEnumCount);
break;
@ -5440,21 +5425,6 @@ AFSClearEnumerationEvent( IN AFSFcb *Fcb)
{
case AFS_DIRECTORY_FCB:
{
ASSERT( Fcb->NPFcb->Specific.Directory.DirectoryEnumCount > 0);
lCount = InterlockedDecrement( &Fcb->NPFcb->Specific.Directory.DirectoryEnumCount);
if( lCount == 0)
{
KeClearEvent( &Fcb->NPFcb->Specific.Directory.DirectoryEnumEvent);
}
break;
}
case AFS_ROOT_FCB:
case AFS_ROOT_ALL:
{
@ -5463,12 +5433,6 @@ AFSClearEnumerationEvent( IN AFSFcb *Fcb)
lCount = InterlockedDecrement( &Fcb->NPFcb->Specific.Directory.DirectoryEnumCount);
if( lCount == 0)
{
KeClearEvent( &Fcb->NPFcb->Specific.Directory.DirectoryEnumEvent);
}
break;
}
}
@ -5491,30 +5455,15 @@ AFSIsEnumerationInProcess( IN AFSObjectInfoCB *ObjectInfo)
try_return( bIsInProcess);
}
//
// Depending on the type of node, set the event
//
switch( ObjectInfo->Fcb->Header.NodeTypeCode)
{
case AFS_DIRECTORY_FCB:
{
if( KeReadStateEvent( &ObjectInfo->Fcb->NPFcb->Specific.Directory.DirectoryEnumEvent))
{
bIsInProcess = TRUE;
}
break;
}
case AFS_ROOT_FCB:
case AFS_ROOT_ALL:
{
if( KeReadStateEvent( &ObjectInfo->Fcb->NPFcb->Specific.Directory.DirectoryEnumEvent))
if( ObjectInfo->Fcb->NPFcb->Specific.Directory.DirectoryEnumCount > 0)
{
bIsInProcess = TRUE;