Commit 86fe8f89 authored by Duan Jiong's avatar Duan Jiong Committed by David S. Miller

ipv6: remove useless spin_lock/spin_unlock

xchg is atomic, so there is no necessary to use spin_lock/spin_unlock
to protect it. At last, remove the redundant
opt = xchg(&inet6_sk(sk)->opt, opt); statement.
Signed-off-by: default avatarDuan Jiong <duanj.fnst@cn.fujitsu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 54ceb9ec
...@@ -110,12 +110,8 @@ struct ipv6_txoptions *ipv6_update_options(struct sock *sk, ...@@ -110,12 +110,8 @@ struct ipv6_txoptions *ipv6_update_options(struct sock *sk,
icsk->icsk_ext_hdr_len = opt->opt_flen + opt->opt_nflen; icsk->icsk_ext_hdr_len = opt->opt_flen + opt->opt_nflen;
icsk->icsk_sync_mss(sk, icsk->icsk_pmtu_cookie); icsk->icsk_sync_mss(sk, icsk->icsk_pmtu_cookie);
} }
opt = xchg(&inet6_sk(sk)->opt, opt);
} else {
spin_lock(&sk->sk_dst_lock);
opt = xchg(&inet6_sk(sk)->opt, opt);
spin_unlock(&sk->sk_dst_lock);
} }
opt = xchg(&inet6_sk(sk)->opt, opt);
sk_dst_reset(sk); sk_dst_reset(sk);
return opt; return opt;
......
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