diff options
| author | Eric Dumazet <edumazet@google.com> | 2015-11-29 23:03:10 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-12-01 15:45:05 -0500 |
| commit | 9cd3e072b0be17446e37d7414eac8a3499e0601e (patch) | |
| tree | 83c6aac4a5164b4854a5d5d5deba1a513eee7157 /net/sunrpc | |
| parent | 5738a09d58d5ad2871f1f9a42bf6a3aa9ece5b3c (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/sunrpc')
| -rw-r--r-- | net/sunrpc/xprtsock.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 1d1a70498910..2ffaf6a79499 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
| @@ -398,7 +398,7 @@ static int xs_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen, | |||
| 398 | if (unlikely(!sock)) | 398 | if (unlikely(!sock)) |
| 399 | return -ENOTSOCK; | 399 | return -ENOTSOCK; |
| 400 | 400 | ||
| 401 | clear_bit(SOCK_ASYNC_NOSPACE, &sock->flags); | 401 | clear_bit(SOCKWQ_ASYNC_NOSPACE, &sock->flags); |
| 402 | if (base != 0) { | 402 | if (base != 0) { |
| 403 | addr = NULL; | 403 | addr = NULL; |
| 404 | addrlen = 0; | 404 | addrlen = 0; |
| @@ -442,7 +442,7 @@ static void xs_nospace_callback(struct rpc_task *task) | |||
| 442 | struct sock_xprt *transport = container_of(task->tk_rqstp->rq_xprt, struct sock_xprt, xprt); | 442 | struct sock_xprt *transport = container_of(task->tk_rqstp->rq_xprt, struct sock_xprt, xprt); |
| 443 | 443 | ||
| 444 | transport->inet->sk_write_pending--; | 444 | transport->inet->sk_write_pending--; |
| 445 | clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); | 445 | clear_bit(SOCKWQ_ASYNC_NOSPACE, &transport->sock->flags); |
| 446 | } | 446 | } |
| 447 | 447 | ||
| 448 | /** | 448 | /** |
| @@ -467,7 +467,7 @@ static int xs_nospace(struct rpc_task *task) | |||
| 467 | 467 | ||
| 468 | /* Don't race with disconnect */ | 468 | /* Don't race with disconnect */ |
| 469 | if (xprt_connected(xprt)) { | 469 | if (xprt_connected(xprt)) { |
| 470 | if (test_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags)) { | 470 | if (test_bit(SOCKWQ_ASYNC_NOSPACE, &transport->sock->flags)) { |
| 471 | /* | 471 | /* |
| 472 | * Notify TCP that we're limited by the application | 472 | * Notify TCP that we're limited by the application |
| 473 | * window size | 473 | * window size |
| @@ -478,7 +478,7 @@ static int xs_nospace(struct rpc_task *task) | |||
| 478 | xprt_wait_for_buffer_space(task, xs_nospace_callback); | 478 | xprt_wait_for_buffer_space(task, xs_nospace_callback); |
| 479 | } | 479 | } |
| 480 | } else { | 480 | } else { |
| 481 | clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); | 481 | clear_bit(SOCKWQ_ASYNC_NOSPACE, &transport->sock->flags); |
| 482 | ret = -ENOTCONN; | 482 | ret = -ENOTCONN; |
| 483 | } | 483 | } |
| 484 | 484 | ||
| @@ -626,7 +626,7 @@ process_status: | |||
| 626 | case -EPERM: | 626 | case -EPERM: |
| 627 | /* When the server has died, an ICMP port unreachable message | 627 | /* When the server has died, an ICMP port unreachable message |
| 628 | * prompts ECONNREFUSED. */ | 628 | * prompts ECONNREFUSED. */ |
| 629 | clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); | 629 | clear_bit(SOCKWQ_ASYNC_NOSPACE, &transport->sock->flags); |
| 630 | } | 630 | } |
| 631 | 631 | ||
| 632 | return status; | 632 | return status; |
| @@ -715,7 +715,7 @@ static int xs_tcp_send_request(struct rpc_task *task) | |||
| 715 | case -EADDRINUSE: | 715 | case -EADDRINUSE: |
| 716 | case -ENOBUFS: | 716 | case -ENOBUFS: |
| 717 | case -EPIPE: | 717 | case -EPIPE: |
| 718 | clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); | 718 | clear_bit(SOCKWQ_ASYNC_NOSPACE, &transport->sock->flags); |
| 719 | } | 719 | } |
| 720 | 720 | ||
| 721 | return status; | 721 | return status; |
| @@ -1618,7 +1618,7 @@ static void xs_write_space(struct sock *sk) | |||
| 1618 | 1618 | ||
| 1619 | if (unlikely(!(xprt = xprt_from_sock(sk)))) | 1619 | if (unlikely(!(xprt = xprt_from_sock(sk)))) |
| 1620 | return; | 1620 | return; |
| 1621 | if (test_and_clear_bit(SOCK_ASYNC_NOSPACE, &sock->flags) == 0) | 1621 | if (test_and_clear_bit(SOCKWQ_ASYNC_NOSPACE, &sock->flags) == 0) |
| 1622 | return; | 1622 | return; |
| 1623 | 1623 | ||
| 1624 | xprt_write_space(xprt); | 1624 | xprt_write_space(xprt); |
