Author: hselasky
Date: Mon May 18 09:25:23 2020
New Revision: 361196
URL: https://svnweb.freebsd.org/changeset/base/361196

Log:
  MFC r360531:
  Implement mutex_lock_killable() in the LinuxKPI.
  
  Submitted by: ashafer_badland.io (Austin Shafer)
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h
==============================================================================
--- stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h  Mon May 18 
09:24:36 2020        (r361195)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h  Mon May 18 
09:25:23 2020        (r361196)
@@ -66,6 +66,18 @@ typedef struct mutex {
        linux_mutex_lock_interruptible(_m);     \
 })
 
+/*
+ * Reuse the interruptable method since the SX
+ * lock handles both signals and interrupts:
+ */
+#define        mutex_lock_killable(_m) ({              \
+       MUTEX_SKIP() ? 0 :                      \
+       linux_mutex_lock_interruptible(_m);     \
+})
+
+#define        mutex_lock_killable_nested(_m, _sub)    \
+       mutex_lock_killable(_m)
+
 #define        mutex_unlock(_m) do {                   \
        if (MUTEX_SKIP())                       \
                break;                          \
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to