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
6e8a1f87
Commit
6e8a1f87
authored
Feb 22, 2015
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch path_init() to struct filename
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
668696dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
fs/namei.c
fs/namei.c
+8
-8
No files found.
fs/namei.c
View file @
6e8a1f87
...
@@ -1848,7 +1848,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
...
@@ -1848,7 +1848,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
return
err
;
return
err
;
}
}
static
int
path_init
(
int
dfd
,
const
char
*
name
,
unsigned
int
flags
,
static
int
path_init
(
int
dfd
,
const
struct
filename
*
name
,
unsigned
int
flags
,
struct
nameidata
*
nd
)
struct
nameidata
*
nd
)
{
{
int
retval
=
0
;
int
retval
=
0
;
...
@@ -1860,7 +1860,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
...
@@ -1860,7 +1860,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
if
(
flags
&
LOOKUP_ROOT
)
{
if
(
flags
&
LOOKUP_ROOT
)
{
struct
dentry
*
root
=
nd
->
root
.
dentry
;
struct
dentry
*
root
=
nd
->
root
.
dentry
;
struct
inode
*
inode
=
root
->
d_inode
;
struct
inode
*
inode
=
root
->
d_inode
;
if
(
*
name
)
{
if
(
name
->
name
[
0
]
)
{
if
(
!
d_can_lookup
(
root
))
if
(
!
d_can_lookup
(
root
))
return
-
ENOTDIR
;
return
-
ENOTDIR
;
retval
=
inode_permission
(
inode
,
MAY_EXEC
);
retval
=
inode_permission
(
inode
,
MAY_EXEC
);
...
@@ -1882,7 +1882,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
...
@@ -1882,7 +1882,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
nd
->
root
.
mnt
=
NULL
;
nd
->
root
.
mnt
=
NULL
;
nd
->
m_seq
=
read_seqbegin
(
&
mount_lock
);
nd
->
m_seq
=
read_seqbegin
(
&
mount_lock
);
if
(
*
name
==
'/'
)
{
if
(
name
->
name
[
0
]
==
'/'
)
{
if
(
flags
&
LOOKUP_RCU
)
{
if
(
flags
&
LOOKUP_RCU
)
{
rcu_read_lock
();
rcu_read_lock
();
nd
->
seq
=
set_root_rcu
(
nd
);
nd
->
seq
=
set_root_rcu
(
nd
);
...
@@ -1916,7 +1916,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
...
@@ -1916,7 +1916,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
dentry
=
f
.
file
->
f_path
.
dentry
;
dentry
=
f
.
file
->
f_path
.
dentry
;
if
(
*
name
)
{
if
(
name
->
name
[
0
]
)
{
if
(
!
d_can_lookup
(
dentry
))
{
if
(
!
d_can_lookup
(
dentry
))
{
fdput
(
f
);
fdput
(
f
);
return
-
ENOTDIR
;
return
-
ENOTDIR
;
...
@@ -1946,7 +1946,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
...
@@ -1946,7 +1946,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
return
-
ECHILD
;
return
-
ECHILD
;
done:
done:
current
->
total_link_count
=
0
;
current
->
total_link_count
=
0
;
return
link_path_walk
(
name
,
nd
);
return
link_path_walk
(
name
->
name
,
nd
);
}
}
static
void
path_cleanup
(
struct
nameidata
*
nd
)
static
void
path_cleanup
(
struct
nameidata
*
nd
)
...
@@ -1989,7 +1989,7 @@ static int path_lookupat(int dfd, const struct filename *name,
...
@@ -1989,7 +1989,7 @@ static int path_lookupat(int dfd, const struct filename *name,
* be handled by restarting a traditional ref-walk (which will always
* be handled by restarting a traditional ref-walk (which will always
* be able to complete).
* be able to complete).
*/
*/
err
=
path_init
(
dfd
,
name
->
name
,
flags
,
nd
);
err
=
path_init
(
dfd
,
name
,
flags
,
nd
);
if
(
!
err
&&
!
(
flags
&
LOOKUP_PARENT
))
{
if
(
!
err
&&
!
(
flags
&
LOOKUP_PARENT
))
{
err
=
lookup_last
(
nd
,
&
path
);
err
=
lookup_last
(
nd
,
&
path
);
while
(
err
>
0
)
{
while
(
err
>
0
)
{
...
@@ -2343,7 +2343,7 @@ path_mountpoint(int dfd, const struct filename *name, struct path *path,
...
@@ -2343,7 +2343,7 @@ path_mountpoint(int dfd, const struct filename *name, struct path *path,
struct
nameidata
nd
;
struct
nameidata
nd
;
int
err
;
int
err
;
err
=
path_init
(
dfd
,
name
->
name
,
flags
,
&
nd
);
err
=
path_init
(
dfd
,
name
,
flags
,
&
nd
);
if
(
unlikely
(
err
))
if
(
unlikely
(
err
))
goto
out
;
goto
out
;
...
@@ -3226,7 +3226,7 @@ static struct file *path_openat(int dfd, struct filename *pathname,
...
@@ -3226,7 +3226,7 @@ static struct file *path_openat(int dfd, struct filename *pathname,
goto
out
;
goto
out
;
}
}
error
=
path_init
(
dfd
,
pathname
->
name
,
flags
,
nd
);
error
=
path_init
(
dfd
,
pathname
,
flags
,
nd
);
if
(
unlikely
(
error
))
if
(
unlikely
(
error
))
goto
out
;
goto
out
;
...
...
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