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
a1e28038
Commit
a1e28038
authored
Dec 24, 2009
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pull the common predecessors into do_last()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
c41c1405
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
fs/namei.c
fs/namei.c
+9
-12
No files found.
fs/namei.c
View file @
a1e28038
...
@@ -1648,13 +1648,19 @@ static struct file *finish_open(struct nameidata *nd,
...
@@ -1648,13 +1648,19 @@ static struct file *finish_open(struct nameidata *nd,
static
struct
file
*
do_last
(
struct
nameidata
*
nd
,
struct
path
*
path
,
static
struct
file
*
do_last
(
struct
nameidata
*
nd
,
struct
path
*
path
,
int
open_flag
,
int
flag
,
int
acc_mode
,
int
open_flag
,
int
flag
,
int
acc_mode
,
int
mode
,
const
char
*
pathname
,
int
mode
,
const
char
*
pathname
,
struct
dentry
*
dir
,
int
*
is_link
)
int
*
is_link
)
{
{
struct
dentry
*
dir
=
nd
->
path
.
dentry
;
struct
file
*
filp
;
struct
file
*
filp
;
int
error
;
int
error
;
*
is_link
=
0
;
*
is_link
=
0
;
mutex_lock
(
&
dir
->
d_inode
->
i_mutex
);
path
->
dentry
=
lookup_hash
(
nd
);
path
->
mnt
=
nd
->
path
.
mnt
;
error
=
PTR_ERR
(
path
->
dentry
);
error
=
PTR_ERR
(
path
->
dentry
);
if
(
IS_ERR
(
path
->
dentry
))
{
if
(
IS_ERR
(
path
->
dentry
))
{
mutex_unlock
(
&
dir
->
d_inode
->
i_mutex
);
mutex_unlock
(
&
dir
->
d_inode
->
i_mutex
);
...
@@ -1749,7 +1755,6 @@ struct file *do_filp_open(int dfd, const char *pathname,
...
@@ -1749,7 +1755,6 @@ struct file *do_filp_open(int dfd, const char *pathname,
struct
nameidata
nd
;
struct
nameidata
nd
;
int
error
;
int
error
;
struct
path
path
;
struct
path
path
;
struct
dentry
*
dir
;
int
count
=
0
;
int
count
=
0
;
int
flag
=
open_to_namei_flags
(
open_flag
);
int
flag
=
open_to_namei_flags
(
open_flag
);
int
force_reval
=
0
;
int
force_reval
=
0
;
...
@@ -1837,16 +1842,12 @@ struct file *do_filp_open(int dfd, const char *pathname,
...
@@ -1837,16 +1842,12 @@ struct file *do_filp_open(int dfd, const char *pathname,
filp
->
f_flags
=
open_flag
;
filp
->
f_flags
=
open_flag
;
nd
.
intent
.
open
.
flags
=
flag
;
nd
.
intent
.
open
.
flags
=
flag
;
nd
.
intent
.
open
.
create_mode
=
mode
;
nd
.
intent
.
open
.
create_mode
=
mode
;
dir
=
nd
.
path
.
dentry
;
nd
.
flags
&=
~
LOOKUP_PARENT
;
nd
.
flags
&=
~
LOOKUP_PARENT
;
nd
.
flags
|=
LOOKUP_CREATE
|
LOOKUP_OPEN
;
nd
.
flags
|=
LOOKUP_CREATE
|
LOOKUP_OPEN
;
if
(
flag
&
O_EXCL
)
if
(
flag
&
O_EXCL
)
nd
.
flags
|=
LOOKUP_EXCL
;
nd
.
flags
|=
LOOKUP_EXCL
;
mutex_lock
(
&
dir
->
d_inode
->
i_mutex
);
path
.
dentry
=
lookup_hash
(
&
nd
);
path
.
mnt
=
nd
.
path
.
mnt
;
filp
=
do_last
(
&
nd
,
&
path
,
open_flag
,
flag
,
acc_mode
,
mode
,
filp
=
do_last
(
&
nd
,
&
path
,
open_flag
,
flag
,
acc_mode
,
mode
,
pathname
,
dir
,
&
is_link
);
pathname
,
&
is_link
);
if
(
is_link
)
if
(
is_link
)
goto
do_link
;
goto
do_link
;
if
(
nd
.
root
.
mnt
)
if
(
nd
.
root
.
mnt
)
...
@@ -1919,12 +1920,8 @@ struct file *do_filp_open(int dfd, const char *pathname,
...
@@ -1919,12 +1920,8 @@ struct file *do_filp_open(int dfd, const char *pathname,
__putname
(
nd
.
last
.
name
);
__putname
(
nd
.
last
.
name
);
goto
exit
;
goto
exit
;
}
}
dir
=
nd
.
path
.
dentry
;
mutex_lock
(
&
dir
->
d_inode
->
i_mutex
);
path
.
dentry
=
lookup_hash
(
&
nd
);
path
.
mnt
=
nd
.
path
.
mnt
;
filp
=
do_last
(
&
nd
,
&
path
,
open_flag
,
flag
,
acc_mode
,
mode
,
filp
=
do_last
(
&
nd
,
&
path
,
open_flag
,
flag
,
acc_mode
,
mode
,
pathname
,
dir
,
&
is_link
);
pathname
,
&
is_link
);
__putname
(
nd
.
last
.
name
);
__putname
(
nd
.
last
.
name
);
if
(
is_link
)
if
(
is_link
)
goto
do_link
;
goto
do_link
;
...
...
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