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
nexedi
linux
Commits
545ec2c7
Commit
545ec2c7
authored
Apr 21, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch fcntl to fget_raw_light/fput_light
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
7449af1e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
25 deletions
+17
-25
fs/fcntl.c
fs/fcntl.c
+17
-25
No files found.
fs/fcntl.c
View file @
545ec2c7
...
...
@@ -442,28 +442,24 @@ static int check_fcntl_cmd(unsigned cmd)
SYSCALL_DEFINE3
(
fcntl
,
unsigned
int
,
fd
,
unsigned
int
,
cmd
,
unsigned
long
,
arg
)
{
struct
file
*
filp
;
int
fput_needed
;
long
err
=
-
EBADF
;
filp
=
fget_raw
(
f
d
);
filp
=
fget_raw
_light
(
fd
,
&
fput_neede
d
);
if
(
!
filp
)
goto
out
;
if
(
unlikely
(
filp
->
f_mode
&
FMODE_PATH
))
{
if
(
!
check_fcntl_cmd
(
cmd
))
{
fput
(
filp
);
goto
out
;
}
if
(
!
check_fcntl_cmd
(
cmd
))
goto
out1
;
}
err
=
security_file_fcntl
(
filp
,
cmd
,
arg
);
if
(
err
)
{
fput
(
filp
);
return
err
;
}
if
(
!
err
)
err
=
do_fcntl
(
fd
,
cmd
,
arg
,
filp
);
fput
(
filp
);
out1:
fput_light
(
filp
,
fput_needed
);
out:
return
err
;
}
...
...
@@ -473,26 +469,21 @@ SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
unsigned
long
,
arg
)
{
struct
file
*
filp
;
long
err
;
long
err
=
-
EBADF
;
int
fput_needed
;
err
=
-
EBADF
;
filp
=
fget_raw
(
fd
);
filp
=
fget_raw_light
(
fd
,
&
fput_needed
);
if
(
!
filp
)
goto
out
;
if
(
unlikely
(
filp
->
f_mode
&
FMODE_PATH
))
{
if
(
!
check_fcntl_cmd
(
cmd
))
{
fput
(
filp
);
goto
out
;
}
if
(
!
check_fcntl_cmd
(
cmd
))
goto
out1
;
}
err
=
security_file_fcntl
(
filp
,
cmd
,
arg
);
if
(
err
)
{
fput
(
filp
);
return
err
;
}
err
=
-
EBADF
;
if
(
err
)
goto
out1
;
switch
(
cmd
)
{
case
F_GETLK64
:
...
...
@@ -507,7 +498,8 @@ SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
err
=
do_fcntl
(
fd
,
cmd
,
arg
,
filp
);
break
;
}
fput
(
filp
);
out1:
fput_light
(
filp
,
fput_needed
);
out:
return
err
;
}
...
...
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