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
d465887f
Commit
d465887f
authored
Nov 20, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/namei.c: fold link_path_walk() call into path_init()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
980f3ea2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
21 deletions
+6
-21
fs/namei.c
fs/namei.c
+6
-21
No files found.
fs/namei.c
View file @
d465887f
...
@@ -1873,7 +1873,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
...
@@ -1873,7 +1873,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
}
else
{
}
else
{
path_get
(
&
nd
->
path
);
path_get
(
&
nd
->
path
);
}
}
return
0
;
goto
done
;
}
}
nd
->
root
.
mnt
=
NULL
;
nd
->
root
.
mnt
=
NULL
;
...
@@ -1934,13 +1934,16 @@ static int path_init(int dfd, const char *name, unsigned int flags,
...
@@ -1934,13 +1934,16 @@ static int path_init(int dfd, const char *name, unsigned int flags,
nd
->
inode
=
nd
->
path
.
dentry
->
d_inode
;
nd
->
inode
=
nd
->
path
.
dentry
->
d_inode
;
if
(
!
(
flags
&
LOOKUP_RCU
))
if
(
!
(
flags
&
LOOKUP_RCU
))
return
0
;
goto
done
;
if
(
likely
(
!
read_seqcount_retry
(
&
nd
->
path
.
dentry
->
d_seq
,
nd
->
seq
)))
if
(
likely
(
!
read_seqcount_retry
(
&
nd
->
path
.
dentry
->
d_seq
,
nd
->
seq
)))
return
0
;
goto
done
;
if
(
!
(
nd
->
flags
&
LOOKUP_ROOT
))
if
(
!
(
nd
->
flags
&
LOOKUP_ROOT
))
nd
->
root
.
mnt
=
NULL
;
nd
->
root
.
mnt
=
NULL
;
rcu_read_unlock
();
rcu_read_unlock
();
return
-
ECHILD
;
return
-
ECHILD
;
done:
current
->
total_link_count
=
0
;
return
link_path_walk
(
name
,
nd
);
}
}
static
void
path_cleanup
(
struct
nameidata
*
nd
)
static
void
path_cleanup
(
struct
nameidata
*
nd
)
...
@@ -1984,13 +1987,6 @@ static int path_lookupat(int dfd, const char *name,
...
@@ -1984,13 +1987,6 @@ static int path_lookupat(int dfd, const char *name,
* be able to complete).
* be able to complete).
*/
*/
err
=
path_init
(
dfd
,
name
,
flags
,
nd
);
err
=
path_init
(
dfd
,
name
,
flags
,
nd
);
if
(
unlikely
(
err
))
goto
out
;
current
->
total_link_count
=
0
;
err
=
link_path_walk
(
name
,
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
)
{
...
@@ -2018,7 +2014,6 @@ static int path_lookupat(int dfd, const char *name,
...
@@ -2018,7 +2014,6 @@ static int path_lookupat(int dfd, const char *name,
}
}
}
}
out:
path_cleanup
(
nd
);
path_cleanup
(
nd
);
return
err
;
return
err
;
}
}
...
@@ -2333,11 +2328,6 @@ path_mountpoint(int dfd, const char *name, struct path *path, unsigned int flags
...
@@ -2333,11 +2328,6 @@ path_mountpoint(int dfd, const char *name, struct path *path, unsigned int flags
if
(
unlikely
(
err
))
if
(
unlikely
(
err
))
goto
out
;
goto
out
;
current
->
total_link_count
=
0
;
err
=
link_path_walk
(
name
,
&
nd
);
if
(
err
)
goto
out
;
err
=
mountpoint_last
(
&
nd
,
path
);
err
=
mountpoint_last
(
&
nd
,
path
);
while
(
err
>
0
)
{
while
(
err
>
0
)
{
void
*
cookie
;
void
*
cookie
;
...
@@ -3224,11 +3214,6 @@ static struct file *path_openat(int dfd, struct filename *pathname,
...
@@ -3224,11 +3214,6 @@ static struct file *path_openat(int dfd, struct filename *pathname,
if
(
unlikely
(
error
))
if
(
unlikely
(
error
))
goto
out
;
goto
out
;
current
->
total_link_count
=
0
;
error
=
link_path_walk
(
pathname
->
name
,
nd
);
if
(
unlikely
(
error
))
goto
out
;
error
=
do_last
(
nd
,
&
path
,
file
,
op
,
&
opened
,
pathname
);
error
=
do_last
(
nd
,
&
path
,
file
,
op
,
&
opened
,
pathname
);
while
(
unlikely
(
error
>
0
))
{
/* trailing symlink */
while
(
unlikely
(
error
>
0
))
{
/* trailing symlink */
struct
path
link
=
path
;
struct
path
link
=
path
;
...
...
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