From fef0776df4f358c58cc0a6b5f3396573dd1a2d2a Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 19 Dec 2012 11:45:56 -0500 Subject: [PATCH] Windows: Remove unused AFSVolumeWorkerThread The currently implmentation does all maintenance work in the AFSPrimaryVolumeWorkerThread which is associated with the AFSGlobalRoot volume object. Remove AFSVolumeWorkerThread as it is unused. Change-Id: I2174833093b436430fc46f056e23bb272df6388f Reviewed-on: http://gerrit.openafs.org/8793 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp | 105 +----------------- .../afsrdr/kernel/lib/Include/AFSCommon.h | 3 - 2 files changed, 3 insertions(+), 105 deletions(-) diff --git a/src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp b/src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp index cc487f5b11..ba21013132 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp @@ -389,16 +389,13 @@ AFSInitVolumeWorker( IN AFSVolumeCB *VolumeCB) __Enter { - if( VolumeCB == AFSGlobalRoot) + if ( VolumeCB != AFSGlobalRoot) { - pStartRoutine = AFSPrimaryVolumeWorkerThread; + return STATUS_INVALID_PARAMETER; } - else - { - pStartRoutine = AFSVolumeWorkerThread; - } + pStartRoutine = AFSPrimaryVolumeWorkerThread; // // Initialize the worker thread @@ -1676,102 +1673,6 @@ AFSPrimaryVolumeWorkerThread( IN PVOID Context) return; } -void -AFSVolumeWorkerThread( IN PVOID Context) -{ - - NTSTATUS ntStatus = STATUS_SUCCESS; - AFSVolumeCB *pVolumeCB = (AFSVolumeCB * )Context; - AFSWorkQueueContext *pPoolContext = (AFSWorkQueueContext *)&pVolumeCB->VolumeWorkerContext; - AFSDeviceExt *pControlDeviceExt = NULL; - AFSDeviceExt *pRDRDeviceExt = NULL; - LARGE_INTEGER DueTime; - LONG TimeOut; - KTIMER Timer; - LONG lCount; - - pControlDeviceExt = (AFSDeviceExt *)AFSControlDeviceObject->DeviceExtension; - - pRDRDeviceExt = (AFSDeviceExt *)AFSRDRDeviceObject->DeviceExtension; - - // - // Initialize the timer for the worker thread - // - - DueTime.QuadPart = -(5000); - - TimeOut = 5000; - - KeInitializeTimerEx( &Timer, - SynchronizationTimer); - - KeSetTimerEx( &Timer, - DueTime, - TimeOut, - NULL); - - // - // Indicate that we are initialized and ready - // - - KeSetEvent( &pPoolContext->WorkerThreadReady, - 0, - FALSE); - - // - // Indicate we are initialized - // - - SetFlag( pPoolContext->State, AFS_WORKER_INITIALIZED); - - while( BooleanFlagOn( pPoolContext->State, AFS_WORKER_PROCESS_REQUESTS)) - { - - ntStatus = KeWaitForSingleObject( &Timer, - Executive, - KernelMode, - FALSE, - NULL); - - if( !NT_SUCCESS( ntStatus)) - { - - AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING, - AFS_TRACE_LEVEL_ERROR, - "AFSVolumeWorkerThread Wait for queue items failed Status %08lX\n", ntStatus); - } - else - { - - // - // If we are in shutdown mode and the dirty flag is clear then get out now - // - - if( BooleanFlagOn( pRDRDeviceExt->DeviceFlags, AFS_DEVICE_FLAG_REDIRECTOR_SHUTDOWN)) - { - - break; - } - } - } // worker thread loop - - KeCancelTimer( &Timer); - - lCount = InterlockedDecrement( &pControlDeviceExt->Specific.Control.VolumeWorkerThreadCount); - - if( lCount == 0) - { - - KeSetEvent( &pControlDeviceExt->Specific.Control.VolumeWorkerCloseEvent, - 0, - FALSE); - } - - PsTerminateSystemThread( 0); - - return; -} - NTSTATUS AFSInsertWorkitem( IN AFSWorkItem *WorkItem) { diff --git a/src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h b/src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h index 4f47ee94d5..f6320d6d2b 100644 --- a/src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h +++ b/src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h @@ -1463,9 +1463,6 @@ AFSIOWorkerThread( IN PVOID Context); void AFSPrimaryVolumeWorkerThread( IN PVOID Context); -void -AFSVolumeWorkerThread( IN PVOID Context); - NTSTATUS AFSInsertWorkitem( IN AFSWorkItem *WorkItem);