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

[MiNT] [PATCH][3/6] Sync devices when calling XHEject from inside



Commit message:

Devices won't be sync if XHEject is called directly from inside the kernel or
from modules, so put the "sync devices" function where is going to be
called when XHEject is done from inside too.

Contributed by David Gálvez.
diff -r d68b02f5513b -r c3b3e5baa913 sys/xhdi.c
--- a/sys/xhdi.c	Fri Apr 17 16:26:10 2015 +0200
+++ b/sys/xhdi.c	Fri Apr 17 16:52:58 2015 +0200
@@ -213,13 +213,6 @@
 	if (op == 0)
 		return XHDI_installed;
 	
-	/* XHEject */
-	/* a2 contains do_eject parameter */
-	if (op == 5 && (a2 >> 16) == 1)
-	{
-		bio_sync_all ();
-	}
-
 	/* XHDrvMap */
 	if (op == 6)
 		return XHDI (6);
@@ -286,6 +279,9 @@
 long
 XHEject (ushort major, ushort minor, ushort do_eject, ushort key)
 {
+	if (do_eject == 1)
+		bio_sync_all ();
+
 	return XHDI (5, major, minor, do_eject, key);
 }