From 7e95e98db8f253ed08b58977383c971291e3c654 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Wed, 6 Jun 2018 15:10:11 +0000 Subject: [PATCH] Implement the might_sleep_if() function macro in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks --- sys/compat/linuxkpi/common/include/linux/wait.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/wait.h b/sys/compat/linuxkpi/common/include/linux/wait.h index ec8899bba373..ea24b7344539 100644 --- a/sys/compat/linuxkpi/common/include/linux/wait.h +++ b/sys/compat/linuxkpi/common/include/linux/wait.h @@ -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;