Skip to content

Commit

Permalink
AoE: cdev lock_kernel() pushdown
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent 764a4a8 commit 579174a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/block/aoe/aoechr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 579174a

Please sign in to comment.