mirror of
https://github.com/bobranten/Ext4Fsd.git
synced 2026-03-16 05:10:37 -05:00
removed two functions that could not be called because of logic
This commit is contained in:
100
Ext4Fsd/close.c
100
Ext4Fsd/close.c
@@ -17,11 +17,6 @@ extern PEXT2_GLOBAL Ext2Global;
|
|||||||
|
|
||||||
/* DEFINITIONS *************************************************************/
|
/* DEFINITIONS *************************************************************/
|
||||||
|
|
||||||
#ifdef ALLOC_PRAGMA
|
|
||||||
#pragma alloc_text(PAGE, Ext2QueueCloseRequest)
|
|
||||||
#pragma alloc_text(PAGE, Ext2DeQueueCloseRequest)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
Ext2Close (IN PEXT2_IRP_CONTEXT IrpContext)
|
Ext2Close (IN PEXT2_IRP_CONTEXT IrpContext)
|
||||||
{
|
{
|
||||||
@@ -54,14 +49,6 @@ Ext2Close (IN PEXT2_IRP_CONTEXT IrpContext)
|
|||||||
ASSERT((Vcb->Identifier.Type == EXT2VCB) &&
|
ASSERT((Vcb->Identifier.Type == EXT2VCB) &&
|
||||||
(Vcb->Identifier.Size == sizeof(EXT2_VCB)));
|
(Vcb->Identifier.Size == sizeof(EXT2_VCB)));
|
||||||
|
|
||||||
if (IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_DELAY_CLOSE)) {
|
|
||||||
|
|
||||||
FileObject = NULL;
|
|
||||||
Fcb = IrpContext->Fcb;
|
|
||||||
Ccb = IrpContext->Ccb;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
FileObject = IrpContext->FileObject;
|
FileObject = IrpContext->FileObject;
|
||||||
Fcb = (PEXT2_FCB) FileObject->FsContext;
|
Fcb = (PEXT2_FCB) FileObject->FsContext;
|
||||||
if (!Fcb) {
|
if (!Fcb) {
|
||||||
@@ -70,7 +57,6 @@ Ext2Close (IN PEXT2_IRP_CONTEXT IrpContext)
|
|||||||
}
|
}
|
||||||
ASSERT(Fcb != NULL);
|
ASSERT(Fcb != NULL);
|
||||||
Ccb = (PEXT2_CCB) FileObject->FsContext2;
|
Ccb = (PEXT2_CCB) FileObject->FsContext2;
|
||||||
}
|
|
||||||
|
|
||||||
DEBUG(DL_INF, ( "Ext2Close: (VCB) Vcb = %p ReferCount = %d\n",
|
DEBUG(DL_INF, ( "Ext2Close: (VCB) Vcb = %p ReferCount = %d\n",
|
||||||
Vcb, Vcb->ReferenceCount));
|
Vcb, Vcb->ReferenceCount));
|
||||||
@@ -86,14 +72,9 @@ Ext2Close (IN PEXT2_IRP_CONTEXT IrpContext)
|
|||||||
|
|
||||||
if (Fcb->Identifier.Type == EXT2VCB) {
|
if (Fcb->Identifier.Type == EXT2VCB) {
|
||||||
|
|
||||||
if (!ExAcquireResourceExclusiveLite(
|
ExAcquireResourceExclusiveLite(
|
||||||
&Vcb->MainResource,
|
&Vcb->MainResource,
|
||||||
TRUE )) {
|
TRUE);
|
||||||
DEBUG(DL_INF, ("Ext2Close: PENDING ... Vcb: %xh/%xh\n",
|
|
||||||
Vcb->OpenHandleCount, Vcb->ReferenceCount));
|
|
||||||
Status = STATUS_PENDING;
|
|
||||||
__leave;
|
|
||||||
}
|
|
||||||
VcbResourceAcquired = TRUE;
|
VcbResourceAcquired = TRUE;
|
||||||
|
|
||||||
if (Ccb) {
|
if (Ccb) {
|
||||||
@@ -115,12 +96,9 @@ Ext2Close (IN PEXT2_IRP_CONTEXT IrpContext)
|
|||||||
__leave;
|
__leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ExAcquireResourceExclusiveLite(
|
ExAcquireResourceExclusiveLite(
|
||||||
&Fcb->MainResource,
|
&Fcb->MainResource,
|
||||||
TRUE )) {
|
TRUE);
|
||||||
Status = STATUS_PENDING;
|
|
||||||
__leave;
|
|
||||||
}
|
|
||||||
FcbResourceAcquired = TRUE;
|
FcbResourceAcquired = TRUE;
|
||||||
|
|
||||||
Fcb->Header.IsFastIoPossible = FastIoIsNotPossible;
|
Fcb->Header.IsFastIoPossible = FastIoIsNotPossible;
|
||||||
@@ -169,15 +147,8 @@ Ext2Close (IN PEXT2_IRP_CONTEXT IrpContext)
|
|||||||
|
|
||||||
if (!IrpContext->ExceptionInProgress) {
|
if (!IrpContext->ExceptionInProgress) {
|
||||||
|
|
||||||
if (Status == STATUS_PENDING) {
|
|
||||||
|
|
||||||
Ext2QueueCloseRequest(IrpContext);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
Ext2CompleteIrpContext(IrpContext, Status);
|
Ext2CompleteIrpContext(IrpContext, Status);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (FcbDerefDeferred)
|
if (FcbDerefDeferred)
|
||||||
Ext2DerefXcb(&Fcb->ReferenceCount);
|
Ext2DerefXcb(&Fcb->ReferenceCount);
|
||||||
@@ -185,66 +156,3 @@ Ext2Close (IN PEXT2_IRP_CONTEXT IrpContext)
|
|||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TO INVESTIGATE: Since no call in Ext2Close return STATUS_PENDING (because the wait parameter to
|
|
||||||
ExAcquireResourceExclusiveLite is TRUE) the functions below will never be called and could be removed? */
|
|
||||||
|
|
||||||
VOID
|
|
||||||
Ext2QueueCloseRequest (IN PEXT2_IRP_CONTEXT IrpContext)
|
|
||||||
{
|
|
||||||
ASSERT(IrpContext);
|
|
||||||
ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
|
|
||||||
(IrpContext->Identifier.Size == sizeof(EXT2_IRP_CONTEXT)));
|
|
||||||
|
|
||||||
if (IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_DELAY_CLOSE)) {
|
|
||||||
|
|
||||||
if (IsFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_FILE_BUSY)) {
|
|
||||||
Ext2Sleep(500); /* 0.5 sec*/
|
|
||||||
} else {
|
|
||||||
Ext2Sleep(50); /* 0.05 sec*/
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
SetFlag(IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT);
|
|
||||||
SetFlag(IrpContext->Flags, IRP_CONTEXT_FLAG_DELAY_CLOSE);
|
|
||||||
|
|
||||||
IrpContext->Fcb = (PEXT2_FCB) IrpContext->FileObject->FsContext;
|
|
||||||
IrpContext->Ccb = (PEXT2_CCB) IrpContext->FileObject->FsContext2;
|
|
||||||
}
|
|
||||||
|
|
||||||
ExInitializeWorkItem(
|
|
||||||
&IrpContext->WorkQueueItem,
|
|
||||||
Ext2DeQueueCloseRequest,
|
|
||||||
IrpContext);
|
|
||||||
|
|
||||||
ExQueueWorkItem(&IrpContext->WorkQueueItem, DelayedWorkQueue);
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID
|
|
||||||
Ext2DeQueueCloseRequest (IN PVOID Context)
|
|
||||||
{
|
|
||||||
PEXT2_IRP_CONTEXT IrpContext;
|
|
||||||
|
|
||||||
IrpContext = (PEXT2_IRP_CONTEXT) Context;
|
|
||||||
ASSERT(IrpContext);
|
|
||||||
ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
|
|
||||||
(IrpContext->Identifier.Size == sizeof(EXT2_IRP_CONTEXT)));
|
|
||||||
|
|
||||||
__try {
|
|
||||||
|
|
||||||
__try {
|
|
||||||
|
|
||||||
FsRtlEnterFileSystem();
|
|
||||||
Ext2Close(IrpContext);
|
|
||||||
|
|
||||||
} __except (Ext2ExceptionFilter(IrpContext, GetExceptionInformation())) {
|
|
||||||
|
|
||||||
Ext2ExceptionHandler(IrpContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
} __finally {
|
|
||||||
|
|
||||||
FsRtlExitFileSystem();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1066,7 +1066,6 @@ typedef struct ext2_icb {
|
|||||||
#define IRP_CONTEXT_STACK_IO_CONTEXT (0x00000100)
|
#define IRP_CONTEXT_STACK_IO_CONTEXT (0x00000100)
|
||||||
#define IRP_CONTEXT_FLAG_REQUEUED (0x00000200)
|
#define IRP_CONTEXT_FLAG_REQUEUED (0x00000200)
|
||||||
#define IRP_CONTEXT_FLAG_USER_IO (0x00000400)
|
#define IRP_CONTEXT_FLAG_USER_IO (0x00000400)
|
||||||
#define IRP_CONTEXT_FLAG_DELAY_CLOSE (0x00000800)
|
|
||||||
#define IRP_CONTEXT_FLAG_FILE_BUSY (0x00001000)
|
#define IRP_CONTEXT_FLAG_FILE_BUSY (0x00001000)
|
||||||
|
|
||||||
|
|
||||||
@@ -1243,12 +1242,6 @@ Ext2Cleanup (IN PEXT2_IRP_CONTEXT IrpContext);
|
|||||||
NTSTATUS
|
NTSTATUS
|
||||||
Ext2Close (IN PEXT2_IRP_CONTEXT IrpContext);
|
Ext2Close (IN PEXT2_IRP_CONTEXT IrpContext);
|
||||||
|
|
||||||
VOID
|
|
||||||
Ext2QueueCloseRequest (IN PEXT2_IRP_CONTEXT IrpContext);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
Ext2DeQueueCloseRequest (IN PVOID Context);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Cmcb.c
|
// Cmcb.c
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user