mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
net: Move free of dst_metrics to helper
Move the refcounting and potential free of dst metrics associated for ipv4 and ipv6 to a common helper. Signed-off-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
e1255ed4b6
commit
1620a33695
3 changed files with 11 additions and 8 deletions
|
|
@ -441,6 +441,15 @@ void ip_dst_init_metrics(struct dst_entry *dst, struct dst_metrics *fib_metrics)
|
|||
}
|
||||
}
|
||||
|
||||
static inline
|
||||
void ip_dst_metrics_put(struct dst_entry *dst)
|
||||
{
|
||||
struct dst_metrics *p = (struct dst_metrics *)DST_METRICS_PTR(dst);
|
||||
|
||||
if (p != &dst_default_metrics && refcount_dec_and_test(&p->refcnt))
|
||||
kfree(p);
|
||||
}
|
||||
|
||||
u32 ip_idents_reserve(u32 hash, int segs);
|
||||
void __ip_select_ident(struct net *net, struct iphdr *iph, int segs);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue