diff options
author | Florian Westphal <fw@strlen.de> | 2016-08-11 09:17:56 -0400 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2016-08-12 02:07:12 -0400 |
commit | a7c44247f704e385c77579d65c6ee6d002832529 (patch) | |
tree | 8937a83226c46ffe7ace1a3817d76b943b1f3c6b /net/xfrm | |
parent | e37cc8ade5afaf082f804c6d18eb23377146bec4 (diff) |
xfrm: policy: make xfrm_policy_lookup_bytype lockless
side effect: no longer disables BH (should be fine).
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 09f2e2b38246..9302647f20a0 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -1123,7 +1123,7 @@ static struct xfrm_policy *xfrm_policy_lookup_bytype(struct net *net, u8 type, | |||
1123 | if (unlikely(!daddr || !saddr)) | 1123 | if (unlikely(!daddr || !saddr)) |
1124 | return NULL; | 1124 | return NULL; |
1125 | 1125 | ||
1126 | read_lock_bh(&net->xfrm.xfrm_policy_lock); | 1126 | rcu_read_lock(); |
1127 | retry: | 1127 | retry: |
1128 | do { | 1128 | do { |
1129 | sequence = read_seqcount_begin(&xfrm_policy_hash_generation); | 1129 | sequence = read_seqcount_begin(&xfrm_policy_hash_generation); |
@@ -1172,7 +1172,7 @@ static struct xfrm_policy *xfrm_policy_lookup_bytype(struct net *net, u8 type, | |||
1172 | if (ret && !xfrm_pol_hold_rcu(ret)) | 1172 | if (ret && !xfrm_pol_hold_rcu(ret)) |
1173 | goto retry; | 1173 | goto retry; |
1174 | fail: | 1174 | fail: |
1175 | read_unlock_bh(&net->xfrm.xfrm_policy_lock); | 1175 | rcu_read_unlock(); |
1176 | 1176 | ||
1177 | return ret; | 1177 | return ret; |
1178 | } | 1178 | } |