Commit 4f546149 authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Clean up xs_udp_data_receive()

Simplify the retry logic.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 550aebfe
...@@ -1344,25 +1344,18 @@ static void xs_udp_data_receive(struct sock_xprt *transport) ...@@ -1344,25 +1344,18 @@ static void xs_udp_data_receive(struct sock_xprt *transport)
struct sock *sk; struct sock *sk;
int err; int err;
restart:
mutex_lock(&transport->recv_mutex); mutex_lock(&transport->recv_mutex);
sk = transport->inet; sk = transport->inet;
if (sk == NULL) if (sk == NULL)
goto out; goto out;
clear_bit(XPRT_SOCK_DATA_READY, &transport->sock_state);
for (;;) { for (;;) {
skb = skb_recv_udp(sk, 0, 1, &err); skb = skb_recv_udp(sk, 0, 1, &err);
if (skb != NULL) { if (skb == NULL)
xs_udp_data_read_skb(&transport->xprt, sk, skb);
consume_skb(skb);
continue;
}
if (!test_and_clear_bit(XPRT_SOCK_DATA_READY, &transport->sock_state))
break; break;
if (need_resched()) { xs_udp_data_read_skb(&transport->xprt, sk, skb);
mutex_unlock(&transport->recv_mutex); consume_skb(skb);
cond_resched(); cond_resched();
goto restart;
}
} }
out: out:
mutex_unlock(&transport->recv_mutex); mutex_unlock(&transport->recv_mutex);
......
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