mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
net: remove DST_NOCACHE flag
DST_NOCACHE flag check has been removed from dst_release() and dst_hold_safe() in a previous patch because all the dst are now ref counted properly and can be released based on refcnt only. Looking at the rest of the DST_NOCACHE use, all of them can now be removed or replaced with other checks. So this patch gets rid of all the DST_NOCACHE usage and remove this flag completely. Signed-off-by: Wei Wang <[email protected]> Acked-by: Martin KaFai Lau <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
b2a9c0ed75
commit
a4c2fd7f78
8 changed files with 17 additions and 25 deletions
|
|
@ -975,8 +975,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
|
|||
int replace_required = 0;
|
||||
int sernum = fib6_new_sernum(info->nl_net);
|
||||
|
||||
if (WARN_ON_ONCE((rt->dst.flags & DST_NOCACHE) &&
|
||||
!atomic_read(&rt->dst.__refcnt)))
|
||||
if (WARN_ON_ONCE(!atomic_read(&rt->dst.__refcnt)))
|
||||
return -EINVAL;
|
||||
|
||||
if (info->nlh) {
|
||||
|
|
@ -1073,7 +1072,6 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
|
|||
fib6_start_gc(info->nl_net, rt);
|
||||
if (!(rt->rt6i_flags & RTF_CACHE))
|
||||
fib6_prune_clones(info->nl_net, pn);
|
||||
rt->dst.flags &= ~DST_NOCACHE;
|
||||
}
|
||||
|
||||
out:
|
||||
|
|
|
|||
|
|
@ -128,7 +128,6 @@ static void rt6_uncached_list_add(struct rt6_info *rt)
|
|||
{
|
||||
struct uncached_list *ul = raw_cpu_ptr(&rt6_uncached_list);
|
||||
|
||||
rt->dst.flags |= DST_NOCACHE;
|
||||
rt->rt6i_uncached_list = ul;
|
||||
|
||||
spin_lock_bh(&ul->lock);
|
||||
|
|
@ -1326,7 +1325,7 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie)
|
|||
rt6_dst_from_metrics_check(rt);
|
||||
|
||||
if (rt->rt6i_flags & RTF_PCPU ||
|
||||
(unlikely(dst->flags & DST_NOCACHE) && rt->dst.from))
|
||||
(unlikely(!list_empty(&rt->rt6i_uncached)) && rt->dst.from))
|
||||
return rt6_dst_from_check(rt, cookie);
|
||||
else
|
||||
return rt6_check(rt, cookie);
|
||||
|
|
@ -2130,8 +2129,7 @@ static int __ip6_del_rt(struct rt6_info *rt, struct nl_info *info)
|
|||
struct fib6_table *table;
|
||||
struct net *net = dev_net(rt->dst.dev);
|
||||
|
||||
if (rt == net->ipv6.ip6_null_entry ||
|
||||
rt->dst.flags & DST_NOCACHE) {
|
||||
if (rt == net->ipv6.ip6_null_entry) {
|
||||
err = -ENOENT;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -2722,7 +2720,6 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
|
|||
rt->rt6i_dst.plen = 128;
|
||||
tb_id = l3mdev_fib_table(idev->dev) ? : RT6_TABLE_LOCAL;
|
||||
rt->rt6i_table = fib6_get_table(net, tb_id);
|
||||
rt->dst.flags |= DST_NOCACHE;
|
||||
|
||||
return rt;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue