diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2018-09-14 17:45:23 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2018-09-30 15:35:16 -0400 |
commit | 4f546149755b4dec431bec236a9116a74384c7a7 (patch) | |
tree | 6f355d0e8a1014d9847ea1c32d829dfb628a3214 /net | |
parent | 550aebfe1c573518c35ae85d6ffbdc2d44c92703 (diff) | |
download | op-kernel-dev-4f546149755b4dec431bec236a9116a74384c7a7.zip op-kernel-dev-4f546149755b4dec431bec236a9116a74384c7a7.tar.gz |
SUNRPC: Clean up xs_udp_data_receive()
Simplify the retry logic.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/xprtsock.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 90d4c92..039444e 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -1344,25 +1344,18 @@ static void xs_udp_data_receive(struct sock_xprt *transport) struct sock *sk; int err; -restart: mutex_lock(&transport->recv_mutex); sk = transport->inet; if (sk == NULL) goto out; + clear_bit(XPRT_SOCK_DATA_READY, &transport->sock_state); for (;;) { skb = skb_recv_udp(sk, 0, 1, &err); - 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)) + if (skb == NULL) break; - if (need_resched()) { - mutex_unlock(&transport->recv_mutex); - cond_resched(); - goto restart; - } + xs_udp_data_read_skb(&transport->xprt, sk, skb); + consume_skb(skb); + cond_resched(); } out: mutex_unlock(&transport->recv_mutex); |