From 69f51d153394c8b2223ffa3b92805dffe45f0673 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 17 Feb 2018 13:48:32 +0100 Subject: [PATCH] [FASTFAT] Drop read ahead locking routines in favor of lazy writer routines. This avoids code duplication while being consistent with MS FastFAT. --- drivers/filesystems/fastfat/fastio.c | 30 ---------------------------- drivers/filesystems/fastfat/iface.c | 4 ++-- drivers/filesystems/fastfat/vfat.h | 11 ---------- 3 files changed, 2 insertions(+), 43 deletions(-) diff --git a/drivers/filesystems/fastfat/fastio.c b/drivers/filesystems/fastfat/fastio.c index 58d3f0d587f..248f39f5bf9 100644 --- a/drivers/filesystems/fastfat/fastio.c +++ b/drivers/filesystems/fastfat/fastio.c @@ -753,36 +753,6 @@ VfatReleaseFromLazyWrite( ExReleaseResourceLite(&(Fcb->MainResource)); } -BOOLEAN -NTAPI -VfatAcquireForReadAhead( - IN PVOID Context, - IN BOOLEAN Wait) -{ - PVFATFCB Fcb = (PVFATFCB)Context; - ASSERT(Fcb); - DPRINT("VfatAcquireForReadAhead(): Fcb %p\n", Fcb); - - if (!ExAcquireResourceExclusiveLite(&(Fcb->MainResource), Wait)) - { - DPRINT("VfatAcquireForReadAhead(): ExReleaseResourceLite failed.\n"); - return FALSE; - } - return TRUE; -} - -VOID -NTAPI -VfatReleaseFromReadAhead( - IN PVOID Context) -{ - PVFATFCB Fcb = (PVFATFCB)Context; - ASSERT(Fcb); - DPRINT("VfatReleaseFromReadAhead(): Fcb %p\n", Fcb); - - ExReleaseResourceLite(&(Fcb->MainResource)); -} - INIT_SECTION VOID VfatInitFastIoRoutines( diff --git a/drivers/filesystems/fastfat/iface.c b/drivers/filesystems/fastfat/iface.c index c334a95aed4..02e570ea450 100644 --- a/drivers/filesystems/fastfat/iface.c +++ b/drivers/filesystems/fastfat/iface.c @@ -119,8 +119,8 @@ DriverEntry( /* Cache manager */ VfatGlobalData->CacheMgrCallbacks.AcquireForLazyWrite = VfatAcquireForLazyWrite; VfatGlobalData->CacheMgrCallbacks.ReleaseFromLazyWrite = VfatReleaseFromLazyWrite; - VfatGlobalData->CacheMgrCallbacks.AcquireForReadAhead = VfatAcquireForReadAhead; - VfatGlobalData->CacheMgrCallbacks.ReleaseFromReadAhead = VfatReleaseFromReadAhead; + VfatGlobalData->CacheMgrCallbacks.AcquireForReadAhead = VfatAcquireForLazyWrite; + VfatGlobalData->CacheMgrCallbacks.ReleaseFromReadAhead = VfatReleaseFromLazyWrite; /* Fast I/O */ VfatInitFastIoRoutines(&VfatGlobalData->FastIoDispatch); diff --git a/drivers/filesystems/fastfat/vfat.h b/drivers/filesystems/fastfat/vfat.h index f6e2aa64525..487b5f9ab2d 100644 --- a/drivers/filesystems/fastfat/vfat.h +++ b/drivers/filesystems/fastfat/vfat.h @@ -775,17 +775,6 @@ NTAPI VfatReleaseFromLazyWrite( IN PVOID Context); -BOOLEAN -NTAPI -VfatAcquireForReadAhead( - IN PVOID Context, - IN BOOLEAN Wait); - -VOID -NTAPI -VfatReleaseFromReadAhead( - IN PVOID Context); - /* fat.c */ NTSTATUS