Commit 9e1c7238 authored by Trond Myklebust's avatar Trond Myklebust Committed by Linus Torvalds

[PATCH] Fix compile warnings...

xprt.c:
  Merge *_write_space() in order to fix compile warning and save space.

Cheers,
  Trond
parent 278237c4
...@@ -944,7 +944,7 @@ tcp_state_change(struct sock *sk) ...@@ -944,7 +944,7 @@ tcp_state_change(struct sock *sk)
* low. * low.
*/ */
static void static void
tcp_write_space(struct sock *sk) xprt_write_space(struct sock *sk)
{ {
struct rpc_xprt *xprt; struct rpc_xprt *xprt;
struct socket *sock; struct socket *sock;
...@@ -973,31 +973,6 @@ tcp_write_space(struct sock *sk) ...@@ -973,31 +973,6 @@ tcp_write_space(struct sock *sk)
} }
} }
static void
udp_write_space(struct sock *sk)
{
struct rpc_xprt *xprt;
if (!(xprt = xprt_from_sock(sk)))
return;
if (xprt->shutdown)
return;
/* Wait until we have enough socket memory. */
if (!sock_writeable(sk))
return;
if (!xprt_test_and_set_wspace(xprt)) {
spin_lock(&xprt->sock_lock);
if (xprt->snd_task && xprt->snd_task->tk_rpcwait == &xprt->sending)
rpc_wake_up_task(xprt->snd_task);
spin_unlock(&xprt->sock_lock);
}
if (sk->sleep && waitqueue_active(sk->sleep))
wake_up_interruptible(sk->sleep);
}
/* /*
* RPC receive timeout handler. * RPC receive timeout handler.
*/ */
...@@ -1414,15 +1389,14 @@ xprt_bind_socket(struct rpc_xprt *xprt, struct socket *sock) ...@@ -1414,15 +1389,14 @@ xprt_bind_socket(struct rpc_xprt *xprt, struct socket *sock)
xprt->old_write_space = sk->write_space; xprt->old_write_space = sk->write_space;
if (xprt->prot == IPPROTO_UDP) { if (xprt->prot == IPPROTO_UDP) {
sk->data_ready = udp_data_ready; sk->data_ready = udp_data_ready;
sk->write_space = udp_write_space;
sk->no_check = UDP_CSUM_NORCV; sk->no_check = UDP_CSUM_NORCV;
xprt_set_connected(xprt); xprt_set_connected(xprt);
} else { } else {
sk->data_ready = tcp_data_ready; sk->data_ready = tcp_data_ready;
sk->state_change = tcp_state_change; sk->state_change = tcp_state_change;
sk->write_space = tcp_write_space;
xprt_clear_connected(xprt); xprt_clear_connected(xprt);
} }
sk->write_space = xprt_write_space;
/* Reset to new socket */ /* Reset to new socket */
xprt->sock = sock; xprt->sock = sock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment