aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-11-29 23:03:10 -0500
committerDavid S. Miller <davem@davemloft.net>2015-12-01 15:45:05 -0500
commit9cd3e072b0be17446e37d7414eac8a3499e0601e (patch)
tree83c6aac4a5164b4854a5d5d5deba1a513eee7157 /net/unix
parent5738a09d58d5ad2871f1f9a42bf6a3aa9ece5b3c (diff)
net: rename SOCK_ASYNC_NOSPACE and SOCK_ASYNC_WAITDATA
This patch is a cleanup to make following patch easier to review. Goal is to move SOCK_ASYNC_NOSPACE and SOCK_ASYNC_WAITDATA from (struct socket)->flags to a (struct socket_wq)->flags to benefit from RCU protection in sock_wake_async() To ease backports, we rename both constants. Two new helpers, sk_set_bit(int nr, struct sock *sk) and sk_clear_bit(int net, struct sock *sk) are added so that following patch can change their implementation. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/unix')
-rw-r--r--net/unix/af_unix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 6ced74690eee..45aebd966978 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2191,7 +2191,7 @@ static long unix_stream_data_wait(struct sock *sk, long timeo,
2191 !timeo) 2191 !timeo)
2192 break; 2192 break;
2193 2193
2194 set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags); 2194 sk_set_bit(SOCKWQ_ASYNC_WAITDATA, sk);
2195 unix_state_unlock(sk); 2195 unix_state_unlock(sk);
2196 timeo = freezable_schedule_timeout(timeo); 2196 timeo = freezable_schedule_timeout(timeo);
2197 unix_state_lock(sk); 2197 unix_state_lock(sk);
@@ -2199,7 +2199,7 @@ static long unix_stream_data_wait(struct sock *sk, long timeo,
2199 if (sock_flag(sk, SOCK_DEAD)) 2199 if (sock_flag(sk, SOCK_DEAD))
2200 break; 2200 break;
2201 2201
2202 clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags); 2202 sk_clear_bit(SOCKWQ_ASYNC_WAITDATA, sk);
2203 } 2203 }
2204 2204
2205 finish_wait(sk_sleep(sk), &wait); 2205 finish_wait(sk_sleep(sk), &wait);
@@ -2683,7 +2683,7 @@ static unsigned int unix_dgram_poll(struct file *file, struct socket *sock,
2683 if (writable) 2683 if (writable)
2684 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 2684 mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
2685 else 2685 else
2686 set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); 2686 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
2687 2687
2688 return mask; 2688 return mask;
2689} 2689}