aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2005-01-07 22:07:37 -0800
committerLinus Torvalds <torvalds@evo.osdl.org>2005-01-07 22:07:37 -0800
commit668adbc914d906a0a77957a18f53274bd8891964 (patch)
tree58d588999a8fe7b3c165f7bc6c52ce9e36cdbedc /fs
parente4955c71722c5e9dd4d9f45b42d92765427f3f8a (diff)
downloadhistory-668adbc914d906a0a77957a18f53274bd8891964.tar.gz
[PATCH] Lock initializer unifying: Filesystems
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. That's the second batch of the unifying patches. 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 'fs')
-rw-r--r--fs/cifs/cifsfs.c4
-rw-r--r--fs/cifs/misc.c2
-rw-r--r--fs/dcache.c2
-rw-r--r--fs/file_table.c2
-rw-r--r--fs/reiserfs/super.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.c2
6 files changed, 7 insertions, 7 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 8de4890ca1ae81..b0884aa697984b 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -853,8 +853,8 @@ init_cifs(void)
GlobalCurrentXid = 0;
GlobalTotalActiveXid = 0;
GlobalMaxActiveXid = 0;
- GlobalSMBSeslock = RW_LOCK_UNLOCKED;
- GlobalMid_Lock = SPIN_LOCK_UNLOCKED;
+ rwlock_init(&GlobalSMBSeslock);
+ spin_lock_init(&GlobalMid_Lock);
if(cifs_max_pending < 2) {
cifs_max_pending = 2;
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 495504dd1f6ad9..c79d8f707771cb 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -125,7 +125,7 @@ tconInfoAlloc(void)
INIT_LIST_HEAD(&ret_buf->openFileList);
init_MUTEX(&ret_buf->tconSem);
#ifdef CONFIG_CIFS_STATS
- ret_buf->stat_lock = SPIN_LOCK_UNLOCKED;
+ spin_lock_init(&ret_buf->stat_lock);
#endif
write_unlock(&GlobalSMBSeslock);
}
diff --git a/fs/dcache.c b/fs/dcache.c
index 9d457dfc3d676b..7608c466ea1c79 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -737,7 +737,7 @@ struct dentry *d_alloc(struct dentry * parent, const struct qstr *name)
atomic_set(&dentry->d_count, 1);
dentry->d_flags = DCACHE_UNHASHED;
- dentry->d_lock = SPIN_LOCK_UNLOCKED;
+ spin_lock_init(&dentry->d_lock);
dentry->d_inode = NULL;
dentry->d_parent = NULL;
dentry->d_sb = NULL;
diff --git a/fs/file_table.c b/fs/file_table.c
index e9ce5279ef6d27..c2e4d6f33d3601 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -82,7 +82,7 @@ static int old_max;
atomic_set(&f->f_count, 1);
f->f_uid = current->fsuid;
f->f_gid = current->fsgid;
- f->f_owner.lock = RW_LOCK_UNLOCKED;
+ rwlock_init(&f->f_owner.lock);
/* f->f_version: 0 */
INIT_LIST_HEAD(&f->f_list);
return f;
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 992221af3f2dae..1f0e4e245c4ef8 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1799,7 +1799,7 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
reiserfs_proc_info_init( s );
init_waitqueue_head (&(sbi->s_wait));
- sbi->bitmap_lock = SPIN_LOCK_UNLOCKED;
+ spin_lock_init(&sbi->bitmap_lock);
return (0);
diff --git a/fs/xfs/linux-2.6/xfs_vfs.c b/fs/xfs/linux-2.6/xfs_vfs.c
index 855e9148801df1..cce462dcbaea20 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.c
+++ b/fs/xfs/linux-2.6/xfs_vfs.c
@@ -250,7 +250,7 @@ vfs_allocate( void )
vfsp = kmem_zalloc(sizeof(vfs_t), KM_SLEEP);
bhv_head_init(VFS_BHVHEAD(vfsp), "vfs");
INIT_LIST_HEAD(&vfsp->vfs_sync_list);
- vfsp->vfs_sync_lock = SPIN_LOCK_UNLOCKED;
+ spin_lock_init(&vfsp->vfs_sync_lock);
init_waitqueue_head(&vfsp->vfs_wait_sync_task);
init_waitqueue_head(&vfsp->vfs_wait_single_sync_task);
return vfsp;