Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2005-01-20 16:17:12 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-20 16:17:12 -0800
commitae9cad5606e012a901a0d2cecac50ea0c694e967 (patch)
treed9a9373806c7fd4f965ff09fe7336df539eb8696
parentfd42b1cf0ceb521f89f109b40f17b4040175ffbe (diff)
[PATCH] Lock initializer cleanup: Security
Use the new lock initializers DEFINE_SPIN_LOCK and DEFINE_RW_LOCK Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--security/keys/key.c4
-rw-r--r--security/keys/keyring.c2
-rw-r--r--security/selinux/avc.c4
-rw-r--r--security/selinux/hooks.c2
-rw-r--r--security/selinux/netif.c2
-rw-r--r--security/selinux/ss/services.c2
6 files changed, 8 insertions, 8 deletions
diff --git a/security/keys/key.c b/security/keys/key.c
index df264ad5717c..e3d0359f5f7e 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -20,10 +20,10 @@
static kmem_cache_t *key_jar;
static key_serial_t key_serial_next = 3;
struct rb_root key_serial_tree; /* tree of keys indexed by serial */
-spinlock_t key_serial_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(key_serial_lock);
struct rb_root key_user_tree; /* tree of quota records indexed by UID */
-spinlock_t key_user_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(key_user_lock);
static LIST_HEAD(key_types_list);
static DECLARE_RWSEM(key_types_sem);
diff --git a/security/keys/keyring.c b/security/keys/keyring.c
index 98d4b0b817f7..e2ab4f8e7481 100644
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -30,7 +30,7 @@
#define KEYRING_NAME_HASH_SIZE (1 << 5)
static struct list_head keyring_name_hash[KEYRING_NAME_HASH_SIZE];
-static rwlock_t keyring_name_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(keyring_name_lock);
static inline unsigned keyring_hash(const char *desc)
{
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index afd2b1047957..91dcc1879b2d 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -227,7 +227,7 @@ void __init avc_init(void)
for (i = 0; i < AVC_CACHE_SLOTS; i++) {
INIT_LIST_HEAD(&avc_cache.slots[i]);
- avc_cache.slots_lock[i] = SPIN_LOCK_UNLOCKED;
+ spin_lock_init(&avc_cache.slots_lock[i]);
}
atomic_set(&avc_cache.active_nodes, 0);
atomic_set(&avc_cache.lru_hint, 0);
@@ -415,7 +415,7 @@ out:
static int avc_latest_notif_update(int seqno, int is_insert)
{
int ret = 0;
- static spinlock_t notif_lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(notif_lock);
unsigned long flag;
spin_lock_irqsave(&notif_lock, flag);
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index ff918e1ab662..6debdde5548a 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -110,7 +110,7 @@ static struct security_operations *secondary_ops = NULL;
/* Lists of inode and superblock security structures initialized
before the policy was loaded. */
static LIST_HEAD(superblock_security_head);
-static spinlock_t sb_security_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(sb_security_lock);
/* Allocate and free functions for each kind of security blob. */
diff --git a/security/selinux/netif.c b/security/selinux/netif.c
index e3ffae522a2d..718d7be9f4dd 100644
--- a/security/selinux/netif.c
+++ b/security/selinux/netif.c
@@ -45,7 +45,7 @@ struct sel_netif
static u32 sel_netif_total;
static LIST_HEAD(sel_netif_list);
-static spinlock_t sel_netif_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(sel_netif_lock);
static struct list_head sel_netif_hash[SEL_NETIF_HASH_SIZE];
static inline u32 sel_netif_hasfn(struct net_device *dev)
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index 3f6a537d272e..11545e0f8307 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -42,7 +42,7 @@
extern void selnl_notify_policyload(u32 seqno);
unsigned int policydb_loaded_version;
-static rwlock_t policy_rwlock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(policy_rwlock);
#define POLICY_RDLOCK read_lock(&policy_rwlock)
#define POLICY_WRLOCK write_lock_irq(&policy_rwlock)
#define POLICY_RDUNLOCK read_unlock(&policy_rwlock)