diff options
author | Varun Wadekar <vwadekar@nvidia.com> | 2012-07-18 17:50:45 +0530 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2012-07-18 17:50:45 +0530 |
commit | fac3a3330e9d5f67f55a11629217220a18133bd5 (patch) | |
tree | a38a68fa3e58febc03cadd4eea37b3b2ffcbe334 /net/ipv4 | |
parent | 84b91a0abe3485cbdb09debaf1ccaaa2c6a7d1fa (diff) | |
parent | 763c71b1319c56272e42cf6ada6994131f0193a7 (diff) |
Merge commit 'v3.4.5' into android-t114-3.4-rebased
Linux v3.4.5
Conflicts:
drivers/base/power/main.c
Change-Id: I782e650a89665caea8aed9e5598234888dc11088
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/inetpeer.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c index d4d61b694fab..dfba343b2509 100644 --- a/net/ipv4/inetpeer.c +++ b/net/ipv4/inetpeer.c @@ -560,6 +560,17 @@ bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout) } EXPORT_SYMBOL(inet_peer_xrlim_allow); +static void inetpeer_inval_rcu(struct rcu_head *head) +{ + struct inet_peer *p = container_of(head, struct inet_peer, gc_rcu); + + spin_lock_bh(&gc_lock); + list_add_tail(&p->gc_list, &gc_list); + spin_unlock_bh(&gc_lock); + + schedule_delayed_work(&gc_work, gc_delay); +} + void inetpeer_invalidate_tree(int family) { struct inet_peer *old, *new, *prev; @@ -576,10 +587,7 @@ void inetpeer_invalidate_tree(int family) prev = cmpxchg(&base->root, old, new); if (prev == old) { base->total = 0; - spin_lock(&gc_lock); - list_add_tail(&prev->gc_list, &gc_list); - spin_unlock(&gc_lock); - schedule_delayed_work(&gc_work, gc_delay); + call_rcu(&prev->gc_rcu, inetpeer_inval_rcu); } out: |