diff options
author | Ying Xue <ying.xue@windriver.com> | 2014-12-02 15:00:30 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-12-08 20:39:57 -0500 |
commit | 97ede29e80eead50d8bd533cf163401b88c027be (patch) | |
tree | c85f9f4af8b3e830847be0de35048bbd92218147 /net/tipc/name_table.h | |
parent | 834caafa3e61f63805738376fa9c02dc0c1eb224 (diff) | |
download | linux-97ede29e80eead50d8bd533cf163401b88c027be.tar.gz linux-97ede29e80eead50d8bd533cf163401b88c027be.tar.bz2 linux-97ede29e80eead50d8bd533cf163401b88c027be.zip |
tipc: convert name table read-write lock to RCU
Convert tipc name table read-write lock to RCU. After this change,
a new spin lock is used to protect name table on write side while
RCU is applied on read side.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Tested-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/name_table.h')
-rw-r--r-- | net/tipc/name_table.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/tipc/name_table.h b/net/tipc/name_table.h index c1fd734eb0d5..5f0dee92010d 100644 --- a/net/tipc/name_table.h +++ b/net/tipc/name_table.h @@ -62,6 +62,7 @@ struct tipc_port_list; * @node_list: adjacent matching name seq publications with >= node scope * @cluster_list: adjacent matching name seq publications with >= cluster scope * @zone_list: adjacent matching name seq publications with >= zone scope + * @rcu: RCU callback head used for deferred freeing * * Note that the node list, cluster list, and zone list are circular lists. */ @@ -79,6 +80,7 @@ struct publication { struct list_head node_list; struct list_head cluster_list; struct list_head zone_list; + struct rcu_head rcu; }; /** @@ -93,7 +95,7 @@ struct name_table { u32 local_publ_count; }; -extern rwlock_t tipc_nametbl_lock; +extern spinlock_t tipc_nametbl_lock; extern struct name_table *tipc_nametbl; int tipc_nl_name_table_dump(struct sk_buff *skb, struct netlink_callback *cb); |