Move ep_take_care_of_epollwakeup() to fs/eventpoll.c
[linux-block.git] / fs / eventpoll.c
index 64659b110973339dbbbbf061a2107e3a7246916b..e2a5d2cc9051529849bfbb1cfa92a99e0493632f 100644 (file)
@@ -2042,6 +2042,19 @@ SYSCALL_DEFINE1(epoll_create, int, size)
        return do_epoll_create(0);
 }
 
+#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
+
 static inline int epoll_mutex_lock(struct mutex *mutex, int depth,
                                   bool nonblock)
 {