Skip to content

Commit

Permalink
net,rcu: convert call_rcu(sctp_local_addr_free) to kfree_rcu()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lai Jiangshan authored and Paul E. McKenney committed May 8, 2011
1 parent 37b6b93 commit 1231f0b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
1 change: 0 additions & 1 deletion include/net/sctp/sctp.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
* 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);
Expand Down
2 changes: 1 addition & 1 deletion net/sctp/bind_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion net/sctp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
9 changes: 1 addition & 8 deletions net/sctp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 1231f0b

Please sign in to comment.