Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
72b67048
Commit
72b67048
authored
May 15, 2008
by
Jonathan Corbet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UBI: cdev lock_kernel() pushdown
Signed-off-by:
Jonathan Corbet
<
corbet@lwn.net
>
parent
6071239e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
drivers/mtd/ubi/cdev.c
drivers/mtd/ubi/cdev.c
+6
-1
No files found.
drivers/mtd/ubi/cdev.c
View file @
72b67048
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
#include <linux/stat.h>
#include <linux/stat.h>
#include <linux/ioctl.h>
#include <linux/ioctl.h>
#include <linux/capability.h>
#include <linux/capability.h>
#include <linux/smp_lock.h>
#include <mtd/ubi-user.h>
#include <mtd/ubi-user.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
#include <asm/div64.h>
#include <asm/div64.h>
...
@@ -103,9 +104,12 @@ static int vol_cdev_open(struct inode *inode, struct file *file)
...
@@ -103,9 +104,12 @@ static int vol_cdev_open(struct inode *inode, struct file *file)
struct
ubi_volume_desc
*
desc
;
struct
ubi_volume_desc
*
desc
;
int
vol_id
=
iminor
(
inode
)
-
1
,
mode
,
ubi_num
;
int
vol_id
=
iminor
(
inode
)
-
1
,
mode
,
ubi_num
;
lock_kernel
();
ubi_num
=
ubi_major2num
(
imajor
(
inode
));
ubi_num
=
ubi_major2num
(
imajor
(
inode
));
if
(
ubi_num
<
0
)
if
(
ubi_num
<
0
)
{
unlock_kernel
();
return
ubi_num
;
return
ubi_num
;
}
if
(
file
->
f_mode
&
FMODE_WRITE
)
if
(
file
->
f_mode
&
FMODE_WRITE
)
mode
=
UBI_READWRITE
;
mode
=
UBI_READWRITE
;
...
@@ -115,6 +119,7 @@ static int vol_cdev_open(struct inode *inode, struct file *file)
...
@@ -115,6 +119,7 @@ static int vol_cdev_open(struct inode *inode, struct file *file)
dbg_msg
(
"open volume %d, mode %d"
,
vol_id
,
mode
);
dbg_msg
(
"open volume %d, mode %d"
,
vol_id
,
mode
);
desc
=
ubi_open_volume
(
ubi_num
,
vol_id
,
mode
);
desc
=
ubi_open_volume
(
ubi_num
,
vol_id
,
mode
);
unlock_kernel
();
if
(
IS_ERR
(
desc
))
if
(
IS_ERR
(
desc
))
return
PTR_ERR
(
desc
);
return
PTR_ERR
(
desc
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment