aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2005-01-07 22:09:06 -0800
committerLinus Torvalds <torvalds@evo.osdl.org>2005-01-07 22:09:06 -0800
commit44b7f61e2868c2d4895c93b0d3382389a7a66f6b (patch)
tree1c05de8fbd29e7fa658d24af65842b029e6e860c /kernel
parentc254df93a2064d49effb25dce3a9dc37982f8b53 (diff)
downloadhistory-44b7f61e2868c2d4895c93b0d3382389a7a66f6b.tar.gz
[PATCH] Lock initializer cleanup (Core)
Kernel core files converted to use the new lock initializers. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/audit.c8
-rw-r--r--kernel/capability.c2
-rw-r--r--kernel/dma.c2
-rw-r--r--kernel/exec_domain.c2
-rw-r--r--kernel/fork.c4
-rw-r--r--kernel/intermodule.c2
-rw-r--r--kernel/kprobes.c2
-rw-r--r--kernel/module.c2
-rw-r--r--kernel/pid.c2
-rw-r--r--kernel/posix-timers.c2
-rw-r--r--kernel/printk.c4
-rw-r--r--kernel/profile.c2
-rw-r--r--kernel/resource.c2
-rw-r--r--kernel/sys.c2
-rw-r--r--kernel/timer.c2
-rw-r--r--kernel/user.c2
-rw-r--r--kernel/workqueue.c2
17 files changed, 22 insertions, 22 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index d813b7aa4b4cad..8ec8a88ad35c37 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -98,8 +98,8 @@ static struct sock *audit_sock;
* The second list is a list of pre-allocated audit buffers (if more
* than AUDIT_MAXFREE are in use, the audit buffer is freed instead of
* being placed on the freelist). */
-static spinlock_t audit_txlist_lock = SPIN_LOCK_UNLOCKED;
-static spinlock_t audit_freelist_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(audit_txlist_lock);
+static DEFINE_SPINLOCK(audit_freelist_lock);
static int audit_freelist_count = 0;
static LIST_HEAD(audit_txlist);
static LIST_HEAD(audit_freelist);
@@ -169,7 +169,7 @@ static inline int audit_rate_check(void)
{
static unsigned long last_check = 0;
static int messages = 0;
- static spinlock_t lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(lock);
unsigned long flags;
unsigned long now;
unsigned long elapsed;
@@ -199,7 +199,7 @@ static inline int audit_rate_check(void)
void audit_log_lost(const char *message)
{
static unsigned long last_msg = 0;
- static spinlock_t lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(lock);
unsigned long flags;
unsigned long now;
int print;
diff --git a/kernel/capability.c b/kernel/capability.c
index 1d70f47058e847..b828d545a97b7a 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -23,7 +23,7 @@ EXPORT_SYMBOL(cap_bset);
* This global lock protects task->cap_* for all tasks including current.
* Locking rule: acquire this prior to tasklist_lock.
*/
-spinlock_t task_capability_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(task_capability_lock);
/*
* For sys_getproccap() and sys_setproccap(), any of the three
diff --git a/kernel/dma.c b/kernel/dma.c
index 940d02c5087991..aef0a45b7893db 100644
--- a/kernel/dma.c
+++ b/kernel/dma.c
@@ -38,7 +38,7 @@
*/
-spinlock_t dma_spin_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(dma_spin_lock);
/*
* If our port doesn't define this it has no PC like DMA
diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c
index ad3e5d54e11944..867d6dbeb5743d 100644
--- a/kernel/exec_domain.c
+++ b/kernel/exec_domain.c
@@ -22,7 +22,7 @@
static void default_handler(int, struct pt_regs *);
static struct exec_domain *exec_domains = &default_exec_domain;
-static rwlock_t exec_domains_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(exec_domains_lock);
static u_long ident_map[32] = {
diff --git a/kernel/fork.c b/kernel/fork.c
index 9df817a8f62b50..6d9412937d3729 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -58,7 +58,7 @@ int max_threads; /* tunable limit on nr_threads */
DEFINE_PER_CPU(unsigned long, process_counts) = 0;
-rwlock_t tasklist_lock __cacheline_aligned = RW_LOCK_UNLOCKED; /* outer */
+ __cacheline_aligned DEFINE_RWLOCK(tasklist_lock); /* outer */
EXPORT_SYMBOL(tasklist_lock);
@@ -281,7 +281,7 @@ static inline void mm_free_pgd(struct mm_struct * mm)
#define mm_free_pgd(mm)
#endif /* CONFIG_MMU */
-spinlock_t mmlist_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
+ __cacheline_aligned_in_smp DEFINE_SPINLOCK(mmlist_lock);
#define allocate_mm() (kmem_cache_alloc(mm_cachep, SLAB_KERNEL))
#define free_mm(mm) (kmem_cache_free(mm_cachep, (mm)))
diff --git a/kernel/intermodule.c b/kernel/intermodule.c
index 09f556507f57cc..9078649382cfe5 100644
--- a/kernel/intermodule.c
+++ b/kernel/intermodule.c
@@ -14,7 +14,7 @@
*/
static struct list_head ime_list = LIST_HEAD_INIT(ime_list);
-static spinlock_t ime_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(ime_lock);
static int kmalloc_failed;
struct inter_module_entry {
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index d3d1321b0e5c2c..cc6f72585f1e89 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -43,7 +43,7 @@
static struct hlist_head kprobe_table[KPROBE_TABLE_SIZE];
unsigned int kprobe_cpu = NR_CPUS;
-static spinlock_t kprobe_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(kprobe_lock);
/* Locks kprobe: irqs must be disabled */
void lock_kprobes(void)
diff --git a/kernel/module.c b/kernel/module.c
index 5a0f2024a9e47a..167089669c0f08 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -53,7 +53,7 @@
#define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1))
/* Protects module list */
-static spinlock_t modlist_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(modlist_lock);
/* List of modules, protected by module_mutex AND modlist_lock */
static DECLARE_MUTEX(module_mutex);
diff --git a/kernel/pid.c b/kernel/pid.c
index 185a8bee816832..edba31c681ace9 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -60,7 +60,7 @@ typedef struct pidmap {
static pidmap_t pidmap_array[PIDMAP_ENTRIES] =
{ [ 0 ... PIDMAP_ENTRIES-1 ] = { ATOMIC_INIT(BITS_PER_PAGE), NULL } };
-static spinlock_t pidmap_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
+static __cacheline_aligned_in_smp DEFINE_SPINLOCK(pidmap_lock);
fastcall void free_pidmap(int pid)
{
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 33a67e7ad826f1..9e79eca513ca7e 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -85,7 +85,7 @@ static inline u64 mpy_l_X_l_ll(unsigned long mpy1,unsigned long mpy2)
*/
static kmem_cache_t *posix_timers_cache;
static struct idr posix_timers_id;
-static spinlock_t idr_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(idr_lock);
/*
* Just because the timer is not in the timer list does NOT mean it is
diff --git a/kernel/printk.c b/kernel/printk.c
index eece774b4d1955..d914a90d6206dd 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -78,7 +78,7 @@ static int console_locked;
* It is also used in interesting ways to provide interlocking in
* release_console_sem().
*/
-static spinlock_t logbuf_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(logbuf_lock);
static char __log_buf[__LOG_BUF_LEN];
static char *log_buf = __log_buf;
@@ -875,7 +875,7 @@ void tty_write_message(struct tty_struct *tty, char *msg)
*/
int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst)
{
- static spinlock_t ratelimit_lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(ratelimit_lock);
static unsigned long toks = 10*5*HZ;
static unsigned long last_msg;
static int missed;
diff --git a/kernel/profile.c b/kernel/profile.c
index 1bf1ec5fe56bd8..a38fa70075fe41 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -83,7 +83,7 @@ void __init profile_init(void)
#ifdef CONFIG_PROFILING
static DECLARE_RWSEM(profile_rwsem);
-static rwlock_t handoff_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(handoff_lock);
static struct notifier_block * task_exit_notifier;
static struct notifier_block * task_free_notifier;
static struct notifier_block * munmap_notifier;
diff --git a/kernel/resource.c b/kernel/resource.c
index 5f013dc4f649f0..72596bc6fdafb4 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -39,7 +39,7 @@ struct resource iomem_resource = {
EXPORT_SYMBOL(iomem_resource);
-static rwlock_t resource_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(resource_lock);
#ifdef CONFIG_PROC_FS
diff --git a/kernel/sys.c b/kernel/sys.c
index 2f41771e42f71c..20080da0c3defb 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -89,7 +89,7 @@ int cad_pid = 1;
*/
static struct notifier_block *reboot_notifier_list;
-rwlock_t notifier_lock = RW_LOCK_UNLOCKED;
+DEFINE_RWLOCK(notifier_lock);
/**
* notifier_chain_register - Add notifier to a notifier chain
diff --git a/kernel/timer.c b/kernel/timer.c
index ee1aa2ec7fe46e..f7b14cf928f785 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1445,7 +1445,7 @@ void __init init_timers(void)
struct time_interpolator *time_interpolator;
static struct time_interpolator *time_interpolator_list;
-static spinlock_t time_interpolator_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(time_interpolator_lock);
static inline u64 time_interpolator_get_cycles(unsigned int src)
{
diff --git a/kernel/user.c b/kernel/user.c
index 693487dc940e6e..18f63146602a16 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -26,7 +26,7 @@
static kmem_cache_t *uid_cachep;
static struct list_head uidhash_table[UIDHASH_SZ];
-static spinlock_t uidhash_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(uidhash_lock);
struct user_struct root_user = {
.__count = ATOMIC_INIT(1),
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 2f7771dc63ec74..3993f7bdf5c270 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -64,7 +64,7 @@ struct workqueue_struct {
/* All the per-cpu workqueues on the system, for hotplug cpu to add/remove
threads to each one as cpus come/go. */
-static spinlock_t workqueue_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(workqueue_lock);
static LIST_HEAD(workqueues);
/* If it's single threaded, it isn't in the list of workqueues. */