Merge branch 'work.aio-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull aio updates from Al Viro: "Majority of AIO stuff this cycle. aio-fsync and aio-poll, mostly. The only thing I'm holding back for a day or so is Adam's aio ioprio - his last-minute fixup is trivial (missing stub in !CONFIG_BLOCK case), but let it sit in -next for decency sake..." * 'work.aio-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits) aio: sanitize the limit checking in io_submit(2) aio: fold do_io_submit() into callers aio: shift copyin of iocb into io_submit_one() aio_read_events_ring(): make a bit more readable aio: all callers of aio_{read,write,fsync,poll} treat 0 and -EIOCBQUEUED the same way aio: take list removal to (some) callers of aio_complete() aio: add missing break for the IOCB_CMD_FDSYNC case random: convert to ->poll_mask timerfd: convert to ->poll_mask eventfd: switch to ->poll_mask pipe: convert to ->poll_mask crypto: af_alg: convert to ->poll_mask net/rxrpc: convert to ->poll_mask net/iucv: convert to ->poll_mask net/phonet: convert to ->poll_mask net/nfc: convert to ->poll_mask net/caif: convert to ->poll_mask net/bluetooth: convert to ->poll_mask net/sctp: convert to ->poll_mask net/tipc: convert to ->poll_mask ...
This commit is contained in:
@@ -494,32 +494,21 @@ static inline bool tcp_stream_is_readable(const struct tcp_sock *tp,
|
||||
}
|
||||
|
||||
/*
|
||||
* Wait for a TCP event.
|
||||
*
|
||||
* Note that we don't need to lock the socket, as the upper poll layers
|
||||
* take care of normal races (between the test and the event) and we don't
|
||||
* go look at any of the socket buffers directly.
|
||||
* Socket is not locked. We are protected from async events by poll logic and
|
||||
* correct handling of state changes made by other threads is impossible in
|
||||
* any case.
|
||||
*/
|
||||
__poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
|
||||
__poll_t tcp_poll_mask(struct socket *sock, __poll_t events)
|
||||
{
|
||||
__poll_t mask;
|
||||
struct sock *sk = sock->sk;
|
||||
const struct tcp_sock *tp = tcp_sk(sk);
|
||||
__poll_t mask = 0;
|
||||
int state;
|
||||
|
||||
sock_poll_wait(file, sk_sleep(sk), wait);
|
||||
|
||||
state = inet_sk_state_load(sk);
|
||||
if (state == TCP_LISTEN)
|
||||
return inet_csk_listen_poll(sk);
|
||||
|
||||
/* Socket is not locked. We are protected from async events
|
||||
* by poll logic and correct handling of state changes
|
||||
* made by other threads is impossible in any case.
|
||||
*/
|
||||
|
||||
mask = 0;
|
||||
|
||||
/*
|
||||
* EPOLLHUP is certainly not done right. But poll() doesn't
|
||||
* have a notion of HUP in just one direction, and for a
|
||||
@@ -600,7 +589,7 @@ __poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
|
||||
|
||||
return mask;
|
||||
}
|
||||
EXPORT_SYMBOL(tcp_poll);
|
||||
EXPORT_SYMBOL(tcp_poll_mask);
|
||||
|
||||
int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg)
|
||||
{
|
||||
|
Reference in New Issue
Block a user