[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230310160757.199253-3-thuth@redhat.com>
Date: Fri, 10 Mar 2023 17:07:54 +0100
From: Thomas Huth <thuth@...hat.com>
To: linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>
Cc: linux-arch@...r.kernel.org, Chas Williams <3chas3@...il.com>,
Palmer Dabbelt <palmer@...belt.com>,
linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-atm-general@...ts.sourceforge.net, netdev@...r.kernel.org,
Christoph Hellwig <hch@...radead.org>
Subject: [PATCH v2 2/5] Move ep_take_care_of_epollwakeup() to fs/eventpoll.c
From: Palmer Dabbelt <palmer@...belt.com>
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@...belt.com>
Reviewed-by: Andrew Waterman <waterman@...s.berkeley.edu>
Reviewed-by: Albert Ou <aou@...s.berkeley.edu>
Message-Id: <1447119071-19392-7-git-send-email-palmer@...belt.com>
[thuth: Rebased to fix contextual conflicts]
Reviewed-by: Arnd Bergmann <arnd@...db.de>
Reviewed-by: Christoph Hellwig <hch@....de>
Signed-off-by: Thomas Huth <thuth@...hat.com>
---
fs/eventpoll.c | 13 +++++++++++++
include/uapi/linux/eventpoll.h | 12 ------------
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 64659b110973..e2a5d2cc9051 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -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)
{
diff --git a/include/uapi/linux/eventpoll.h b/include/uapi/linux/eventpoll.h
index e687658843b1..cfbcc4cc49ac 100644
--- a/include/uapi/linux/eventpoll.h
+++ b/include/uapi/linux/eventpoll.h
@@ -85,16 +85,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 */
--
2.31.1
Powered by blists - more mailing lists