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
3f4d5a00
Commit
3f4d5a00
authored
Mar 14, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tidy do_dentry_open() up a bit
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
83f936c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
fs/open.c
fs/open.c
+10
-12
No files found.
fs/open.c
View file @
3f4d5a00
...
...
@@ -656,30 +656,28 @@ static int do_dentry_open(struct file *f,
f
->
f_mode
=
OPEN_FMODE
(
f
->
f_flags
)
|
FMODE_LSEEK
|
FMODE_PREAD
|
FMODE_PWRITE
;
if
(
unlikely
(
f
->
f_flags
&
O_PATH
))
f
->
f_mode
=
FMODE_PATH
;
path_get
(
&
f
->
f_path
);
inode
=
f
->
f_inode
=
f
->
f_path
.
dentry
->
d_inode
;
f
->
f_mapping
=
inode
->
i_mapping
;
if
(
unlikely
(
f
->
f_flags
&
O_PATH
))
{
f
->
f_mode
=
FMODE_PATH
;
f
->
f_op
=
&
empty_fops
;
return
0
;
}
if
(
f
->
f_mode
&
FMODE_WRITE
&&
!
special_file
(
inode
->
i_mode
))
{
error
=
get_write_access
(
inode
);
if
(
error
)
if
(
unlikely
(
error
)
)
goto
cleanup_file
;
error
=
__mnt_want_write
(
f
->
f_path
.
mnt
);
if
(
error
)
{
if
(
unlikely
(
error
)
)
{
put_write_access
(
inode
);
goto
cleanup_file
;
}
f
->
f_mode
|=
FMODE_WRITER
;
}
f
->
f_mapping
=
inode
->
i_mapping
;
if
(
unlikely
(
f
->
f_mode
&
FMODE_PATH
))
{
f
->
f_op
=
&
empty_fops
;
return
0
;
}
/* POSIX.1-2008/SUSv4 Section XSI 2.9.7 */
if
(
S_ISREG
(
inode
->
i_mode
))
f
->
f_mode
|=
FMODE_ATOMIC_POS
;
...
...
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