diff options
author | Alan Cox <alan@redhat.com> | 2008-06-11 16:07:52 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2008-07-16 17:27:03 -0400 |
commit | 52d11025dba32bed696eaee1822b26529e764770 (patch) | |
tree | 2f7e5094656216c7a12dbcae08ef0cc4fd270dac /kernel | |
parent | ebb12db51f6c13b30752fcf506baad4c617b153c (diff) |
snapshot: Push BKL down into ioctl handlers
Push BKL down into ioctl handlers - snapshot device.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/power/user.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c index f5512cb3aa86..658262b15994 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/console.h> | 23 | #include <linux/console.h> |
24 | #include <linux/cpu.h> | 24 | #include <linux/cpu.h> |
25 | #include <linux/freezer.h> | 25 | #include <linux/freezer.h> |
26 | #include <linux/smp_lock.h> | ||
26 | 27 | ||
27 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
28 | 29 | ||
@@ -164,8 +165,8 @@ static ssize_t snapshot_write(struct file *filp, const char __user *buf, | |||
164 | return res; | 165 | return res; |
165 | } | 166 | } |
166 | 167 | ||
167 | static int snapshot_ioctl(struct inode *inode, struct file *filp, | 168 | static long snapshot_ioctl(struct file *filp, unsigned int cmd, |
168 | unsigned int cmd, unsigned long arg) | 169 | unsigned long arg) |
169 | { | 170 | { |
170 | int error = 0; | 171 | int error = 0; |
171 | struct snapshot_data *data; | 172 | struct snapshot_data *data; |
@@ -181,6 +182,8 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, | |||
181 | 182 | ||
182 | data = filp->private_data; | 183 | data = filp->private_data; |
183 | 184 | ||
185 | lock_kernel(); | ||
186 | |||
184 | switch (cmd) { | 187 | switch (cmd) { |
185 | 188 | ||
186 | case SNAPSHOT_FREEZE: | 189 | case SNAPSHOT_FREEZE: |
@@ -389,7 +392,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, | |||
389 | error = -ENOTTY; | 392 | error = -ENOTTY; |
390 | 393 | ||
391 | } | 394 | } |
392 | 395 | unlock_kernel(); | |
393 | return error; | 396 | return error; |
394 | } | 397 | } |
395 | 398 | ||
@@ -399,7 +402,7 @@ static const struct file_operations snapshot_fops = { | |||
399 | .read = snapshot_read, | 402 | .read = snapshot_read, |
400 | .write = snapshot_write, | 403 | .write = snapshot_write, |
401 | .llseek = no_llseek, | 404 | .llseek = no_llseek, |
402 | .ioctl = snapshot_ioctl, | 405 | .unlocked_ioctl = snapshot_ioctl, |
403 | }; | 406 | }; |
404 | 407 | ||
405 | static struct miscdevice snapshot_device = { | 408 | static struct miscdevice snapshot_device = { |