[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH 03/20] Add IRP_MJ_CLEANUP handler that calls XenIfaceCleanup



Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/xeniface/fdo.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/xeniface/fdo.c b/src/xeniface/fdo.c
index 6d17189..19e50fe 100644
--- a/src/xeniface/fdo.c
+++ b/src/xeniface/fdo.c
@@ -2301,6 +2301,25 @@ FdoDispatchSystemControl(
     return status;
 }
 
+static DECLSPEC_NOINLINE NTSTATUS
+FdoDispatchCleanup(
+    IN  PXENIFACE_FDO   Fdo,
+    IN  PIRP            Irp
+    )
+{
+    PIO_STACK_LOCATION  StackLocation;
+    PFILE_OBJECT        FileObject;
+
+    StackLocation = IoGetCurrentIrpStackLocation(Irp);
+    FileObject = StackLocation->FileObject;
+
+    // XenIfaceCleanup requires PASSIVE_LEVEL as it can call KeFlushQueuedDpcs
+    ASSERT3U(KeGetCurrentIrql(), ==, PASSIVE_LEVEL);
+    XenIfaceCleanup(Fdo, FileObject);
+
+    return FdoDispatchComplete(Fdo, Irp);
+}
+
 NTSTATUS
 FdoDispatch(
     IN  PXENIFACE_FDO   Fdo,
@@ -2329,6 +2348,10 @@ FdoDispatch(
         status = FdoDispatchSystemControl(Fdo, Irp);
         break;
 
+    case IRP_MJ_CLEANUP:
+        status = FdoDispatchCleanup(Fdo, Irp);
+        break;
+
     case IRP_MJ_CREATE:
     case IRP_MJ_CLOSE:
     case IRP_MJ_READ:
-- 
1.9.4.msysgit.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.