]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/power/user.c
snapshot: Push BKL down into ioctl handlers
[linux-2.6-omap-h63xx.git] / kernel / power / user.c
index f5512cb3aa86f61e98caec04c82a01a0dc9f6dcf..658262b15994a55585cfc2d6e3a7a709a37f15a7 100644 (file)
@@ -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 = {