diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-12 00:57:19 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-12 00:57:19 +0300 |
commit | ee5daa1361fceb6f482c005bcc9ba8d01b92ea5c (patch) | |
tree | 71736f733c7efec13218756ab8635b258b8a1c53 /include | |
parent | 3fc928dc5308f6533d0e8004c8c63b46709a5276 (diff) | |
parent | d85e2aa2e34dac793e70b900d865f48c69ecbc27 (diff) | |
download | linux-ee5daa1361fceb6f482c005bcc9ba8d01b92ea5c.tar.xz |
Merge branch 'work.poll2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull more poll annotation updates from Al Viro:
"This is preparation to solving the problems you've mentioned in the
original poll series.
After this series, the kernel is ready for running
for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done
done
as a for bulk search-and-replace.
After that, the kernel is ready to apply the patch to unify
{de,}mangle_poll(), and then get rid of kernel-side POLL... uses
entirely, and we should be all done with that stuff.
Basically, that's what you suggested wrt KPOLL..., except that we can
use EPOLL... instead - they already are arch-independent (and equal to
what is currently kernel-side POLL...).
After the preparations (in this series) switch to returning EPOLL...
from ->poll() instances is completely mechanical and kernel-side
POLL... can go away. The last step (killing kernel-side POLL... and
unifying {de,}mangle_poll() has to be done after the
search-and-replace job, since we need userland-side POLL... for
unified {de,}mangle_poll(), thus the cherry-pick at the last step.
After that we will have:
- POLL{IN,OUT,...} *not* in __poll_t, so any stray instances of
->poll() still using those will be caught by sparse.
- eventpoll.c and select.c warning-free wrt __poll_t
- no more kernel-side definitions of POLL... - userland ones are
visible through the entire kernel (and used pretty much only for
mangle/demangle)
- same behavior as after the first series (i.e. sparc et.al. epoll(2)
working correctly)"
* 'work.poll2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
annotate ep_scan_ready_list()
ep_send_events_proc(): return result via esed->res
preparation to switching ->poll() to returning EPOLL...
add EPOLLNVAL, annotate EPOLL... and event_poll->event
use linux/poll.h instead of asm/poll.h
xen: fix poll misannotation
smc: missing poll annotations
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/poll.h | 3 | ||||
-rw-r--r-- | include/uapi/linux/eventpoll.h | 33 |
2 files changed, 19 insertions, 17 deletions
diff --git a/include/linux/poll.h b/include/linux/poll.h index 04781a753326..d23104b32931 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h @@ -11,6 +11,7 @@ #include <linux/sysctl.h> #include <linux/uaccess.h> #include <uapi/linux/poll.h> +#include <uapi/linux/eventpoll.h> extern struct ctl_table epoll_table[]; /* for sysctl */ /* ~832 bytes of stack space used max in sys_select/sys_poll before allocating @@ -22,7 +23,7 @@ extern struct ctl_table epoll_table[]; /* for sysctl */ #define WQUEUES_STACK_ALLOC (MAX_STACK_ALLOC - FRONTEND_STACK_ALLOC) #define N_INLINE_POLL_ENTRIES (WQUEUES_STACK_ALLOC / sizeof(struct poll_table_entry)) -#define DEFAULT_POLLMASK (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM) +#define DEFAULT_POLLMASK (EPOLLIN | EPOLLOUT | EPOLLRDNORM | EPOLLWRNORM) struct poll_table_struct; diff --git a/include/uapi/linux/eventpoll.h b/include/uapi/linux/eventpoll.h index 63e21be30f15..bf48e71f2634 100644 --- a/include/uapi/linux/eventpoll.h +++ b/include/uapi/linux/eventpoll.h @@ -28,20 +28,21 @@ #define EPOLL_CTL_MOD 3 /* Epoll event masks */ -#define EPOLLIN 0x00000001 -#define EPOLLPRI 0x00000002 -#define EPOLLOUT 0x00000004 -#define EPOLLERR 0x00000008 -#define EPOLLHUP 0x00000010 -#define EPOLLRDNORM 0x00000040 -#define EPOLLRDBAND 0x00000080 -#define EPOLLWRNORM 0x00000100 -#define EPOLLWRBAND 0x00000200 -#define EPOLLMSG 0x00000400 -#define EPOLLRDHUP 0x00002000 +#define EPOLLIN (__force __poll_t)0x00000001 +#define EPOLLPRI (__force __poll_t)0x00000002 +#define EPOLLOUT (__force __poll_t)0x00000004 +#define EPOLLERR (__force __poll_t)0x00000008 +#define EPOLLHUP (__force __poll_t)0x00000010 +#define EPOLLNVAL (__force __poll_t)0x00000020 +#define EPOLLRDNORM (__force __poll_t)0x00000040 +#define EPOLLRDBAND (__force __poll_t)0x00000080 +#define EPOLLWRNORM (__force __poll_t)0x00000100 +#define EPOLLWRBAND (__force __poll_t)0x00000200 +#define EPOLLMSG (__force __poll_t)0x00000400 +#define EPOLLRDHUP (__force __poll_t)0x00002000 /* Set exclusive wakeup mode for the target file descriptor */ -#define EPOLLEXCLUSIVE (1U << 28) +#define EPOLLEXCLUSIVE (__force __poll_t)(1U << 28) /* * Request the handling of system wakeup events so as to prevent system suspends @@ -53,13 +54,13 @@ * * Requires CAP_BLOCK_SUSPEND */ -#define EPOLLWAKEUP (1U << 29) +#define EPOLLWAKEUP (__force __poll_t)(1U << 29) /* Set the One Shot behaviour for the target file descriptor */ -#define EPOLLONESHOT (1U << 30) +#define EPOLLONESHOT (__force __poll_t)(1U << 30) /* Set the Edge Triggered behaviour for the target file descriptor */ -#define EPOLLET (1U << 31) +#define EPOLLET (__force __poll_t)(1U << 31) /* * On x86-64 make the 64bit structure have the same alignment as the @@ -74,7 +75,7 @@ #endif struct epoll_event { - __u32 events; + __poll_t events; __u64 data; } EPOLL_PACKED; |