From: Jeffrey Altman Date: Tue, 16 Oct 2012 13:08:37 +0000 (-0400) Subject: Windows: Remove Fcb.Specific.File.LazyWriterThread X-Git-Tag: upstream/1.8.0_pre1^2~1908 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=f6ab5cc8bd216383b8584aa05a5516862b59ab70;p=packages%2Fo%2Fopenafs.git Windows: Remove Fcb.Specific.File.LazyWriterThread 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 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsrdr/common/AFSRedirCommonStructs.h b/src/WINNT/afsrdr/common/AFSRedirCommonStructs.h index 217ecc739..1303ec838 100644 --- a/src/WINNT/afsrdr/common/AFSRedirCommonStructs.h +++ b/src/WINNT/afsrdr/common/AFSRedirCommonStructs.h @@ -376,12 +376,6 @@ typedef struct AFS_FCB LONG ExtentCount; - // - // The Lazy writer thread - // - - PETHREAD LazyWriterThread; - // // Current count of queued flush items for the file // diff --git a/src/WINNT/afsrdr/kernel/fs/AFSGeneric.cpp b/src/WINNT/afsrdr/kernel/fs/AFSGeneric.cpp index 0ec1ed66f..3b867371e 100644 --- a/src/WINNT/afsrdr/kernel/fs/AFSGeneric.cpp +++ b/src/WINNT/afsrdr/kernel/fs/AFSGeneric.cpp @@ -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); diff --git a/src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp b/src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp index b774a521d..6f528b458 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp @@ -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; @@ -439,21 +438,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 //