summaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/harddog_kern.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-09-11 18:38:03 +0200
committerArnd Bergmann <arnd@arndb.de>2010-10-19 11:29:42 +0200
commit9a181c58617134822ae596339dbea076ef9b5cf7 (patch)
treeb90b52c0bcb4ae3057e5ddd403230415f4cb528a /arch/um/drivers/harddog_kern.c
parentparisc: remove big kernel lock (diff)
downloadlinux-9a181c58617134822ae596339dbea076ef9b5cf7.tar.xz
linux-9a181c58617134822ae596339dbea076ef9b5cf7.zip
uml: kill big kernel lock
Three uml device drivers still use the big kernel lock, but all of them can be safely converted to using a per-driver mutex instead. Most likely this is not even necessary, so after further review these can and should be removed as well. The exec system call no longer requires the BKL either, so remove it from there, too. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Jeff Dike <jdike@addtoit.com> Cc: user-mode-linux-devel@lists.sourceforge.net
Diffstat (limited to 'arch/um/drivers/harddog_kern.c')
-rw-r--r--arch/um/drivers/harddog_kern.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c
index cfcac1ff4cf2..86036276020f 100644
--- a/arch/um/drivers/harddog_kern.c
+++ b/arch/um/drivers/harddog_kern.c
@@ -42,7 +42,7 @@
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/reboot.h>
-#include <linux/smp_lock.h>
+#include <linux/mutex.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <asm/uaccess.h>
@@ -50,6 +50,7 @@
MODULE_LICENSE("GPL");
+static DEFINE_MUTEX(harddog_mutex);
static DEFINE_SPINLOCK(lock);
static int timer_alive;
static int harddog_in_fd = -1;
@@ -66,7 +67,7 @@ static int harddog_open(struct inode *inode, struct file *file)
int err = -EBUSY;
char *sock = NULL;
- lock_kernel();
+ mutex_lock(&harddog_mutex);
spin_lock(&lock);
if(timer_alive)
goto err;
@@ -83,11 +84,11 @@ static int harddog_open(struct inode *inode, struct file *file)
timer_alive = 1;
spin_unlock(&lock);
- unlock_kernel();
+ mutex_unlock(&harddog_mutex);
return nonseekable_open(inode, file);
err:
spin_unlock(&lock);
- unlock_kernel();
+ mutex_unlock(&harddog_mutex);
return err;
}
@@ -153,9 +154,9 @@ static long harddog_ioctl(struct file *file,
{
long ret;
- lock_kernel();
+ mutex_lock(&harddog_mutex);
ret = harddog_ioctl_unlocked(file, cmd, arg);
- unlock_kernel();
+ mutex_unlock(&harddog_mutex);
return ret;
}