Windows: Remove unused AFSVolumeWorkerThread
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 19 Dec 2012 16:45:56 +0000 (11:45 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 23 Dec 2012 04:16:59 +0000 (20:16 -0800)
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 <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp
src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h

index cc487f5..ba21013 100644 (file)
@@ -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)
 {
index 4f47ee9..f6320d6 100644 (file)
@@ -1463,9 +1463,6 @@ AFSIOWorkerThread( IN PVOID Context);
 void
 AFSPrimaryVolumeWorkerThread( IN PVOID Context);
 
-void
-AFSVolumeWorkerThread( IN PVOID Context);
-
 NTSTATUS
 AFSInsertWorkitem( IN AFSWorkItem *WorkItem);