diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2007-09-16 16:03:28 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-09-16 16:03:28 -0700 |
commit | 559cf710b07c5e2cfa3fb8d8f4a1320fd84c53f9 (patch) | |
tree | deb74aea811a7d7c7e203f3743fd15372f8a6589 /include | |
parent | 293035479942400a7fe8e4f72465d4e4e466b91a (diff) | |
download | kernel-crypto-559cf710b07c5e2cfa3fb8d8f4a1320fd84c53f9.tar.gz kernel-crypto-559cf710b07c5e2cfa3fb8d8f4a1320fd84c53f9.tar.xz kernel-crypto-559cf710b07c5e2cfa3fb8d8f4a1320fd84c53f9.zip |
[SCTP]: Convert bind_addr_list locking to RCU
Since the sctp_sockaddr_entry is now RCU enabled as part of
the patch to synchronize sctp_localaddr_list, it makes sense to
change all handling of these entries to RCU. This includes the
sctp_bind_addrs structure and it's list of bound addresses.
This list is currently protected by an external rw_lock and that
looks like an overkill. There are only 2 writers to the list:
bind()/bindx() calls, and BH processing of ASCONF-ACK chunks.
These are already seriealized via the socket lock, so they will
not step on each other. These are also relatively rare, so we
should be good with RCU.
The readers are varied and they are easily converted to RCU.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Sridhar Samdurala <sri@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/sctp/structs.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index a89e36197af..c2fe2dcc9af 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -1155,7 +1155,9 @@ int sctp_bind_addr_copy(struct sctp_bind_addr *dest, int flags); int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, __u8 use_as_src, gfp_t gfp); -int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); +int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *, + void (*rcu_call)(struct rcu_head *, + void (*func)(struct rcu_head *))); int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, struct sctp_sock *); union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, @@ -1226,9 +1228,6 @@ struct sctp_ep_common { * bind_addr.address_list is our set of local IP addresses. */ struct sctp_bind_addr bind_addr; - - /* Protection during address list comparisons. */ - rwlock_t addr_lock; }; |