Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 May 2020 10:28:21 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r360531 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <202005011028.041ASLXs085781@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri May  1 10:28:21 2020
New Revision: 360531
URL: https://svnweb.freebsd.org/changeset/base/360531

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

Modified:
  head/sys/compat/linuxkpi/common/include/linux/mutex.h

Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/mutex.h	Fri May  1 10:25:07 2020	(r360530)
+++ head/sys/compat/linuxkpi/common/include/linux/mutex.h	Fri May  1 10:28:21 2020	(r360531)
@@ -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;				\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005011028.041ASLXs085781>