aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlabel/netlabel_mgmt.c
diff options
context:
space:
mode:
authorPaul Moore <paul.moore@hp.com>2007-10-26 07:29:08 -0400
committerDavid S. Miller <davem@davemloft.net>2007-10-26 07:29:08 -0400
commit4be2700fb7b95f2a7cef9324879cafccab8774fc (patch)
tree8e3839c4e1c23c7d2b105f9ea45fb0891e3f0312 /net/netlabel/netlabel_mgmt.c
parent94d3b1e586f6d4c7150501bde284c544ce99073c (diff)
[NetLabel]: correct usage of RCU locking
This fixes some awkward, and perhaps even problematic, RCU lock usage in the NetLabel code as well as some other related trivial cleanups found when looking through the RCU locking. Most of the changes involve removing the redundant RCU read locks wrapping spinlocks in the case of a RCU writer. Signed-off-by: Paul Moore <paul.moore@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlabel/netlabel_mgmt.c')
-rw-r--r--net/netlabel/netlabel_mgmt.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c
index 5315dacc5222..56483377997a 100644
--- a/net/netlabel/netlabel_mgmt.c
+++ b/net/netlabel/netlabel_mgmt.c
@@ -85,11 +85,9 @@ static const struct nla_policy netlbl_mgmt_genl_policy[NLBL_MGMT_A_MAX + 1] = {
85 */ 85 */
86void netlbl_mgmt_protocount_inc(void) 86void netlbl_mgmt_protocount_inc(void)
87{ 87{
88 rcu_read_lock();
89 spin_lock(&netlabel_mgmt_protocount_lock); 88 spin_lock(&netlabel_mgmt_protocount_lock);
90 netlabel_mgmt_protocount++; 89 netlabel_mgmt_protocount++;
91 spin_unlock(&netlabel_mgmt_protocount_lock); 90 spin_unlock(&netlabel_mgmt_protocount_lock);
92 rcu_read_unlock();
93} 91}
94 92
95/** 93/**
@@ -103,12 +101,10 @@ void netlbl_mgmt_protocount_inc(void)
103 */ 101 */
104void netlbl_mgmt_protocount_dec(void) 102void netlbl_mgmt_protocount_dec(void)
105{ 103{
106 rcu_read_lock();
107 spin_lock(&netlabel_mgmt_protocount_lock); 104 spin_lock(&netlabel_mgmt_protocount_lock);
108 if (netlabel_mgmt_protocount > 0) 105 if (netlabel_mgmt_protocount > 0)
109 netlabel_mgmt_protocount--; 106 netlabel_mgmt_protocount--;
110 spin_unlock(&netlabel_mgmt_protocount_lock); 107 spin_unlock(&netlabel_mgmt_protocount_lock);
111 rcu_read_unlock();
112} 108}
113 109
114/** 110/**