diff options
| author | Takashi Iwai <tiwai@suse.de> | 2014-07-14 18:13:41 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2014-07-14 18:13:41 +0200 |
| commit | 03fe805a098422d27cbbbad29a54ff1349da3622 (patch) | |
| tree | 0db9cc9a701203ddcee58e5b907d4fb8ad31b421 /net/core/dst.c | |
| parent | 50dd9050e45ce11c575eabcaee8a914caf78fb74 (diff) | |
| parent | 5646eda5851e6cfdfa22d41895e3f5daffa643d3 (diff) | |
Merge branch 'topic/monotonic' into for-next
Diffstat (limited to 'net/core/dst.c')
| -rw-r--r-- | net/core/dst.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/net/core/dst.c b/net/core/dst.c index 80d6286c8b62..a028409ee438 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -269,6 +269,15 @@ again: } EXPORT_SYMBOL(dst_destroy); +static void dst_destroy_rcu(struct rcu_head *head) +{ + struct dst_entry *dst = container_of(head, struct dst_entry, rcu_head); + + dst = dst_destroy(dst); + if (dst) + __dst_free(dst); +} + void dst_release(struct dst_entry *dst) { if (dst) { @@ -276,11 +285,8 @@ void dst_release(struct dst_entry *dst) newrefcnt = atomic_dec_return(&dst->__refcnt); WARN_ON(newrefcnt < 0); - if (unlikely(dst->flags & DST_NOCACHE) && !newrefcnt) { - dst = dst_destroy(dst); - if (dst) - __dst_free(dst); - } + if (unlikely(dst->flags & DST_NOCACHE) && !newrefcnt) + call_rcu(&dst->rcu_head, dst_destroy_rcu); } } EXPORT_SYMBOL(dst_release); |
