Commit 19e8c107 authored by James Morris's avatar James Morris Committed by David S. Miller

[NET]: dst_clone --> dst_hold where appropriate.

parent f54cf50e
......@@ -930,7 +930,7 @@ void ip_rt_redirect(u32 old_gw, u32 daddr, u32 new_gw,
rth->u.dst.dev != dev)
break;
dst_clone(&rth->u.dst);
dst_hold(&rth->u.dst);
rcu_read_unlock();
rt = dst_alloc(&ipv4_dst_ops);
......
......@@ -550,7 +550,7 @@ int ip6_build_xmit(struct sock *sk, inet_getfrag_t getfrag, const void *data,
|| (fl->oif && fl->oif != dst->dev->ifindex)) {
dst = NULL;
} else
dst_clone(dst);
dst_hold(dst);
}
if (dst == NULL)
......
......@@ -356,7 +356,7 @@ static struct rt6_info *rt6_cow(struct rt6_info *ort, struct in6_addr *daddr,
rt->rt6i_nexthop = ndisc_get_neigh(rt->rt6i_dev, &rt->rt6i_gateway);
dst_clone(&rt->u.dst);
dst_hold(&rt->u.dst);
err = rt6_ins(rt);
if (err == 0)
......@@ -366,7 +366,7 @@ static struct rt6_info *rt6_cow(struct rt6_info *ort, struct in6_addr *daddr,
return rt;
}
dst_clone(&ip6_null_entry.u.dst);
dst_hold(&ip6_null_entry.u.dst);
return &ip6_null_entry;
}
......@@ -374,7 +374,7 @@ static struct rt6_info *rt6_cow(struct rt6_info *ort, struct in6_addr *daddr,
if (rt == &ip6_null_entry && strict) { \
while ((fn = fn->parent) != NULL) { \
if (fn->fn_flags & RTN_ROOT) { \
dst_clone(&rt->u.dst); \
dst_hold(&rt->u.dst); \
goto out; \
} \
if (fn->fn_flags & RTN_RTINFO) \
......@@ -404,7 +404,7 @@ void ip6_route_input(struct sk_buff *skb)
if ((rt->rt6i_flags & RTF_CACHE)) {
rt = rt6_device_match(rt, skb->dev->ifindex, strict);
BACKTRACK();
dst_clone(&rt->u.dst);
dst_hold(&rt->u.dst);
goto out;
}
......@@ -424,7 +424,7 @@ void ip6_route_input(struct sk_buff *skb)
*/
goto relookup;
}
dst_clone(&rt->u.dst);
dst_hold(&rt->u.dst);
out:
read_unlock_bh(&rt6_lock);
......@@ -455,7 +455,7 @@ struct dst_entry * ip6_route_output(struct sock *sk, struct flowi *fl)
if ((rt->rt6i_flags & RTF_CACHE)) {
rt = rt6_device_match(rt, fl->oif, strict);
BACKTRACK();
dst_clone(&rt->u.dst);
dst_hold(&rt->u.dst);
goto out;
}
if (rt->rt6i_flags & RTF_DEFAULT) {
......@@ -480,7 +480,7 @@ struct dst_entry * ip6_route_output(struct sock *sk, struct flowi *fl)
*/
goto relookup;
}
dst_clone(&rt->u.dst);
dst_hold(&rt->u.dst);
out:
read_unlock_bh(&rt6_lock);
......@@ -815,7 +815,7 @@ static int ip6_route_del(struct in6_rtmsg *rtmsg)
if (rtmsg->rtmsg_metric &&
rtmsg->rtmsg_metric != rt->rt6i_metric)
continue;
dst_clone(&rt->u.dst);
dst_hold(&rt->u.dst);
read_unlock_bh(&rt6_lock);
return ip6_del_rt(rt);
......@@ -878,7 +878,7 @@ void rt6_redirect(struct in6_addr *dest, struct in6_addr *saddr,
read_lock(&rt6_lock);
for (rt1 = ip6_routing_table.leaf; rt1; rt1 = rt1->u.next) {
if (!ipv6_addr_cmp(saddr, &rt1->rt6i_gateway)) {
dst_clone(&rt1->u.dst);
dst_hold(&rt1->u.dst);
dst_release(&rt->u.dst);
read_unlock(&rt6_lock);
rt = rt1;
......@@ -1065,7 +1065,7 @@ struct rt6_info *rt6_get_dflt_router(struct in6_addr *addr, struct net_device *d
break;
}
if (rt)
dst_clone(&rt->u.dst);
dst_hold(&rt->u.dst);
write_unlock_bh(&rt6_lock);
return rt;
}
......
......@@ -800,7 +800,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
dst = ip6_route_output(sk, &fl);
} else
dst_clone(dst);
dst_hold(dst);
if (dst->error) {
sk->err_soft = -dst->error;
......
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