Author: greatlrd
Date: Sat Dec 30 04:11:14 2006
New Revision: 25246
URL:
http://svn.reactos.org/svn/reactos?rev=25246&view=rev
Log:
do not use hacked vfat drv revers the 25243
the hacked do not delete pendling or incomplte data
and so on,
Modified:
trunk/reactos/drivers/filesystems/vfat/cleanup.c
trunk/reactos/drivers/filesystems/vfat/close.c
trunk/reactos/drivers/filesystems/vfat/create.c
Modified: trunk/reactos/drivers/filesystems/vfat/cleanup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/vfat/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/vfat/cleanup.c (original)
+++ trunk/reactos/drivers/filesystems/vfat/cleanup.c Sat Dec 30 04:11:14 2006
@@ -29,50 +29,24 @@
pFcb = (PVFATFCB) FileObject->FsContext;
if (pFcb)
{
- if (pFcb->Flags & FCB_IS_VOLUME)
- {
- pFcb->OpenHandleCount--;
+ if (!(*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY) &&
+ FsRtlAreThereCurrentFileLocks(&pFcb->FileLock))
+ {
+ /* remove all locks this process have on this file */
+ FsRtlFastUnlockAll(&pFcb->FileLock,
+ FileObject,
+ IoGetRequestorProcess(IrpContext->Irp),
+ NULL);
+ }
- if (pFcb->OpenHandleCount != 0)
- {
- IoRemoveShareAccess(FileObject, &pFcb->FCBShareAccess);
- }
- }
- else
- {
- if(!ExAcquireResourceExclusiveLite (&pFcb->MainResource,
- (BOOLEAN)(IrpContext->Flags &
IRPCONTEXT_CANWAIT)))
- {
- return STATUS_PENDING;
- }
- if(!ExAcquireResourceExclusiveLite (&pFcb->PagingIoResource,
- (BOOLEAN)(IrpContext->Flags &
IRPCONTEXT_CANWAIT)))
- {
- ExReleaseResourceLite (&pFcb->MainResource);
- return STATUS_PENDING;
- }
-
- pFcb->OpenHandleCount--;
+ if (pFcb->Flags & FCB_IS_DIRTY)
+ {
+ VfatUpdateEntry (pFcb);
+ }
- if (!(*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY) &&
- FsRtlAreThereCurrentFileLocks(&pFcb->FileLock))
- {
- /* remove all locks this process have on this file */
- FsRtlFastUnlockAll(&pFcb->FileLock,
- FileObject,
- IoGetRequestorProcess(IrpContext->Irp),
- NULL);
- }
-
- if (pFcb->Flags & FCB_IS_DIRTY)
- {
- VfatUpdateEntry (pFcb);
- }
-
- if (pFcb->Flags & FCB_DELETE_PENDING &&
- pFcb->OpenHandleCount == 0)
- {
- DPRINT("'%wZ'\n", &pFcb->PathNameU);
+ if (pFcb->Flags & FCB_DELETE_PENDING &&
+ pFcb->OpenHandleCount == 1)
+ {
PFILE_OBJECT tmpFileObject;
tmpFileObject = pFcb->FileObject;
if (tmpFileObject != NULL)
@@ -97,21 +71,10 @@
#ifdef USE_ROS_CC_AND_FS
CcRosReleaseFileCache (FileObject);
#else
- if (FileObject->SectionObjectPointer->SharedCacheMap)
- {
- CcUninitializeCacheMap (FileObject, &pFcb->RFCB.FileSize, NULL);
- }
+ CcUninitializeCacheMap (FileObject, NULL, NULL);
#endif
- if (pFcb->OpenHandleCount != 0)
- {
- IoRemoveShareAccess(FileObject, &pFcb->FCBShareAccess);
- }
-
- FileObject->Flags |= FO_CLEANUP_COMPLETE;
-
- ExReleaseResourceLite (&pFcb->PagingIoResource);
- ExReleaseResourceLite (&pFcb->MainResource);
- }
+ pFcb->OpenHandleCount--;
+ IoRemoveShareAccess(FileObject, &pFcb->FCBShareAccess);
}
return STATUS_SUCCESS;
}
@@ -141,11 +104,6 @@
ExReleaseResourceLite (&IrpContext->DeviceExt->DirResource);
- if (Status == STATUS_PENDING)
- {
- return VfatQueueRequest(IrpContext);
- }
-
ByeBye:
IrpContext->Irp->IoStatus.Status = Status;
IrpContext->Irp->IoStatus.Information = 0;
Modified: trunk/reactos/drivers/filesystems/vfat/close.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/vfat/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/vfat/close.c (original)
+++ trunk/reactos/drivers/filesystems/vfat/close.c Sat Dec 30 04:11:14 2006
@@ -30,8 +30,6 @@
pCcb = (PVFATCCB) (FileObject->FsContext2);
pFcb = (PVFATFCB) (FileObject->FsContext);
- FileObject->FsContext2 = NULL;
-
if (pFcb == NULL)
{
return STATUS_SUCCESS;
@@ -45,7 +43,7 @@
}
else
{
-// if (FileObject->DeletePending)
+ if (FileObject->DeletePending)
{
if (pFcb->Flags & FCB_DELETE_PENDING)
{
@@ -59,6 +57,7 @@
vfatReleaseFCB (DeviceExt, pFcb);
}
+ FileObject->FsContext2 = NULL;
FileObject->FsContext = NULL;
FileObject->SectionObjectPointer = NULL;
Modified: trunk/reactos/drivers/filesystems/vfat/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/vfat/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/vfat/create.c (original)
+++ trunk/reactos/drivers/filesystems/vfat/create.c Sat Dec 30 04:11:14 2006
@@ -656,24 +656,7 @@
VfatCloseFile (DeviceExt, FileObject);
return(STATUS_NOT_A_DIRECTORY);
}
-#ifndef USE_ROS_CC_AND_FS
- if (!(*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY))
- {
- if (Stack->Parameters.Create.SecurityContext->DesiredAccess &
FILE_WRITE_DATA ||
- RequestedDisposition == FILE_OVERWRITE ||
- RequestedDisposition == FILE_OVERWRITE_IF)
- {
- if (!MmFlushImageSection(&pFcb->SectionObjectPointers, MmFlushForWrite))
- {
- DPRINT1("%wZ\n", &pFcb->PathNameU);
- DPRINT1("%d %d %d\n",
Stack->Parameters.Create.SecurityContext->DesiredAccess & FILE_WRITE_DATA,
- RequestedDisposition == FILE_OVERWRITE, RequestedDisposition ==
FILE_OVERWRITE_IF);
- VfatCloseFile (DeviceExt, FileObject);
- return STATUS_SHARING_VIOLATION;
- }
- }
- }
-#endif
+
if (PagingFileCreate)
{
/* FIXME: