mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
AoE: cdev lock_kernel() pushdown
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
parent
764a4a8e54
commit
579174a55f
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue