From 52409fae3e4b8d16b68b61902fc09075cd97b75d Mon Sep 17 00:00:00 2001 From: Dominik Sliwa Date: Sun, 2 Jul 2017 16:41:37 +0200 Subject: Backports generated from 4.11 kernel Initial commit. Signed-off-by: Dominik Sliwa --- backport-include/linux/freezer.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 backport-include/linux/freezer.h (limited to 'backport-include/linux/freezer.h') diff --git a/backport-include/linux/freezer.h b/backport-include/linux/freezer.h new file mode 100644 index 0000000..c6053f3 --- /dev/null +++ b/backport-include/linux/freezer.h @@ -0,0 +1,32 @@ +#ifndef __BACKPORT_FREEZER_H_INCLUDED +#define __BACKPORT_FREEZER_H_INCLUDED +#include_next + +#ifdef CONFIG_FREEZER +#if LINUX_VERSION_IS_LESS(3,11,0) +/* + * Like schedule_hrtimeout_range(), but should not block the freezer. Do not + * call this with locks held. + */ +#define freezable_schedule_hrtimeout_range LINUX_BACKPORT(freezable_schedule_hrtimeout_range) +static inline int freezable_schedule_hrtimeout_range(ktime_t *expires, + unsigned long delta, const enum hrtimer_mode mode) +{ + int __retval; + freezer_do_not_count(); + __retval = schedule_hrtimeout_range(expires, delta, mode); + freezer_count(); + return __retval; +} +#endif /* LINUX_VERSION_IS_LESS(3,11,0) */ + +#else /* !CONFIG_FREEZER */ + +#ifndef freezable_schedule_hrtimeout_range +#define freezable_schedule_hrtimeout_range(expires, delta, mode) \ + schedule_hrtimeout_range(expires, delta, mode) +#endif + +#endif /* !CONFIG_FREEZER */ + +#endif /* __BACKPORT_FREEZER_H_INCLUDED */ -- cgit v1.2.3