summaryrefslogtreecommitdiff
path: root/drivers/block/aoe/aoechr.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-15 20:03:09 +0400
committerJonathan Corbet <corbet@lwn.net>2008-06-21 00:03:43 +0400
commit579174a55f491edeaccb8f5d3dc7ad69a17f5423 (patch)
tree70c5392de4eba1999f999a258c53778f52454280 /drivers/block/aoe/aoechr.c
parent764a4a8e54cdd6efc5928f876aa9e35778f22377 (diff)
downloadlinux-579174a55f491edeaccb8f5d3dc7ad69a17f5423.tar.xz
AoE: cdev lock_kernel() pushdown
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/block/aoe/aoechr.c')
-rw-r--r--drivers/block/aoe/aoechr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c
index e8e60e7a2e70..d1de68a31920 100644
--- a/drivers/block/aoe/aoechr.c
+++ b/drivers/block/aoe/aoechr.c
@@ -7,6 +7,7 @@
#include <linux/hdreg.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
+#include <linux/smp_lock.h>
#include "aoe.h"
enum {
@@ -174,12 +175,16 @@ aoechr_open(struct inode *inode, struct file *filp)
{
int n, i;
+ lock_kernel();
n = iminor(inode);
filp->private_data = (void *) (unsigned long) n;
for (i = 0; i < ARRAY_SIZE(chardevs); ++i)
- if (chardevs[i].minor == n)
+ if (chardevs[i].minor == n) {
+ unlock_kernel();
return 0;
+ }
+ unlock_kernel();
return -EINVAL;
}