[FASTFAT]
authorPierre Schweitzer <pierre@reactos.org>
Sun, 24 May 2015 12:39:10 +0000 (12:39 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 24 May 2015 12:39:10 +0000 (12:39 +0000)
- Add a debugging assert that will save your lot of time if you attempt to manually queue a wrong IRP. You cannot queue an IRP which is set to be later queued again. This is a broken behavior.
- Remove a bit of code duplication

svn path=/trunk/; revision=67880

reactos/drivers/filesystems/fastfat/misc.c

index 1e97d7a..39e5896 100644 (file)
@@ -112,6 +112,8 @@ VfatDispatchRequest(
 
     ASSERT(IrpContext);
 
+    FsRtlEnterFileSystem();
+
     switch (IrpContext->MajorFunction)
     {
         case IRP_MJ_CLOSE:
@@ -202,6 +204,8 @@ VfatDispatchRequest(
         VfatFreeIrpContext(IrpContext);
     }
 
+    FsRtlExitFileSystem();
+
     return Status;
 }
 
@@ -228,9 +232,7 @@ VfatBuildRequest(
     }
     else
     {
-        FsRtlEnterFileSystem();
         Status = VfatDispatchRequest(IrpContext);
-        FsRtlExitFileSystem();
     }
     return Status;
 }
@@ -302,9 +304,7 @@ VfatDoRequest(
     InterlockedDecrement(&QueueCount);
     DPRINT("VfatDoRequest(IrpContext %p), MajorFunction %x, %d\n",
            IrpContext, ((PVFAT_IRP_CONTEXT)IrpContext)->MajorFunction, QueueCount);
-    FsRtlEnterFileSystem();
     VfatDispatchRequest((PVFAT_IRP_CONTEXT)IrpContext);
-    FsRtlExitFileSystem();
 }
 
 static
@@ -317,6 +317,8 @@ VfatQueueRequest(
 
     ASSERT(IrpContext != NULL);
     ASSERT(IrpContext->Irp != NULL);
+    ASSERT(!(IrpContext->Flags & IRPCONTEXT_QUEUE) &&
+           (IrpContext->Flags & IRPCONTEXT_COMPLETE));
 
     IrpContext->Flags |= IRPCONTEXT_CANWAIT;
     IoMarkIrpPending(IrpContext->Irp);