aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2004-10-27 18:33:04 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-10-27 18:33:04 -0700
commitc83ff1d2b7be6651f369b3687f88f3cf9236b4f6 (patch)
tree16c45d8d0e77ccafdb04acc450af91200ac3ab15 /mm
parent41b873ffb13f241b7b046dfff5f03df172458595 (diff)
downloadhistory-c83ff1d2b7be6651f369b3687f88f3cf9236b4f6.tar.gz
[PATCH] Lock initializer unifying (Core)
To make spinlock/rwlock initialization consistent all over the kernel, this patch converts explicit lock-initializers into spin_lock_init() and rwlock_init() calls. Currently, spinlocks and rwlocks are initialized in two different ways: lock = SPIN_LOCK_UNLOCKED spin_lock_init(&lock) rwlock = RW_LOCK_UNLOCKED rwlock_init(&rwlock) this patch converts all explicit lock initializations to spin_lock_init() or rwlock_init(). (Besides consistency this also helps automatic lock validators and debugging code.) The conversion was done with a script, it was verified manually and it was reviewed, compiled and tested as far as possible on x86, ARM, PPC. There is no runtime overhead or actual code change resulting out of this patch, because spin_lock_init() and rwlock_init() are macros and are thus equivalent to the explicit initialization method. 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 'mm')
-rw-r--r--mm/swapfile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 446b6fd9871e19..63ea0f73f97e43 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1374,7 +1374,7 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
p->highest_bit = 0;
p->cluster_nr = 0;
p->inuse_pages = 0;
- p->sdev_lock = SPIN_LOCK_UNLOCKED;
+ spin_lock_init(&p->sdev_lock);
p->next = -1;
if (swap_flags & SWAP_FLAG_PREFER) {
p->prio =