[NTFS]
authorPierre Schweitzer <pierre@reactos.org>
Sun, 3 May 2015 18:17:39 +0000 (18:17 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 3 May 2015 18:17:39 +0000 (18:17 +0000)
Set a flag in the IRP context when an IRP can wait on locking

svn path=/trunk/; revision=67538

reactos/drivers/filesystems/ntfs/misc.c
reactos/drivers/filesystems/ntfs/ntfs.h

index 128f787..071fe1b 100644 (file)
@@ -88,6 +88,16 @@ NtfsAllocateIrpContext(PDEVICE_OBJECT DeviceObject,
     IrpContext->MinorFunction = IoStackLocation->MinorFunction;
     IrpContext->IsTopLevel = (IoGetTopLevelIrp() == Irp);
 
+    if (IoStackLocation->MajorFunction == IRP_MJ_FILE_SYSTEM_CONTROL ||
+        IoStackLocation->MajorFunction == IRP_MJ_DEVICE_CONTROL ||
+        IoStackLocation->MajorFunction == IRP_MJ_SHUTDOWN ||
+        (IoStackLocation->MajorFunction != IRP_MJ_CLEANUP &&
+         IoStackLocation->MajorFunction != IRP_MJ_CLOSE &&
+         IoIsOperationSynchronous(Irp)))
+    {
+        IrpContext->Flags |= IRPCONTEXT_CANWAIT;
+    }
+
     return IrpContext;
 }
 
index 5efb1e9..3f2e55c 100644 (file)
@@ -391,6 +391,8 @@ typedef struct {
     UCHAR Data[1];
 } REPARSE_POINT_ATTRIBUTE, *PREPARSE_POINT_ATTRIBUTE;
 
+#define IRPCONTEXT_CANWAIT 0x1
+
 typedef struct
 {
     NTFSIDENTIFIER Identifier;