Skip to content

Commit e76cd24

Browse files
author
Christoph Hellwig
committed
net/unix: convert to ->poll_mask
Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 2c7d3da commit e76cd24

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

net/unix/af_unix.c

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,8 @@ static int unix_stream_connect(struct socket *, struct sockaddr *,
638638
static int unix_socketpair(struct socket *, struct socket *);
639639
static int unix_accept(struct socket *, struct socket *, int, bool);
640640
static int unix_getname(struct socket *, struct sockaddr *, int);
641-
static __poll_t unix_poll(struct file *, struct socket *, poll_table *);
642-
static __poll_t unix_dgram_poll(struct file *, struct socket *,
643-
poll_table *);
641+
static __poll_t unix_poll_mask(struct socket *, __poll_t);
642+
static __poll_t unix_dgram_poll_mask(struct socket *, __poll_t);
644643
static int unix_ioctl(struct socket *, unsigned int, unsigned long);
645644
static int unix_shutdown(struct socket *, int);
646645
static int unix_stream_sendmsg(struct socket *, struct msghdr *, size_t);
@@ -681,7 +680,7 @@ static const struct proto_ops unix_stream_ops = {
681680
.socketpair = unix_socketpair,
682681
.accept = unix_accept,
683682
.getname = unix_getname,
684-
.poll = unix_poll,
683+
.poll_mask = unix_poll_mask,
685684
.ioctl = unix_ioctl,
686685
.listen = unix_listen,
687686
.shutdown = unix_shutdown,
@@ -704,7 +703,7 @@ static const struct proto_ops unix_dgram_ops = {
704703
.socketpair = unix_socketpair,
705704
.accept = sock_no_accept,
706705
.getname = unix_getname,
707-
.poll = unix_dgram_poll,
706+
.poll_mask = unix_dgram_poll_mask,
708707
.ioctl = unix_ioctl,
709708
.listen = sock_no_listen,
710709
.shutdown = unix_shutdown,
@@ -726,7 +725,7 @@ static const struct proto_ops unix_seqpacket_ops = {
726725
.socketpair = unix_socketpair,
727726
.accept = unix_accept,
728727
.getname = unix_getname,
729-
.poll = unix_dgram_poll,
728+
.poll_mask = unix_dgram_poll_mask,
730729
.ioctl = unix_ioctl,
731730
.listen = unix_listen,
732731
.shutdown = unix_shutdown,
@@ -2630,13 +2629,10 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
26302629
return err;
26312630
}
26322631

2633-
static __poll_t unix_poll(struct file *file, struct socket *sock, poll_table *wait)
2632+
static __poll_t unix_poll_mask(struct socket *sock, __poll_t events)
26342633
{
26352634
struct sock *sk = sock->sk;
2636-
__poll_t mask;
2637-
2638-
sock_poll_wait(file, sk_sleep(sk), wait);
2639-
mask = 0;
2635+
__poll_t mask = 0;
26402636

26412637
/* exceptional events? */
26422638
if (sk->sk_err)
@@ -2665,15 +2661,11 @@ static __poll_t unix_poll(struct file *file, struct socket *sock, poll_table *wa
26652661
return mask;
26662662
}
26672663

2668-
static __poll_t unix_dgram_poll(struct file *file, struct socket *sock,
2669-
poll_table *wait)
2664+
static __poll_t unix_dgram_poll_mask(struct socket *sock, __poll_t events)
26702665
{
26712666
struct sock *sk = sock->sk, *other;
2672-
unsigned int writable;
2673-
__poll_t mask;
2674-
2675-
sock_poll_wait(file, sk_sleep(sk), wait);
2676-
mask = 0;
2667+
int writable;
2668+
__poll_t mask = 0;
26772669

26782670
/* exceptional events? */
26792671
if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
@@ -2699,7 +2691,7 @@ static __poll_t unix_dgram_poll(struct file *file, struct socket *sock,
26992691
}
27002692

27012693
/* No write status requested, avoid expensive OUT tests. */
2702-
if (!(poll_requested_events(wait) & (EPOLLWRBAND|EPOLLWRNORM|EPOLLOUT)))
2694+
if (!(events & (EPOLLWRBAND|EPOLLWRNORM|EPOLLOUT)))
27032695
return mask;
27042696

27052697
writable = unix_writable(sk);

0 commit comments

Comments
 (0)