aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/socket.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-11 17:34:03 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-11 17:34:03 -0500
commita9a08845e9acbd224e4ee466f5c1275ed50054e8 (patch)
tree415d6e6a82e001c65e6b161539411f54ba5fe8ce /net/tipc/socket.c
parentee5daa1361fceb6f482c005bcc9ba8d01b92ea5c (diff)
vfs: do bulk POLL* -> EPOLL* replacement
This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: 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 with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r--net/tipc/socket.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 163f3a547501..b0323ec7971e 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -721,31 +721,31 @@ static __poll_t tipc_poll(struct file *file, struct socket *sock,
721 sock_poll_wait(file, sk_sleep(sk), wait); 721 sock_poll_wait(file, sk_sleep(sk), wait);
722 722
723 if (sk->sk_shutdown & RCV_SHUTDOWN) 723 if (sk->sk_shutdown & RCV_SHUTDOWN)
724 revents |= POLLRDHUP | POLLIN | POLLRDNORM; 724 revents |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM;
725 if (sk->sk_shutdown == SHUTDOWN_MASK) 725 if (sk->sk_shutdown == SHUTDOWN_MASK)
726 revents |= POLLHUP; 726 revents |= EPOLLHUP;
727 727
728 switch (sk->sk_state) { 728 switch (sk->sk_state) {
729 case TIPC_ESTABLISHED: 729 case TIPC_ESTABLISHED:
730 case TIPC_CONNECTING: 730 case TIPC_CONNECTING:
731 if (!tsk->cong_link_cnt && !tsk_conn_cong(tsk)) 731 if (!tsk->cong_link_cnt && !tsk_conn_cong(tsk))
732 revents |= POLLOUT; 732 revents |= EPOLLOUT;
733 /* fall thru' */ 733 /* fall thru' */
734 case TIPC_LISTEN: 734 case TIPC_LISTEN:
735 if (!skb_queue_empty(&sk->sk_receive_queue)) 735 if (!skb_queue_empty(&sk->sk_receive_queue))
736 revents |= POLLIN | POLLRDNORM; 736 revents |= EPOLLIN | EPOLLRDNORM;
737 break; 737 break;
738 case TIPC_OPEN: 738 case TIPC_OPEN:
739 if (tsk->group_is_open && !tsk->cong_link_cnt) 739 if (tsk->group_is_open && !tsk->cong_link_cnt)
740 revents |= POLLOUT; 740 revents |= EPOLLOUT;
741 if (!tipc_sk_type_connectionless(sk)) 741 if (!tipc_sk_type_connectionless(sk))
742 break; 742 break;
743 if (skb_queue_empty(&sk->sk_receive_queue)) 743 if (skb_queue_empty(&sk->sk_receive_queue))
744 break; 744 break;
745 revents |= POLLIN | POLLRDNORM; 745 revents |= EPOLLIN | EPOLLRDNORM;
746 break; 746 break;
747 case TIPC_DISCONNECTING: 747 case TIPC_DISCONNECTING:
748 revents = POLLIN | POLLRDNORM | POLLHUP; 748 revents = EPOLLIN | EPOLLRDNORM | EPOLLHUP;
749 break; 749 break;
750 } 750 }
751 return revents; 751 return revents;
@@ -1897,8 +1897,8 @@ static void tipc_write_space(struct sock *sk)
1897 rcu_read_lock(); 1897 rcu_read_lock();
1898 wq = rcu_dereference(sk->sk_wq); 1898 wq = rcu_dereference(sk->sk_wq);
1899 if (skwq_has_sleeper(wq)) 1899 if (skwq_has_sleeper(wq))
1900 wake_up_interruptible_sync_poll(&wq->wait, POLLOUT | 1900 wake_up_interruptible_sync_poll(&wq->wait, EPOLLOUT |
1901 POLLWRNORM | POLLWRBAND); 1901 EPOLLWRNORM | EPOLLWRBAND);
1902 rcu_read_unlock(); 1902 rcu_read_unlock();
1903} 1903}
1904 1904
@@ -1914,8 +1914,8 @@ static void tipc_data_ready(struct sock *sk)
1914 rcu_read_lock(); 1914 rcu_read_lock();
1915 wq = rcu_dereference(sk->sk_wq); 1915 wq = rcu_dereference(sk->sk_wq);
1916 if (skwq_has_sleeper(wq)) 1916 if (skwq_has_sleeper(wq))
1917 wake_up_interruptible_sync_poll(&wq->wait, POLLIN | 1917 wake_up_interruptible_sync_poll(&wq->wait, EPOLLIN |
1918 POLLRDNORM | POLLRDBAND); 1918 EPOLLRDNORM | EPOLLRDBAND);
1919 rcu_read_unlock(); 1919 rcu_read_unlock();
1920} 1920}
1921 1921