Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chris
Cam Test
Commits
5a3233e3
Commit
5a3233e3
authored
11 years ago
by
Pranav Vashi
Committed by
hellsgod
11 years ago
Browse files
Options
Download
Email Patches
Plain Diff
epoll: switch simple cases of fget_light to fdget
Signed-off-by:
Pranav Vashi
<
neobuddy89@gmail.com
>
parent
eb6a12c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
fs/eventpoll.c
fs/eventpoll.c
+10
-15
No files found.
fs/eventpoll.c
View file @
5a3233e3
...
@@ -1831,8 +1831,8 @@ error_return:
...
@@ -1831,8 +1831,8 @@ error_return:
SYSCALL_DEFINE4
(
epoll_wait
,
int
,
epfd
,
struct
epoll_event
__user
*
,
events
,
SYSCALL_DEFINE4
(
epoll_wait
,
int
,
epfd
,
struct
epoll_event
__user
*
,
events
,
int
,
maxevents
,
int
,
timeout
)
int
,
maxevents
,
int
,
timeout
)
{
{
int
error
,
fput_needed
;
int
error
;
struct
f
ile
*
file
;
struct
f
d
f
;
struct
eventpoll
*
ep
;
struct
eventpoll
*
ep
;
/* The maximum number of event must be greater than zero */
/* The maximum number of event must be greater than zero */
...
@@ -1840,38 +1840,33 @@ SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events,
...
@@ -1840,38 +1840,33 @@ SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events,
return
-
EINVAL
;
return
-
EINVAL
;
/* Verify that the area passed by the user is writeable */
/* Verify that the area passed by the user is writeable */
if
(
!
access_ok
(
VERIFY_WRITE
,
events
,
maxevents
*
sizeof
(
struct
epoll_event
)))
{
if
(
!
access_ok
(
VERIFY_WRITE
,
events
,
maxevents
*
sizeof
(
struct
epoll_event
)))
error
=
-
EFAULT
;
return
-
EFAULT
;
goto
error_return
;
}
/* Get the "struct file *" for the eventpoll file */
/* Get the "struct file *" for the eventpoll file */
error
=
-
EBADF
;
f
=
fdget
(
epfd
);
file
=
fget_light
(
epfd
,
&
fput_needed
);
if
(
!
f
.
file
)
if
(
!
file
)
return
-
EBADF
;
goto
error_return
;
/*
/*
* We have to check that the file structure underneath the fd
* We have to check that the file structure underneath the fd
* the user passed to us _is_ an eventpoll file.
* the user passed to us _is_ an eventpoll file.
*/
*/
error
=
-
EINVAL
;
error
=
-
EINVAL
;
if
(
!
is_file_epoll
(
file
))
if
(
!
is_file_epoll
(
f
.
file
))
goto
error_fput
;
goto
error_fput
;
/*
/*
* At this point it is safe to assume that the "private_data" contains
* At this point it is safe to assume that the "private_data" contains
* our own data structure.
* our own data structure.
*/
*/
ep
=
file
->
private_data
;
ep
=
f
.
file
->
private_data
;
/* Time to fish for events ... */
/* Time to fish for events ... */
error
=
ep_poll
(
ep
,
events
,
maxevents
,
timeout
);
error
=
ep_poll
(
ep
,
events
,
maxevents
,
timeout
);
error_fput:
error_fput:
fput_light
(
file
,
fput_needed
);
fdput
(
f
);
error_return:
return
error
;
return
error
;
}
}
...
...
This diff is collapsed.
Click to expand it.
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