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
74eb8cc5
Commit
74eb8cc5
authored
Feb 23, 2015
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
namei.c: fold do_path_lookup() into both callers
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
fd2f7cb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
fs/namei.c
fs/namei.c
+24
-24
No files found.
fs/namei.c
View file @
74eb8cc5
...
...
@@ -2038,19 +2038,6 @@ static int filename_lookup(int dfd, struct filename *name,
return
retval
;
}
static
int
do_path_lookup
(
int
dfd
,
const
char
*
name
,
unsigned
int
flags
,
struct
nameidata
*
nd
)
{
struct
filename
*
filename
=
getname_kernel
(
name
);
int
retval
=
PTR_ERR
(
filename
);
if
(
!
IS_ERR
(
filename
))
{
retval
=
filename_lookup
(
dfd
,
filename
,
flags
,
nd
);
putname
(
filename
);
}
return
retval
;
}
/* does lookup, returns the object with parent locked */
struct
dentry
*
kern_path_locked
(
const
char
*
name
,
struct
path
*
path
)
{
...
...
@@ -2088,9 +2075,15 @@ struct dentry *kern_path_locked(const char *name, struct path *path)
int
kern_path
(
const
char
*
name
,
unsigned
int
flags
,
struct
path
*
path
)
{
struct
nameidata
nd
;
int
res
=
do_path_lookup
(
AT_FDCWD
,
name
,
flags
,
&
nd
);
if
(
!
res
)
*
path
=
nd
.
path
;
struct
filename
*
filename
=
getname_kernel
(
name
);
int
res
=
PTR_ERR
(
filename
);
if
(
!
IS_ERR
(
filename
))
{
res
=
filename_lookup
(
AT_FDCWD
,
filename
,
flags
,
&
nd
);
putname
(
filename
);
if
(
!
res
)
*
path
=
nd
.
path
;
}
return
res
;
}
EXPORT_SYMBOL
(
kern_path
);
...
...
@@ -2107,15 +2100,22 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt,
const
char
*
name
,
unsigned
int
flags
,
struct
path
*
path
)
{
struct
nameidata
nd
;
int
err
;
nd
.
root
.
dentry
=
dentry
;
nd
.
root
.
mnt
=
mnt
;
struct
filename
*
filename
=
getname_kernel
(
name
);
int
err
=
PTR_ERR
(
filename
);
BUG_ON
(
flags
&
LOOKUP_PARENT
);
/* the first argument of do_path_lookup() is ignored with LOOKUP_ROOT */
err
=
do_path_lookup
(
AT_FDCWD
,
name
,
flags
|
LOOKUP_ROOT
,
&
nd
);
if
(
!
err
)
*
path
=
nd
.
path
;
/* the first argument of filename_lookup() is ignored with LOOKUP_ROOT */
if
(
!
IS_ERR
(
filename
))
{
struct
nameidata
nd
;
nd
.
root
.
dentry
=
dentry
;
nd
.
root
.
mnt
=
mnt
;
err
=
filename_lookup
(
AT_FDCWD
,
filename
,
flags
|
LOOKUP_ROOT
,
&
nd
);
if
(
!
err
)
*
path
=
nd
.
path
;
putname
(
filename
);
}
return
err
;
}
EXPORT_SYMBOL
(
vfs_path_lookup
);
...
...
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