Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2005-01-20 16:22:05 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-20 16:22:05 -0800
commit40ecdb7008041e230f6dad1bbe766f761855daf7 (patch)
treefc04cf7834c1a9623aa037b02914fdf8303513fa
parent882afee1bf24744cb7843b48bd3983987c197eab (diff)
[PATCH] Lock initializer cleanup: Filesystems
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--fs/adfs/dir.c2
-rw-r--r--fs/adfs/map.c2
-rw-r--r--fs/afs/cell.c2
-rw-r--r--fs/afs/cmservice.c4
-rw-r--r--fs/afs/kafsasyncd.c2
-rw-r--r--fs/afs/kafstimod.c2
-rw-r--r--fs/afs/main.c2
-rw-r--r--fs/afs/server.c2
-rw-r--r--fs/afs/vlocation.c2
-rw-r--r--fs/aio.c2
-rw-r--r--fs/binfmt_misc.c2
-rw-r--r--fs/bio.c2
-rw-r--r--fs/block_dev.c2
-rw-r--r--fs/buffer.c4
-rw-r--r--fs/char_dev.c4
-rw-r--r--fs/dcache.c2
-rw-r--r--fs/devfs/base.c8
-rw-r--r--fs/dquot.c4
-rw-r--r--fs/exec.c2
-rw-r--r--fs/fcntl.c2
-rw-r--r--fs/file_table.c4
-rw-r--r--fs/filesystems.c2
-rw-r--r--fs/hugetlbfs/inode.c2
-rw-r--r--fs/inode.c2
-rw-r--r--fs/jfs/jfs_logmgr.c4
-rw-r--r--fs/jfs/jfs_metapage.c2
-rw-r--r--fs/jfs/jfs_txnmgr.c2
-rw-r--r--fs/libfs.c4
-rw-r--r--fs/mbcache.c2
-rw-r--r--fs/minix/itree_common.c2
-rw-r--r--fs/namespace.c2
-rw-r--r--fs/nfs/nfs4state.c2
-rw-r--r--fs/nfsd/nfscache.c2
-rw-r--r--fs/nfsd/nfssvc.c2
-rw-r--r--fs/nfsd/vfs.c2
-rw-r--r--fs/nls/nls_base.c2
-rw-r--r--fs/ntfs/aops.c2
-rw-r--r--fs/ntfs/compress.c2
-rw-r--r--fs/ntfs/debug.c2
-rw-r--r--fs/proc/generic.c2
-rw-r--r--fs/proc/kcore.c2
-rw-r--r--fs/reiserfs/xattr.c2
-rw-r--r--fs/smbfs/smbiod.c2
-rw-r--r--fs/super.c4
-rw-r--r--fs/sysv/itree.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c4
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.c2
-rw-r--r--fs/xfs/support/debug.c2
48 files changed, 60 insertions, 60 deletions
diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c
index d80a2d7bf300..0b4c3a028076 100644
--- a/fs/adfs/dir.c
+++ b/fs/adfs/dir.c
@@ -24,7 +24,7 @@
/*
* For future. This should probably be per-directory.
*/
-static rwlock_t adfs_dir_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(adfs_dir_lock);
static int
adfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
diff --git a/fs/adfs/map.c b/fs/adfs/map.c
index 48c7a31c862a..92ab4fbc2031 100644
--- a/fs/adfs/map.c
+++ b/fs/adfs/map.c
@@ -53,7 +53,7 @@
/*
* For the future...
*/
-static rwlock_t adfs_map_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(adfs_map_lock);
/*
* This is fun. We need to load up to 19 bits from the map at an
diff --git a/fs/afs/cell.c b/fs/afs/cell.c
index e7fd3cce44ee..009a9ae88d61 100644
--- a/fs/afs/cell.c
+++ b/fs/afs/cell.c
@@ -27,7 +27,7 @@ DECLARE_RWSEM(afs_proc_cells_sem);
LIST_HEAD(afs_proc_cells);
static struct list_head afs_cells = LIST_HEAD_INIT(afs_cells);
-static rwlock_t afs_cells_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(afs_cells_lock);
static DECLARE_RWSEM(afs_cells_sem); /* add/remove serialisation */
static struct afs_cell *afs_cell_root;
diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c
index 72443ef1756d..0a57fd7c726f 100644
--- a/fs/afs/cmservice.c
+++ b/fs/afs/cmservice.c
@@ -102,8 +102,8 @@ static DECLARE_COMPLETION(kafscmd_dead);
static DECLARE_WAIT_QUEUE_HEAD(kafscmd_sleepq);
static LIST_HEAD(kafscmd_attention_list);
static LIST_HEAD(afscm_calls);
-static spinlock_t afscm_calls_lock = SPIN_LOCK_UNLOCKED;
-static spinlock_t kafscmd_attention_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(afscm_calls_lock);
+static DEFINE_SPINLOCK(kafscmd_attention_lock);
static int kafscmd_die;
/*****************************************************************************/
diff --git a/fs/afs/kafsasyncd.c b/fs/afs/kafsasyncd.c
index 9c88da3be429..e179e17acdc6 100644
--- a/fs/afs/kafsasyncd.c
+++ b/fs/afs/kafsasyncd.c
@@ -39,7 +39,7 @@ static int kafsasyncd(void *arg);
static LIST_HEAD(kafsasyncd_async_attnq);
static LIST_HEAD(kafsasyncd_async_busyq);
-static spinlock_t kafsasyncd_async_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(kafsasyncd_async_lock);
static void kafsasyncd_null_call_attn_func(struct rxrpc_call *call)
{
diff --git a/fs/afs/kafstimod.c b/fs/afs/kafstimod.c
index d7c8826b52a8..e8bbffee5866 100644
--- a/fs/afs/kafstimod.c
+++ b/fs/afs/kafstimod.c
@@ -25,7 +25,7 @@ static DECLARE_WAIT_QUEUE_HEAD(kafstimod_sleepq);
static int kafstimod_die;
static LIST_HEAD(kafstimod_list);
-static spinlock_t kafstimod_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(kafstimod_lock);
static int kafstimod(void *arg);
diff --git a/fs/afs/main.c b/fs/afs/main.c
index c8775699fb44..a26979b732bf 100644
--- a/fs/afs/main.c
+++ b/fs/afs/main.c
@@ -58,7 +58,7 @@ static struct rxrpc_peer_ops afs_peer_ops = {
};
struct list_head afs_cb_hash_tbl[AFS_CB_HASH_COUNT];
-spinlock_t afs_cb_hash_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(afs_cb_hash_lock);
#ifdef AFS_CACHING_SUPPORT
static struct cachefs_netfs_operations afs_cache_ops = {
diff --git a/fs/afs/server.c b/fs/afs/server.c
index fbfc28e3eded..62b093aa41c6 100644
--- a/fs/afs/server.c
+++ b/fs/afs/server.c
@@ -21,7 +21,7 @@
#include "kafstimod.h"
#include "internal.h"
-spinlock_t afs_server_peer_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(afs_server_peer_lock);
#define FS_SERVICE_ID 1 /* AFS Volume Location Service ID */
#define VL_SERVICE_ID 52 /* AFS Volume Location Service ID */
diff --git a/fs/afs/vlocation.c b/fs/afs/vlocation.c
index 5d650422e7fd..eced20618ecc 100644
--- a/fs/afs/vlocation.c
+++ b/fs/afs/vlocation.c
@@ -57,7 +57,7 @@ static const struct afs_async_op_ops afs_vlocation_update_op_ops = {
static LIST_HEAD(afs_vlocation_update_pendq); /* queue of VLs awaiting update */
static struct afs_vlocation *afs_vlocation_update; /* VL currently being updated */
-static spinlock_t afs_vlocation_update_lock = SPIN_LOCK_UNLOCKED; /* lock guarding update queue */
+static DEFINE_SPINLOCK(afs_vlocation_update_lock); /* lock guarding update queue */
#ifdef AFS_CACHING_SUPPORT
static cachefs_match_val_t afs_vlocation_cache_match(void *target,
diff --git a/fs/aio.c b/fs/aio.c
index 7a9c7a12a977..ee03fcb49b99 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -57,7 +57,7 @@ static struct workqueue_struct *aio_wq;
static void aio_fput_routine(void *);
static DECLARE_WORK(fput_work, aio_fput_routine, NULL);
-static spinlock_t fput_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(fput_lock);
LIST_HEAD(fput_head);
static void aio_kick_handler(void *);
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 29b3b7bbb8c5..8ae0db6cd69c 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -54,7 +54,7 @@ typedef struct {
struct dentry *dentry;
} Node;
-static rwlock_t entries_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(entries_lock);
static struct vfsmount *bm_mnt;
static int entry_count;
diff --git a/fs/bio.c b/fs/bio.c
index 3e55a58714f9..d23d9782377e 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -728,7 +728,7 @@ static void bio_release_pages(struct bio *bio)
static void bio_dirty_fn(void *data);
static DECLARE_WORK(bio_dirty_work, bio_dirty_fn, NULL);
-static spinlock_t bio_dirty_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(bio_dirty_lock);
static struct bio *bio_dirty_list;
/*
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 5245b37a446d..d19d07c49ad3 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -237,7 +237,7 @@ static int block_fsync(struct file *filp, struct dentry *dentry, int datasync)
* pseudo-fs
*/
-static spinlock_t bdev_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
+static __cacheline_aligned_in_smp DEFINE_SPINLOCK(bdev_lock);
static kmem_cache_t * bdev_cachep;
static struct inode *bdev_alloc_inode(struct super_block *sb)
diff --git a/fs/buffer.c b/fs/buffer.c
index 341ba4c58a18..2a6285bf9a88 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -537,7 +537,7 @@ static void free_more_memory(void)
*/
static void end_buffer_async_read(struct buffer_head *bh, int uptodate)
{
- static spinlock_t page_uptodate_lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(page_uptodate_lock);
unsigned long flags;
struct buffer_head *tmp;
struct page *page;
@@ -595,7 +595,7 @@ still_busy:
void end_buffer_async_write(struct buffer_head *bh, int uptodate)
{
char b[BDEVNAME_SIZE];
- static spinlock_t page_uptodate_lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(page_uptodate_lock);
unsigned long flags;
struct buffer_head *tmp;
struct page *page;
diff --git a/fs/char_dev.c b/fs/char_dev.c
index a40ae83adc92..cd42dc317a5b 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -28,7 +28,7 @@ static struct kobj_map *cdev_map;
#define MAX_PROBE_HASH 255 /* random */
-static rwlock_t chrdevs_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(chrdevs_lock);
static struct char_device_struct {
struct char_device_struct *next;
@@ -248,7 +248,7 @@ int unregister_chrdev(unsigned int major, const char *name)
return 0;
}
-static spinlock_t cdev_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(cdev_lock);
static struct kobject *cdev_get(struct cdev *p)
{
diff --git a/fs/dcache.c b/fs/dcache.c
index 7608c466ea1c..ed90b724af78 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -37,7 +37,7 @@
int sysctl_vfs_cache_pressure = 100;
-spinlock_t dcache_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
+ __cacheline_aligned_in_smp DEFINE_SPINLOCK(dcache_lock);
seqlock_t rename_lock __cacheline_aligned_in_smp = SEQLOCK_UNLOCKED;
EXPORT_SYMBOL(dcache_lock);
diff --git a/fs/devfs/base.c b/fs/devfs/base.c
index 7dce102535c3..1ecfe1f184d4 100644
--- a/fs/devfs/base.c
+++ b/fs/devfs/base.c
@@ -831,7 +831,7 @@ static kmem_cache_t *devfsd_buf_cache;
#ifdef CONFIG_DEVFS_DEBUG
static unsigned int devfs_debug_init __initdata = DEBUG_NONE;
static unsigned int devfs_debug = DEBUG_NONE;
-static spinlock_t stat_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(stat_lock);
static unsigned int stat_num_entries;
static unsigned int stat_num_bytes;
#endif
@@ -966,7 +966,7 @@ static struct devfs_entry *_devfs_alloc_entry(const char *name,
{
struct devfs_entry *new;
static unsigned long inode_counter = FIRST_INODE;
- static spinlock_t counter_lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(counter_lock);
if (name && (namelen < 1))
namelen = strlen(name);
@@ -1063,7 +1063,7 @@ static int _devfs_append_entry(devfs_handle_t dir, devfs_handle_t de,
static struct devfs_entry *_devfs_get_root_entry(void)
{
struct devfs_entry *new;
- static spinlock_t root_lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(root_lock);
if (root_entry)
return root_entry;
@@ -2683,7 +2683,7 @@ static int devfsd_ioctl(struct inode *inode, struct file *file,
work even if the global kernel lock were to be removed, because it
doesn't matter who gets in first, as long as only one gets it */
if (fs_info->devfsd_task == NULL) {
- static spinlock_t lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(lock);
if (!spin_trylock(&lock))
return -EBUSY;
diff --git a/fs/dquot.c b/fs/dquot.c
index 8455855e751a..478a86e657eb 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -121,8 +121,8 @@
* i_sem on quota files is special (it's below dqio_sem)
*/
-static spinlock_t dq_list_lock = SPIN_LOCK_UNLOCKED;
-spinlock_t dq_data_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(dq_list_lock);
+DEFINE_SPINLOCK(dq_data_lock);
static char *quotatypes[] = INITQFNAMES;
static struct quota_format_type *quota_formats; /* List of registered formats */
diff --git a/fs/exec.c b/fs/exec.c
index 115e6f15b30a..ee58e91a9d7f 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -61,7 +61,7 @@ char core_pattern[65] = "core";
/* The maximal length of core_pattern is also specified in sysctl.c */
static struct linux_binfmt *formats;
-static rwlock_t binfmt_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(binfmt_lock);
int register_binfmt(struct linux_binfmt * fmt)
{
diff --git a/fs/fcntl.c b/fs/fcntl.c
index 9d22e6cee469..c1708066bf55 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -507,7 +507,7 @@ int send_sigurg(struct fown_struct *fown)
return ret;
}
-static rwlock_t fasync_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(fasync_lock);
static kmem_cache_t *fasync_cache;
/*
diff --git a/fs/file_table.c b/fs/file_table.c
index c2e4d6f33d36..dc5ad8eb5cf3 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -25,9 +25,9 @@ struct files_stat_struct files_stat = {
EXPORT_SYMBOL(files_stat); /* Needed by unix.o */
/* public. Not pretty! */
-spinlock_t __cacheline_aligned_in_smp files_lock = SPIN_LOCK_UNLOCKED;
+ __cacheline_aligned_in_smp DEFINE_SPINLOCK(files_lock);
-static spinlock_t filp_count_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(filp_count_lock);
/* slab constructors and destructors are called from arbitrary
* context and must be fully threaded - use a local spinlock
diff --git a/fs/filesystems.c b/fs/filesystems.c
index af0fd4973880..44082bfdfec9 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -28,7 +28,7 @@
*/
static struct file_system_type *file_systems;
-static rwlock_t file_systems_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(file_systems_lock);
/* WARNING: This can be used only if we _already_ own a reference */
void get_filesystem(struct file_system_type *fs)
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 03019e040d0b..7a006cc6e1c2 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -737,7 +737,7 @@ static struct vfsmount *hugetlbfs_vfsmount;
*/
static unsigned long hugetlbfs_counter(void)
{
- static spinlock_t lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(lock);
static unsigned long counter;
unsigned long ret;
diff --git a/fs/inode.c b/fs/inode.c
index 0beebc00a645..d76a6e4b3ee1 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -80,7 +80,7 @@ static struct hlist_head *inode_hashtable;
* NOTE! You also have to own the lock if you change
* the i_state of an inode while it is in use..
*/
-spinlock_t inode_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(inode_lock);
/*
* iprune_sem provides exclusion between the kswapd or try_to_free_pages
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index b9e502f4acab..dfa771c272a2 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -78,7 +78,7 @@
* lbuf's ready to be redriven. Protected by log_redrive_lock (jfsIO thread)
*/
static struct lbuf *log_redrive_list;
-static spinlock_t log_redrive_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(log_redrive_lock);
DECLARE_WAIT_QUEUE_HEAD(jfs_IO_thread_wait);
@@ -113,7 +113,7 @@ DECLARE_WAIT_QUEUE_HEAD(jfs_IO_thread_wait);
/*
* log buffer cache synchronization
*/
-static spinlock_t jfsLCacheLock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(jfsLCacheLock);
#define LCACHE_LOCK(flags) spin_lock_irqsave(&jfsLCacheLock, flags)
#define LCACHE_UNLOCK(flags) spin_unlock_irqrestore(&jfsLCacheLock, flags)
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index c6fb317f5ab8..1cd9bdff2f59 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -28,7 +28,7 @@
#include "jfs_txnmgr.h"
#include "jfs_debug.h"
-static spinlock_t meta_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(meta_lock);
#ifdef CONFIG_JFS_STATISTICS
static struct {
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index 6a20dbdb0ae2..1d870dc3dfaa 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -113,7 +113,7 @@ struct tlock *TxLock; /* transaction lock table */
/*
* transaction management lock
*/
-static spinlock_t jfsTxnLock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(jfsTxnLock);
#define TXN_LOCK() spin_lock(&jfsTxnLock)
#define TXN_UNLOCK() spin_unlock(&jfsTxnLock)
diff --git a/fs/libfs.c b/fs/libfs.c
index 141533232c62..f90b29595927 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -418,7 +418,7 @@ out:
return -ENOMEM;
}
-static spinlock_t pin_fs_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(pin_fs_lock);
int simple_pin_fs(char *name, struct vfsmount **mount, int *count)
{
@@ -476,7 +476,7 @@ ssize_t simple_read_from_buffer(void __user *to, size_t count, loff_t *ppos,
char *simple_transaction_get(struct file *file, const char __user *buf, size_t size)
{
struct simple_transaction_argresp *ar;
- static spinlock_t simple_transaction_lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(simple_transaction_lock);
if (size > SIMPLE_TRANSACTION_LIMIT - 1)
return ERR_PTR(-EFBIG);
diff --git a/fs/mbcache.c b/fs/mbcache.c
index 20f7d36ceab4..695541ae36dc 100644
--- a/fs/mbcache.c
+++ b/fs/mbcache.c
@@ -99,7 +99,7 @@ struct mb_cache {
static LIST_HEAD(mb_cache_list);
static LIST_HEAD(mb_cache_lru_list);
-static spinlock_t mb_cache_spinlock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(mb_cache_spinlock);
static struct shrinker *mb_shrinker;
static inline int
diff --git a/fs/minix/itree_common.c b/fs/minix/itree_common.c
index 7f2e5d5c6249..429baf8de105 100644
--- a/fs/minix/itree_common.c
+++ b/fs/minix/itree_common.c
@@ -6,7 +6,7 @@ typedef struct {
struct buffer_head *bh;
} Indirect;
-static rwlock_t pointers_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(pointers_lock);
static inline void add_chain(Indirect *p, struct buffer_head *bh, block_t *v)
{
diff --git a/fs/namespace.c b/fs/namespace.c
index 1538b02a99cd..755b081c0bd2 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -37,7 +37,7 @@ static inline int sysfs_init(void)
#endif
/* spinlock for vfsmount related operations, inplace of dcache_lock */
-spinlock_t vfsmount_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
+ __cacheline_aligned_in_smp DEFINE_SPINLOCK(vfsmount_lock);
static struct list_head *mount_hashtable;
static int hash_mask, hash_bits;
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 4136e49a2d91..67b0f4898490 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -51,7 +51,7 @@
#define OPENOWNER_POOL_SIZE 8
-static spinlock_t state_spinlock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(state_spinlock);
nfs4_stateid zero_stateid;
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 9ab14f56d216..a3236dfedf98 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -48,7 +48,7 @@ static int nfsd_cache_append(struct svc_rqst *rqstp, struct kvec *vec);
* A cache entry is "single use" if c_state == RC_INPROG
* Otherwise, it when accessing _prev or _next, the lock must be held.
*/
-static spinlock_t cache_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(cache_lock);
void
nfsd_cache_init(void)
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index fe03e31f20b9..291dd8cd3214 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -54,7 +54,7 @@ struct timeval nfssvc_boot;
static struct svc_serv *nfsd_serv;
static atomic_t nfsd_busy;
static unsigned long nfsd_last_call;
-static spinlock_t nfsd_call_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(nfsd_call_lock);
struct nfsd_list {
struct list_head list;
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 308feda1effc..f7ad9f759f83 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -737,7 +737,7 @@ nfsd_sync_dir(struct dentry *dp)
* Obtain the readahead parameters for the file
* specified by (dev, ino).
*/
-static spinlock_t ra_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(ra_lock);
static inline struct raparms *
nfsd_get_raparms(dev_t dev, ino_t ino)
diff --git a/fs/nls/nls_base.c b/fs/nls/nls_base.c
index 07b8bea20dc2..897512796edb 100644
--- a/fs/nls/nls_base.c
+++ b/fs/nls/nls_base.c
@@ -21,7 +21,7 @@
static struct nls_table default_table;
static struct nls_table *tables = &default_table;
-static spinlock_t nls_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(nls_lock);
/*
* Sample implementation from Unicode home page.
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c
index 488fac1e9985..45d56e41ed98 100644
--- a/fs/ntfs/aops.c
+++ b/fs/ntfs/aops.c
@@ -55,7 +55,7 @@
*/
static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)
{
- static spinlock_t page_uptodate_lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(page_uptodate_lock);
unsigned long flags;
struct buffer_head *tmp;
struct page *page;
diff --git a/fs/ntfs/compress.c b/fs/ntfs/compress.c
index e3c47229b26b..ee5ae706f861 100644
--- a/fs/ntfs/compress.c
+++ b/fs/ntfs/compress.c
@@ -62,7 +62,7 @@ static u8 *ntfs_compression_buffer = NULL;
/**
* ntfs_cb_lock - spinlock which protects ntfs_compression_buffer
*/
-static spinlock_t ntfs_cb_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(ntfs_cb_lock);
/**
* allocate_compression_buffers - allocate the decompression buffers
diff --git a/fs/ntfs/debug.c b/fs/ntfs/debug.c
index e43c5ff09e45..7d1308626722 100644
--- a/fs/ntfs/debug.c
+++ b/fs/ntfs/debug.c
@@ -26,7 +26,7 @@
* to protect concurrent accesses to it.
*/
static char err_buf[1024];
-static spinlock_t err_buf_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(err_buf_lock);
/**
* __ntfs_warning - output a warning to the syslog
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 1e97c99bc4e0..83a9bfea1d3f 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -286,7 +286,7 @@ static int xlate_proc_name(const char *name,
}
static DEFINE_IDR(proc_inum_idr);
-static spinlock_t proc_inum_lock = SPIN_LOCK_UNLOCKED; /* protects the above */
+static DEFINE_SPINLOCK(proc_inum_lock); /* protects the above */
#define PROC_DYNAMIC_FIRST 0xF0000000UL
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index 0a71cf365ed8..5ab9c2aca0f9 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -54,7 +54,7 @@ struct memelfnote
};
static struct kcore_list *kclist;
-static rwlock_t kclist_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(kclist_lock);
void
kclist_add(struct kcore_list *new, void *addr, size_t size)
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 66a4b254eb6c..0b1247c4750b 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -1152,7 +1152,7 @@ out:
/* This is the implementation for the xattr plugin infrastructure */
static struct list_head xattr_handlers = LIST_HEAD_INIT (xattr_handlers);
-static rwlock_t handler_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(handler_lock);
static struct reiserfs_xattr_handler *
find_xattr_handler_prefix (const char *prefix)
diff --git a/fs/smbfs/smbiod.c b/fs/smbfs/smbiod.c
index 0dd22bc4c14c..481a97a423fa 100644
--- a/fs/smbfs/smbiod.c
+++ b/fs/smbfs/smbiod.c
@@ -43,7 +43,7 @@ static enum smbiod_state smbiod_state = SMBIOD_DEAD;
static pid_t smbiod_pid;
static DECLARE_WAIT_QUEUE_HEAD(smbiod_wait);
static LIST_HEAD(smb_servers);
-static spinlock_t servers_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(servers_lock);
#define SMBIOD_DATA_READY (1<<0)
static long smbiod_flags;
diff --git a/fs/super.c b/fs/super.c
index c9759926918a..785bc1ffcc60 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -45,7 +45,7 @@ void put_filesystem(struct file_system_type *fs);
struct file_system_type *get_fs_type(const char *name);
LIST_HEAD(super_blocks);
-spinlock_t sb_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(sb_lock);
/**
* alloc_super - create new superblock
@@ -590,7 +590,7 @@ void emergency_remount(void)
*/
static struct idr unnamed_dev_idr;
-static spinlock_t unnamed_dev_lock = SPIN_LOCK_UNLOCKED;/* protects the above */
+static DEFINE_SPINLOCK(unnamed_dev_lock);/* protects the above */
int set_anon_super(struct super_block *s, void *data)
{
diff --git a/fs/sysv/itree.c b/fs/sysv/itree.c
index ab086b5ede07..86f5f8d43d0f 100644
--- a/fs/sysv/itree.c
+++ b/fs/sysv/itree.c
@@ -61,7 +61,7 @@ typedef struct {
struct buffer_head *bh;
} Indirect;
-static rwlock_t pointers_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(pointers_lock);
static inline void add_chain(Indirect *p, struct buffer_head *bh, sysv_zone_t *v)
{
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index d5e75e606d1a..471a8dc3a8c6 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -168,7 +168,7 @@ typedef struct a_list {
STATIC a_list_t *as_free_head;
STATIC int as_list_len;
-STATIC spinlock_t as_lock = SPIN_LOCK_UNLOCKED;
+STATIC DEFINE_SPINLOCK(as_lock);
/*
* Try to batch vunmaps because they are costly.
@@ -1593,7 +1593,7 @@ error:
*/
STATIC LIST_HEAD(pbd_delwrite_queue);
-STATIC spinlock_t pbd_delwrite_lock = SPIN_LOCK_UNLOCKED;
+STATIC DEFINE_SPINLOCK(pbd_delwrite_lock);
STATIC void
pagebuf_delwri_queue(
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c
index d85452f9c04f..fdc2c191d124 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.c
+++ b/fs/xfs/linux-2.6/xfs_vnode.c
@@ -34,7 +34,7 @@
uint64_t vn_generation; /* vnode generation number */
-spinlock_t vnumber_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(vnumber_lock);
/*
* Dedicated vnode inactive/reclaim sync semaphores.
diff --git a/fs/xfs/support/debug.c b/fs/xfs/support/debug.c
index 2e5a3e97b41e..7d6e1f37df10 100644
--- a/fs/xfs/support/debug.c
+++ b/fs/xfs/support/debug.c
@@ -38,7 +38,7 @@
int doass = 1;
static char message[256]; /* keep it off the stack */
-static spinlock_t xfs_err_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(xfs_err_lock);
/* Translate from CE_FOO to KERN_FOO, err_level(CE_FOO) == KERN_FOO */
#define XFS_MAX_ERR_LEVEL 7