mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
net: Embed hh_cache inside of struct neighbour.
Now that there is a one-to-one correspondance between neighbour and hh_cache entries, we no longer need: 1) dynamic allocation 2) attachment to dst->hh 3) refcounting Initialization of the hh_cache entry is indicated by hh_len being non-zero, and such initialization is always done with the neighbour's lock held as a writer. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
390fd0b388
commit
f6b72b6217
9 changed files with 59 additions and 105 deletions
|
@ -172,7 +172,6 @@ void *dst_alloc(struct dst_ops *ops, struct net_device *dev,
|
|||
dst->expires = 0UL;
|
||||
dst->path = dst;
|
||||
dst->neighbour = NULL;
|
||||
dst->hh = NULL;
|
||||
#ifdef CONFIG_XFRM
|
||||
dst->xfrm = NULL;
|
||||
#endif
|
||||
|
@ -226,19 +225,13 @@ struct dst_entry *dst_destroy(struct dst_entry * dst)
|
|||
{
|
||||
struct dst_entry *child;
|
||||
struct neighbour *neigh;
|
||||
struct hh_cache *hh;
|
||||
|
||||
smp_rmb();
|
||||
|
||||
again:
|
||||
neigh = dst->neighbour;
|
||||
hh = dst->hh;
|
||||
child = dst->child;
|
||||
|
||||
dst->hh = NULL;
|
||||
if (hh)
|
||||
hh_cache_put(hh);
|
||||
|
||||
if (neigh) {
|
||||
dst->neighbour = NULL;
|
||||
neigh_release(neigh);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue