From 763b9638ee0f02a989438139c0ecec004ce194fc Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 11 Jun 2008 22:07:52 +0200 Subject: [PATCH] --- yaml --- r: 102006 b: refs/heads/master c: 52d11025dba32bed696eaee1822b26529e764770 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/power/user.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 4cb9435d8f1b..8564dd36dff9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ebb12db51f6c13b30752fcf506baad4c617b153c +refs/heads/master: 52d11025dba32bed696eaee1822b26529e764770 diff --git a/trunk/kernel/power/user.c b/trunk/kernel/power/user.c index f5512cb3aa86..658262b15994 100644 --- a/trunk/kernel/power/user.c +++ b/trunk/kernel/power/user.c @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -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 = {