diff options
author | Benjamin LaHaise <bcrl@kvack.org> | 2014-07-14 13:14:27 -0400 |
---|---|---|
committer | Benjamin LaHaise <bcrl@kvack.org> | 2014-07-14 13:14:27 -0400 |
commit | 6e830d53717cf3d5c30c1afce3773ef97e436cd9 (patch) | |
tree | 9376a0424b8f9fff12d107aa2498e775da20e85d /net/core/dst.c | |
parent | 855ef0dec7271ff7be7381feaaf3f4aed80bd503 (diff) | |
parent | 263782c1c95bbddbb022dc092fd89a36bb8d5577 (diff) | |
download | linux-6e830d53717cf3d5c30c1afce3773ef97e436cd9.tar.gz linux-6e830d53717cf3d5c30c1afce3773ef97e436cd9.tar.bz2 linux-6e830d53717cf3d5c30c1afce3773ef97e436cd9.zip |
Merge ../aio-fixes
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); |