svn commit: r334715 - head/sys/compat/linuxkpi/common/include/linux

Hans Petter Selasky hselasky at FreeBSD.org
Wed Jun 6 15:10:13 UTC 2018


Author: hselasky
Date: Wed Jun  6 15:10:11 2018
New Revision: 334715
URL: https://svnweb.freebsd.org/changeset/base/334715

Log:
  Implement the might_sleep_if() function macro in the LinuxKPI.
  
  Submitted by:	Johannes Lundberg <johalun0 at gmail.com>
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies
  Sponsored by:	Limelight Networks

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

Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/wait.h	Wed Jun  6 15:06:21 2018	(r334714)
+++ head/sys/compat/linuxkpi/common/include/linux/wait.h	Wed Jun  6 15:10:11 2018	(r334715)
@@ -47,6 +47,10 @@
 #define	might_sleep()							\
 	WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "might_sleep()")
 
+#define	might_sleep_if(cond) do { \
+	if (cond) { might_sleep(); } \
+} while (0)
+
 struct wait_queue;
 struct wait_queue_head;
 


More information about the svn-src-head mailing list