Windows: Remove Fcb.Specific.File.LazyWriterThread
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 16 Oct 2012 13:08:37 +0000 (09:08 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 19 Oct 2012 09:50:06 +0000 (02:50 -0700)
The LazyWriterThread should not be recorded in the FCB.  It is
possible for multiple lazy writes to occur on a file in parallel
in separate threads.  The value is not used for anything in any
case.  AFSCommonWrite() tests the LazyWriterThread value but only
if 'bMapped' is FALSE.  Since 'bMapped' is always TRUE, the
comparison is never performed.   Remove the test and the value.

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

src/WINNT/afsrdr/common/AFSRedirCommonStructs.h
src/WINNT/afsrdr/kernel/fs/AFSGeneric.cpp
src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp

index 217ecc7..1303ec8 100644 (file)
@@ -377,12 +377,6 @@ typedef struct AFS_FCB
             LONG                ExtentCount;
 
             //
-            // The Lazy writer thread
-            //
-
-            PETHREAD            LazyWriterThread;
-
-            //
             // Current count of queued flush items for the file
             //
 
index 0ec1ed6..3b86737 100644 (file)
@@ -1553,10 +1553,6 @@ AFSAcquireFcbForLazyWrite( IN PVOID Fcb,
                   "AFSAcquireFcbForLazyWrite Acquiring Fcb %08lX\n",
                   Fcb);
 
-    ASSERT( NULL == pFcb->Specific.File.LazyWriterThread);
-
-    pFcb->Specific.File.LazyWriterThread = PsGetCurrentThread();
-
     AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
                   AFS_TRACE_LEVEL_VERBOSE,
                   "AFSAcquireFcbForLazyWrite Attempt to acquire Fcb lock %08lX SHARED %08lX\n",
@@ -1639,11 +1635,6 @@ AFSReleaseFcbFromLazyWrite( IN PVOID Fcb)
 
     IoSetTopLevelIrp( NULL);
 
-    ASSERT( PsGetCurrentThread() == pFcb->Specific.File.LazyWriterThread);
-
-    pFcb->Specific.File.LazyWriterThread = NULL;
-
-
     AFSReleaseResource( &pFcb->NPFcb->PagingResource);
 
     AFSReleaseResource( &pFcb->NPFcb->Resource);
index b774a52..6f528b4 100644 (file)
@@ -112,7 +112,6 @@ AFSCommonWrite( IN PDEVICE_OBJECT DeviceObject,
     BOOLEAN            bExtendingWrite = FALSE;
     BOOLEAN            bCompleteIrp = TRUE;
     BOOLEAN            bLockOK;
-    BOOLEAN            bMapped = TRUE;
     HANDLE             hCallingUser = OnBehalfOf;
     ULONG              ulExtensionLength = 0;
     BOOLEAN            bRetry = FALSE;
@@ -440,21 +439,6 @@ AFSCommonWrite( IN PDEVICE_OBJECT DeviceObject,
         */
 
         //
-        // If they are not mapped and we are the Lazy Writer then just
-        // say "not now"
-        //
-        if (!bMapped && pFcb->Specific.File.LazyWriterThread == PsGetCurrentThread())
-        {
-
-            AFSDbgLogMsg( AFS_SUBSYSTEM_IO_PROCESSING,
-                          AFS_TRACE_LEVEL_VERBOSE,
-                          "AFSCommonWrite (%08lX) Failing lazy writer for unmapped request\n",
-                          Irp);
-
-            try_return ( ntStatus = STATUS_FILE_LOCK_CONFLICT);
-        }
-
-        //
         // Take locks
         //
         //   - if Paging then we need to nothing (the precalls will