Skip to content

Commit 063f3ed

Browse files
palmer-dabbeltarndb
authored andcommitted
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 95f19f6 ("epoll: drop EPOLLWAKEUP if PM_SLEEP is disabled"). Signed-off-by: Palmer Dabbelt <[email protected]> Reviewed-by: Andrew Waterman <[email protected]> Reviewed-by: Albert Ou <[email protected]> Message-Id: <[email protected]> [thuth: Rebased to fix contextual conflicts] Reviewed-by: Arnd Bergmann <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Thomas Huth <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 5fe5a75 commit 063f3ed

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

fs/eventpoll.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,6 +2042,19 @@ SYSCALL_DEFINE1(epoll_create, int, size)
20422042
return do_epoll_create(0);
20432043
}
20442044

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+
20452058
static inline int epoll_mutex_lock(struct mutex *mutex, int depth,
20462059
bool nonblock)
20472060
{

include/uapi/linux/eventpoll.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,4 @@ struct epoll_event {
8585
__u64 data;
8686
} EPOLL_PACKED;
8787

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
10088
#endif /* _UAPI_LINUX_EVENTPOLL_H */

0 commit comments

Comments
 (0)