net,rcu: convert call_rcu(sctp_local_addr_free) to kfree_rcu()
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 15 Mar 2011 10:05:02 +0000 (18:05 +0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 8 May 2011 05:50:51 +0000 (22:50 -0700)
The rcu callback sctp_local_addr_free() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(sctp_local_addr_free).

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
include/net/sctp/sctp.h
net/sctp/bind_addr.c
net/sctp/ipv6.c
net/sctp/protocol.c

index 505845ddb0bec9445478f1810623f13df27e5a82..01e094c6d0aecd2607e17dfbe572f4fa94a44655 100644 (file)
  * sctp/protocol.c
  */
 extern struct sock *sctp_get_ctl_sock(void);
-extern void sctp_local_addr_free(struct rcu_head *head);
 extern int sctp_copy_local_addr_list(struct sctp_bind_addr *,
                                     sctp_scope_t, gfp_t gfp,
                                     int flags);
index faf71d179e4641137f8d8d477e4a9773321d4bdd..3c06c87cd2807996d018012a63c09fae167284ec 100644 (file)
@@ -219,7 +219,7 @@ int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
        }
 
        if (found) {
-               call_rcu(&addr->rcu, sctp_local_addr_free);
+               kfree_rcu(addr, rcu);
                SCTP_DBG_OBJCNT_DEC(addr);
                return 0;
        }
index 865ce7ba4e14eb2c6b9ace3b3a90380db0fff949..185fe058db11e64e270ba81d0c6ecddd7946d6d6 100644 (file)
@@ -123,7 +123,7 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
                }
                spin_unlock_bh(&sctp_local_addr_lock);
                if (found)
-                       call_rcu(&addr->rcu, sctp_local_addr_free);
+                       kfree_rcu(addr, rcu);
                break;
        }
 
index d5bf91d04f631380bfd78d59bff7da42ee1718db..065d99958cedb995a78ab51d0e0b1e3b1c36523c 100644 (file)
@@ -230,13 +230,6 @@ static void sctp_free_local_addr_list(void)
        }
 }
 
-void sctp_local_addr_free(struct rcu_head *head)
-{
-       struct sctp_sockaddr_entry *e = container_of(head,
-                               struct sctp_sockaddr_entry, rcu);
-       kfree(e);
-}
-
 /* Copy the local addresses which are valid for 'scope' into 'bp'.  */
 int sctp_copy_local_addr_list(struct sctp_bind_addr *bp, sctp_scope_t scope,
                              gfp_t gfp, int copy_flags)
@@ -681,7 +674,7 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
                }
                spin_unlock_bh(&sctp_local_addr_lock);
                if (found)
-                       call_rcu(&addr->rcu, sctp_local_addr_free);
+                       kfree_rcu(addr, rcu);
                break;
        }