Commit 579174a5 authored by Jonathan Corbet's avatar Jonathan Corbet

AoE: cdev lock_kernel() pushdown

Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 764a4a8e
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <linux/hdreg.h> #include <linux/hdreg.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/smp_lock.h>
#include "aoe.h" #include "aoe.h"
enum { enum {
...@@ -174,12 +175,16 @@ aoechr_open(struct inode *inode, struct file *filp) ...@@ -174,12 +175,16 @@ aoechr_open(struct inode *inode, struct file *filp)
{ {
int n, i; int n, i;
lock_kernel();
n = iminor(inode); n = iminor(inode);
filp->private_data = (void *) (unsigned long) n; filp->private_data = (void *) (unsigned long) n;
for (i = 0; i < ARRAY_SIZE(chardevs); ++i) for (i = 0; i < ARRAY_SIZE(chardevs); ++i)
if (chardevs[i].minor == n) if (chardevs[i].minor == n) {
unlock_kernel();
return 0; return 0;
}
unlock_kernel();
return -EINVAL; return -EINVAL;
} }
......
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