@@ -2102,6 +2102,19 @@ static inline int epoll_mutex_lock(struct mutex *mutex, int depth,
return -EAGAIN;
}
+#ifdef CONFIG_PM_SLEEP
+static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev)
+{
+ if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND))
+ epev->events &= ~EPOLLWAKEUP;
+}
+#else
+static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev)
+{
+ epev->events &= ~EPOLLWAKEUP;
+}
+#endif
+
int do_epoll_ctl(int epfd, int op, int fd, struct epoll_event *epds,
bool nonblock)
{
@@ -79,16 +79,4 @@ struct epoll_event {
__u64 data;
} EPOLL_PACKED;
-#ifdef CONFIG_PM_SLEEP
-static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev)
-{
- if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND))
- epev->events &= ~EPOLLWAKEUP;
-}
-#else
-static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev)
-{
- epev->events &= ~EPOLLWAKEUP;
-}
-#endif
#endif /* _UAPI_LINUX_EVENTPOLL_H */
ep_take_care_of_epollwakeup() is a kernel-internal function (it calls capable()) and therefore does not belong in a UAPI header. Since nothing outside fs/eventpoll.c uses it, move it over there. Signed-off-by: Jann Horn <jannh@google.com> --- fs/eventpoll.c | 13 +++++++++++++ include/uapi/linux/eventpoll.h | 12 ------------ 2 files changed, 13 insertions(+), 12 deletions(-) base-commit: 96c9a7802af7d500a582d89a8b864584fe878c1b