Commit 52d11025 authored by Alan Cox's avatar Alan Cox Committed by Andi Kleen

snapshot: Push BKL down into ioctl handlers

Push BKL down into ioctl handlers - snapshot device.
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
parent ebb12db5
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/console.h> #include <linux/console.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <linux/freezer.h> #include <linux/freezer.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -164,8 +165,8 @@ static ssize_t snapshot_write(struct file *filp, const char __user *buf, ...@@ -164,8 +165,8 @@ static ssize_t snapshot_write(struct file *filp, const char __user *buf,
return res; return res;
} }
static int snapshot_ioctl(struct inode *inode, struct file *filp, static long snapshot_ioctl(struct file *filp, unsigned int cmd,
unsigned int cmd, unsigned long arg) unsigned long arg)
{ {
int error = 0; int error = 0;
struct snapshot_data *data; struct snapshot_data *data;
...@@ -181,6 +182,8 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, ...@@ -181,6 +182,8 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
data = filp->private_data; data = filp->private_data;
lock_kernel();
switch (cmd) { switch (cmd) {
case SNAPSHOT_FREEZE: case SNAPSHOT_FREEZE:
...@@ -389,7 +392,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, ...@@ -389,7 +392,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
error = -ENOTTY; error = -ENOTTY;
} }
unlock_kernel();
return error; return error;
} }
...@@ -399,7 +402,7 @@ static const struct file_operations snapshot_fops = { ...@@ -399,7 +402,7 @@ static const struct file_operations snapshot_fops = {
.read = snapshot_read, .read = snapshot_read,
.write = snapshot_write, .write = snapshot_write,
.llseek = no_llseek, .llseek = no_llseek,
.ioctl = snapshot_ioctl, .unlocked_ioctl = snapshot_ioctl,
}; };
static struct miscdevice snapshot_device = { static struct miscdevice snapshot_device = {
......
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