|
@@ -134,10 +134,25 @@ static inline void set_freezable_with_signal(void)
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- * Freezer-friendly wrappers around wait_event_interruptible() and
|
|
|
- * wait_event_interruptible_timeout(), originally defined in <linux/wait.h>
|
|
|
+ * Freezer-friendly wrappers around wait_event_interruptible(),
|
|
|
+ * wait_event_killable() and wait_event_interruptible_timeout(), originally
|
|
|
+ * defined in <linux/wait.h>
|
|
|
*/
|
|
|
|
|
|
+#define wait_event_freezekillable(wq, condition) \
|
|
|
+({ \
|
|
|
+ int __retval; \
|
|
|
+ do { \
|
|
|
+ __retval = wait_event_killable(wq, \
|
|
|
+ (condition) || freezing(current)); \
|
|
|
+ if (__retval && !freezing(current)) \
|
|
|
+ break; \
|
|
|
+ else if (!(condition)) \
|
|
|
+ __retval = -ERESTARTSYS; \
|
|
|
+ } while (try_to_freeze()); \
|
|
|
+ __retval; \
|
|
|
+})
|
|
|
+
|
|
|
#define wait_event_freezable(wq, condition) \
|
|
|
({ \
|
|
|
int __retval; \
|