Commit a2fea16f authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Linus Torvalds

[PATCH] Lock initializer cleanup: Block devices

Use the new lock initializers DEFINE_SPIN_LOCK and DEFINE_RW_LOCK
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f8ac5fa6
......@@ -250,7 +250,7 @@ static int CurrentNReq;
static int CurrentNSect;
static char *CurrentBuffer;
static spinlock_t acsi_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(acsi_lock);
#define SET_TIMER() mod_timer(&acsi_timer, jiffies + ACSI_TIMEOUT)
......
......@@ -163,7 +163,7 @@ static int writepending;
static int writefromint;
static char *raw_buf;
static spinlock_t amiflop_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(amiflop_lock);
#define RAW_BUF_SIZE 30000 /* size of raw disk data */
......
......@@ -140,7 +140,7 @@ static int StartDiskType[] = {
static int DriveType = TYPE_HD;
static spinlock_t ataflop_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(ataflop_lock);
/* Array for translating minors into disk formats */
static struct {
......
......@@ -37,7 +37,7 @@
#include <asm/uaccess.h>
static spinlock_t elv_list_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(elv_list_lock);
static LIST_HEAD(elv_list);
/*
......
......@@ -216,7 +216,7 @@ static int use_virtual_dma;
* record each buffers capabilities
*/
static spinlock_t floppy_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(floppy_lock);
static struct completion device_release;
static unsigned short virtual_dma_port = 0x3f0;
......@@ -1072,7 +1072,7 @@ static int fd_wait_for_completion(unsigned long delay, timeout_fn function)
return 0;
}
static spinlock_t floppy_hlt_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(floppy_hlt_lock);
static int hlt_disabled;
static void floppy_disable_hlt(void)
{
......@@ -4415,7 +4415,7 @@ int __init floppy_init(void)
return err;
}
static spinlock_t floppy_usage_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(floppy_usage_lock);
static int floppy_grab_irq_and_dma(void)
{
......
......@@ -92,7 +92,7 @@ static struct nbd_device nbd_dev[MAX_NBD];
* a single lock.
* Thanks go to Jens Axboe and Al Viro for their LKML emails explaining this!
*/
static spinlock_t nbd_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(nbd_lock);
#ifndef NDEBUG
static const char *ioctl_cmd_to_ascii(int cmd)
......
......@@ -46,7 +46,7 @@ MODULE_LICENSE("GPL");
static struct pi_protocol *protocols[MAX_PROTOS];
static spinlock_t pi_spinlock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(pi_spinlock);
void pi_write_regr(PIA * pi, int cont, int regr, int val)
{
......
......@@ -155,7 +155,7 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_GEO, D_SBY, D_DLY, D_SLV};
#include <linux/sched.h>
#include <linux/workqueue.h>
static spinlock_t pd_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(pd_lock);
#ifndef MODULE
......
......@@ -43,7 +43,7 @@ static unsigned long ps_timeout;
static int ps_tq_active = 0;
static int ps_nice = 0;
static spinlock_t ps_spinlock __attribute__((unused)) = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(ps_spinlock __attribute__((unused)));
static DECLARE_WORK(ps_tq, ps_tq_int, NULL);
......
......@@ -108,7 +108,7 @@ static int intg_esdi = 0; /* If integrated adapter */
struct ps2esdi_i_struct {
unsigned int head, sect, cyl, wpcom, lzone, ctl;
};
static spinlock_t ps2esdi_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(ps2esdi_lock);
static struct request_queue *ps2esdi_queue;
static struct request *current_req;
......
......@@ -206,7 +206,7 @@ struct floppy_state {
static struct floppy_state floppy_states[MAX_FLOPPIES];
static int floppy_count = 0;
static spinlock_t swim3_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(swim3_lock);
static unsigned short write_preamble[] = {
0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, /* gap field */
......
......@@ -76,7 +76,7 @@ static struct swim_iop_req *current_req;
static int floppy_count;
static struct floppy_state floppy_states[MAX_FLOPPIES];
static spinlock_t swim_iop_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(swim_iop_lock);
#define CURRENT elv_next_request(swim_queue)
......
......@@ -336,7 +336,7 @@ MODULE_DEVICE_TABLE(usb, ub_usb_ids);
*/
#define UB_MAX_HOSTS 26
static char ub_hostv[UB_MAX_HOSTS];
static spinlock_t ub_lock = SPIN_LOCK_UNLOCKED; /* Locks globals and ->openc */
static DEFINE_SPINLOCK(ub_lock); /* Locks globals and ->openc */
/*
* The SCSI command tracing procedures.
......
......@@ -72,7 +72,7 @@ enum {
MAX_DISK_NAME = sizeof(((struct gendisk *)0)->disk_name)
};
static spinlock_t viodasd_spinlock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(viodasd_spinlock);
#define VIOMAXREQ 16
#define VIOMAXBLOCKDMA 12
......
......@@ -123,7 +123,7 @@ static unsigned int xd_bases[] __initdata =
0xE0000
};
static spinlock_t xd_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(xd_lock);
static struct gendisk *xd_gendisk[2];
......
......@@ -65,7 +65,7 @@ static int chip_count = 0;
static int list_count = 0;
static int current_device = -1;
static spinlock_t z2ram_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(z2ram_lock);
static struct block_device_operations z2_fops;
static struct gendisk *z2ram_gendisk;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment