Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134318
b: refs/heads/master
c: 1f0fa15
h: refs/heads/master
v: v3
  • Loading branch information
Ilpo Järvinen authored and David S. Miller committed Feb 7, 2009
1 parent 63991dd commit aa49ab9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b5f348e5a41b39543c1c5efd661d7fd296dd5281
refs/heads/master: 1f0fa15432e49547c3fa915644c7e0c0975809e7
53 changes: 21 additions & 32 deletions trunk/net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,23 @@ static void xs_tcp_error_report(struct sock *sk)
read_unlock(&sk->sk_callback_lock);
}

static void xs_write_space(struct sock *sk)
{
struct socket *sock;
struct rpc_xprt *xprt;

if (unlikely(!(sock = sk->sk_socket)))
return;
clear_bit(SOCK_NOSPACE, &sock->flags);

if (unlikely(!(xprt = xprt_from_sock(sk))))
return;
if (test_and_clear_bit(SOCK_ASYNC_NOSPACE, &sock->flags) == 0)
return;

xprt_write_space(xprt);
}

/**
* xs_udp_write_space - callback invoked when socket buffer space
* becomes available
Expand All @@ -1230,23 +1247,9 @@ static void xs_udp_write_space(struct sock *sk)
read_lock(&sk->sk_callback_lock);

/* from net/core/sock.c:sock_def_write_space */
if (sock_writeable(sk)) {
struct socket *sock;
struct rpc_xprt *xprt;

if (unlikely(!(sock = sk->sk_socket)))
goto out;
clear_bit(SOCK_NOSPACE, &sock->flags);

if (unlikely(!(xprt = xprt_from_sock(sk))))
goto out;
if (test_and_clear_bit(SOCK_ASYNC_NOSPACE, &sock->flags) == 0)
goto out;

xprt_write_space(xprt);
}
if (sock_writeable(sk))
xs_write_space(sk);

out:
read_unlock(&sk->sk_callback_lock);
}

Expand All @@ -1265,23 +1268,9 @@ static void xs_tcp_write_space(struct sock *sk)
read_lock(&sk->sk_callback_lock);

/* from net/core/stream.c:sk_stream_write_space */
if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk)) {
struct socket *sock;
struct rpc_xprt *xprt;

if (unlikely(!(sock = sk->sk_socket)))
goto out;
clear_bit(SOCK_NOSPACE, &sock->flags);
if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk))
xs_write_space(sk);

if (unlikely(!(xprt = xprt_from_sock(sk))))
goto out;
if (test_and_clear_bit(SOCK_ASYNC_NOSPACE, &sock->flags) == 0)
goto out;

xprt_write_space(xprt);
}

out:
read_unlock(&sk->sk_callback_lock);
}

Expand Down

0 comments on commit aa49ab9

Please sign in to comment.