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
322ea0bb
Commit
322ea0bb
authored
Mar 24, 2016
by
Al Viro
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtd: switch ubi_open_volume_path() to vfs_stat()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
87f15d4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
drivers/mtd/ubi/kapi.c
drivers/mtd/ubi/kapi.c
+8
-11
No files found.
drivers/mtd/ubi/kapi.c
View file @
322ea0bb
...
...
@@ -301,27 +301,24 @@ EXPORT_SYMBOL_GPL(ubi_open_volume_nm);
*/
struct
ubi_volume_desc
*
ubi_open_volume_path
(
const
char
*
pathname
,
int
mode
)
{
int
error
,
ubi_num
,
vol_id
,
mod
;
struct
inode
*
inode
;
struct
path
path
;
int
error
,
ubi_num
,
vol_id
;
struct
kstat
stat
;
dbg_gen
(
"open volume %s, mode %d"
,
pathname
,
mode
);
if
(
!
pathname
||
!*
pathname
)
return
ERR_PTR
(
-
EINVAL
);
error
=
kern_path
(
pathname
,
LOOKUP_FOLLOW
,
&
path
);
error
=
vfs_stat
(
pathname
,
&
stat
);
if
(
error
)
return
ERR_PTR
(
error
);
inode
=
d_backing_inode
(
path
.
dentry
);
mod
=
inode
->
i_mode
;
ubi_num
=
ubi_major2num
(
imajor
(
inode
));
vol_id
=
iminor
(
inode
)
-
1
;
path_put
(
&
path
);
if
(
!
S_ISCHR
(
mod
))
if
(
!
S_ISCHR
(
stat
.
mode
))
return
ERR_PTR
(
-
EINVAL
);
ubi_num
=
ubi_major2num
(
MAJOR
(
stat
.
rdev
));
vol_id
=
MINOR
(
stat
.
rdev
)
-
1
;
if
(
vol_id
>=
0
&&
ubi_num
>=
0
)
return
ubi_open_volume
(
ubi_num
,
vol_id
,
mode
);
return
ERR_PTR
(
-
ENODEV
);
...
...
Kirill Smelkov
@kirr
mentioned in commit
ad022c87
·
Feb 26, 2017
mentioned in commit
ad022c87
mentioned in commit ad022c87187b50f50937bd9bcd1ef312442a89af
Toggle commit list
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