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
2dd6d1f4
Commit
2dd6d1f4
authored
Aug 13, 2009
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kill path_lookup_open()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
3cac260a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
32 deletions
+16
-32
fs/namei.c
fs/namei.c
+16
-32
No files found.
fs/namei.c
View file @
2dd6d1f4
...
...
@@ -1124,36 +1124,6 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt,
return
retval
;
}
/**
* path_lookup_open - lookup a file path with open intent
* @dfd: the directory to use as base, or AT_FDCWD
* @name: pointer to file name
* @lookup_flags: lookup intent flags
* @nd: pointer to nameidata
* @open_flags: open intent flags
*/
static
int
path_lookup_open
(
int
dfd
,
const
char
*
name
,
unsigned
int
lookup_flags
,
struct
nameidata
*
nd
,
int
open_flags
)
{
struct
file
*
filp
=
get_empty_filp
();
int
err
;
if
(
filp
==
NULL
)
return
-
ENFILE
;
nd
->
intent
.
open
.
file
=
filp
;
nd
->
intent
.
open
.
flags
=
open_flags
;
nd
->
intent
.
open
.
create_mode
=
0
;
err
=
do_path_lookup
(
dfd
,
name
,
lookup_flags
|
LOOKUP_OPEN
,
nd
);
if
(
IS_ERR
(
nd
->
intent
.
open
.
file
))
{
if
(
err
==
0
)
{
err
=
PTR_ERR
(
nd
->
intent
.
open
.
file
);
path_put
(
&
nd
->
path
);
}
}
else
if
(
err
!=
0
)
release_open_intent
(
nd
);
return
err
;
}
static
struct
dentry
*
__lookup_hash
(
struct
qstr
*
name
,
struct
dentry
*
base
,
struct
nameidata
*
nd
)
{
...
...
@@ -1664,8 +1634,22 @@ struct file *do_filp_open(int dfd, const char *pathname,
* The simplest case - just a plain lookup.
*/
if
(
!
(
flag
&
O_CREAT
))
{
error
=
path_lookup_open
(
dfd
,
pathname
,
lookup_flags
(
flag
),
&
nd
,
flag
);
filp
=
get_empty_filp
();
if
(
filp
==
NULL
)
return
ERR_PTR
(
-
ENFILE
);
nd
.
intent
.
open
.
file
=
filp
;
nd
.
intent
.
open
.
flags
=
flag
;
nd
.
intent
.
open
.
create_mode
=
0
;
error
=
do_path_lookup
(
dfd
,
pathname
,
lookup_flags
(
flag
)
|
LOOKUP_OPEN
,
&
nd
);
if
(
IS_ERR
(
nd
.
intent
.
open
.
file
))
{
if
(
error
==
0
)
{
error
=
PTR_ERR
(
nd
.
intent
.
open
.
file
);
path_put
(
&
nd
.
path
);
}
}
else
if
(
error
)
release_open_intent
(
&
nd
);
if
(
error
)
return
ERR_PTR
(
error
);
goto
ok
;
...
...
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