Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Move ep_take_care_of_epollwakeup() to fs/eventpoll.c

This doesn't make any sense to expose to userspace, so it's been moved
to the one user. This was introduced by commit 95f19f658ce1 ("epoll:
drop EPOLLWAKEUP if PM_SLEEP is disabled").

Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
Reviewed-by: Andrew Waterman <waterman@eecs.berkeley.edu>
Reviewed-by: Albert Ou <aou@eecs.berkeley.edu>
Message-Id: <1447119071-19392-7-git-send-email-palmer@dabbelt.com>
[thuth: Rebased to fix contextual conflicts]
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Palmer Dabbelt and committed by
Arnd Bergmann
063f3ed9 5fe5a758

+13 -12
+13
fs/eventpoll.c
··· 2042 2042 return do_epoll_create(0); 2043 2043 } 2044 2044 2045 + #ifdef CONFIG_PM_SLEEP 2046 + static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) 2047 + { 2048 + if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND)) 2049 + epev->events &= ~EPOLLWAKEUP; 2050 + } 2051 + #else 2052 + static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) 2053 + { 2054 + epev->events &= ~EPOLLWAKEUP; 2055 + } 2056 + #endif 2057 + 2045 2058 static inline int epoll_mutex_lock(struct mutex *mutex, int depth, 2046 2059 bool nonblock) 2047 2060 {
-12
include/uapi/linux/eventpoll.h
··· 85 85 __u64 data; 86 86 } EPOLL_PACKED; 87 87 88 - #ifdef CONFIG_PM_SLEEP 89 - static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) 90 - { 91 - if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND)) 92 - epev->events &= ~EPOLLWAKEUP; 93 - } 94 - #else 95 - static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) 96 - { 97 - epev->events &= ~EPOLLWAKEUP; 98 - } 99 - #endif 100 88 #endif /* _UAPI_LINUX_EVENTPOLL_H */