diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-06-24 16:55:49 +0200 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2016-07-13 21:53:46 +0200 |
commit | 4720b0703a0dfcd6da6a308ea71aaacc55beade7 (patch) | |
tree | ba3ee87fa167e1678b47efccee59a21f42852395 /net/sunrpc/svcsock.c | |
parent | SUNRPC: Call the default socket callbacks instead of open coding (diff) | |
download | linux-4720b0703a0dfcd6da6a308ea71aaacc55beade7.tar.xz linux-4720b0703a0dfcd6da6a308ea71aaacc55beade7.zip |
SUNRPC: Micro optimisation for svc_data_ready
Don't call svc_xprt_enqueue() if the XPT_DATA flag is already set.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r-- | net/sunrpc/svcsock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 03134708deeb..338d6fe1103d 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -409,8 +409,8 @@ static void svc_data_ready(struct sock *sk) svsk, sk, test_bit(XPT_BUSY, &svsk->sk_xprt.xpt_flags)); svsk->sk_odata(sk); - set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); - svc_xprt_enqueue(&svsk->sk_xprt); + if (!test_and_set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags)) + svc_xprt_enqueue(&svsk->sk_xprt); } } |