public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] snapshot: Push BKL down into ioctl handlers
@ 2008-05-22 21:25 Alan Cox
  2008-05-23  1:09 ` Rafael J. Wysocki
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2008-05-22 21:25 UTC (permalink / raw)
  To: linux-kernel, akpm

Signed-off-by: Alan Cox <alan@redhat.com>

diff --git a/kernel/power/user.c b/kernel/power/user.c
index f5512cb..658262b 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -23,6 +23,7 @@
 #include <linux/console.h>
 #include <linux/cpu.h>
 #include <linux/freezer.h>
+#include <linux/smp_lock.h>
 
 #include <asm/uaccess.h>
 
@@ -164,8 +165,8 @@ static ssize_t snapshot_write(struct file *filp, const char __user *buf,
 	return res;
 }
 
-static int snapshot_ioctl(struct inode *inode, struct file *filp,
-                          unsigned int cmd, unsigned long arg)
+static long snapshot_ioctl(struct file *filp, unsigned int cmd,
+							unsigned long arg)
 {
 	int error = 0;
 	struct snapshot_data *data;
@@ -181,6 +182,8 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
 
 	data = filp->private_data;
 
+	lock_kernel();
+
 	switch (cmd) {
 
 	case SNAPSHOT_FREEZE:
@@ -389,7 +392,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
 		error = -ENOTTY;
 
 	}
-
+	unlock_kernel();
 	return error;
 }
 
@@ -399,7 +402,7 @@ static const struct file_operations snapshot_fops = {
 	.read = snapshot_read,
 	.write = snapshot_write,
 	.llseek = no_llseek,
-	.ioctl = snapshot_ioctl,
+	.unlocked_ioctl = snapshot_ioctl,
 };
 
 static struct miscdevice snapshot_device = {

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-06-03 22:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-22 21:25 [PATCH] snapshot: Push BKL down into ioctl handlers Alan Cox
2008-05-23  1:09 ` Rafael J. Wysocki
2008-05-23 11:04   ` Alan Cox
2008-05-23 11:22     ` Rafael J. Wysocki
2008-06-02 21:33       ` [RFC][PATCH] snapshot: Use pm_mutex for mutual exclusion Rafael J. Wysocki
2008-06-03 22:20         ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox