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 <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>
1 parent 5fe5a75 commit 063f3ed

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

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)