aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_output.c
diff options
context:
space:
mode:
authorAmerigo Wang <amwang@redhat.com>2012-09-09 22:48:44 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-10 16:31:18 -0400
commitfdd6681d92a70b3db73cdb61c6b4053f2f8003b3 (patch)
tree15a050d4fd0ffd4082fefcd9d2ad454b0c06218f /net/ipv6/ip6_output.c
parent6d57e9078e880a3dd232d579f42ac437a8f1ef7b (diff)
ipv6: remove some useless RCU read lock
After this commit: commit 97cac0821af4474ec4ba3a9e7a36b98ed9b6db88 Author: David S. Miller <davem@davemloft.net> Date: Mon Jul 2 22:43:47 2012 -0700 ipv6: Store route neighbour in rt6_info struct. we no longer use RCU to protect route neighbour. Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r--net/ipv6/ip6_output.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index a4f6263fddca..3dd4a37488d5 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -123,16 +123,11 @@ static int ip6_finish_output2(struct sk_buff *skb)
123 skb->len); 123 skb->len);
124 } 124 }
125 125
126 rcu_read_lock();
127 rt = (struct rt6_info *) dst; 126 rt = (struct rt6_info *) dst;
128 neigh = rt->n; 127 neigh = rt->n;
129 if (neigh) { 128 if (neigh)
130 int res = dst_neigh_output(dst, neigh, skb); 129 return dst_neigh_output(dst, neigh, skb);
131 130
132 rcu_read_unlock();
133 return res;
134 }
135 rcu_read_unlock();
136 IP6_INC_STATS_BH(dev_net(dst->dev), 131 IP6_INC_STATS_BH(dev_net(dst->dev),
137 ip6_dst_idev(dst), IPSTATS_MIB_OUTNOROUTES); 132 ip6_dst_idev(dst), IPSTATS_MIB_OUTNOROUTES);
138 kfree_skb(skb); 133 kfree_skb(skb);
@@ -983,7 +978,6 @@ static int ip6_dst_lookup_tail(struct sock *sk,
983 * dst entry and replace it instead with the 978 * dst entry and replace it instead with the
984 * dst entry of the nexthop router 979 * dst entry of the nexthop router
985 */ 980 */
986 rcu_read_lock();
987 rt = (struct rt6_info *) *dst; 981 rt = (struct rt6_info *) *dst;
988 n = rt->n; 982 n = rt->n;
989 if (n && !(n->nud_state & NUD_VALID)) { 983 if (n && !(n->nud_state & NUD_VALID)) {
@@ -991,7 +985,6 @@ static int ip6_dst_lookup_tail(struct sock *sk,
991 struct flowi6 fl_gw6; 985 struct flowi6 fl_gw6;
992 int redirect; 986 int redirect;
993 987
994 rcu_read_unlock();
995 ifp = ipv6_get_ifaddr(net, &fl6->saddr, 988 ifp = ipv6_get_ifaddr(net, &fl6->saddr,
996 (*dst)->dev, 1); 989 (*dst)->dev, 1);
997 990
@@ -1011,8 +1004,6 @@ static int ip6_dst_lookup_tail(struct sock *sk,
1011 if ((err = (*dst)->error)) 1004 if ((err = (*dst)->error))
1012 goto out_err_release; 1005 goto out_err_release;
1013 } 1006 }
1014 } else {
1015 rcu_read_unlock();
1016 } 1007 }
1017#endif 1008#endif
1018 1009