]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Lock initializer cleanup: Security
authorThomas Gleixner <tglx@linutronix.de>
Fri, 21 Jan 2005 00:17:12 +0000 (16:17 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 21 Jan 2005 00:17:12 +0000 (16:17 -0800)
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>
security/keys/key.c
security/keys/keyring.c
security/selinux/avc.c
security/selinux/hooks.c
security/selinux/netif.c
security/selinux/ss/services.c

index df264ad5717cd692058a3ade43e4dace17ab75ed..e3d0359f5f7e16fd9fffc773315ff296351959cd 100644 (file)
 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);
index 98d4b0b817f71d4095a5f970b0ee6490ec0cf5d8..e2ab4f8e7481d21d18efc26d0af1be273b39da8d 100644 (file)
@@ -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)
 {
index afd2b10479571b2beb16ef8bc458fa5944a711c6..91dcc1879b2d4cdf13ea82eb589c22be5bd4294d 100644 (file)
@@ -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);
index ff918e1ab6624ff715969b35020e413e9a33b8ca..6debdde5548abd2c2e820c579e5678c8c1a22d2f 100644 (file)
@@ -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. */
 
index e3ffae522a2d80b3cbd155ceeee1f8271865420e..718d7be9f4dd4b8077998d076345af9a785212dc 100644 (file)
@@ -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)
index 3f6a537d272e37f019597cdd3d20eab5cde7632d..11545e0f83076a367be8039631c13abe209fbdd4 100644 (file)
@@ -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)