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
48358d93
Commit
48358d93
authored
Sep 08, 2003
by
Andries E. Brouwer
Committed by
Linus Torvalds
Sep 08, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse fix eventpoll
parent
48fcc4cc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
20 deletions
+28
-20
fs/eventpoll.c
fs/eventpoll.c
+24
-17
include/linux/eventpoll.h
include/linux/eventpoll.h
+4
-3
No files found.
fs/eventpoll.c
View file @
48358d93
...
...
@@ -288,8 +288,10 @@ static int ep_getfd(int *efd, struct inode **einode, struct file **efile);
static
int
ep_alloc_pages
(
char
**
pages
,
int
numpages
);
static
int
ep_free_pages
(
char
**
pages
,
int
numpages
);
static
int
ep_file_init
(
struct
file
*
file
,
unsigned
int
hashbits
);
static
unsigned
int
ep_hash_index
(
struct
eventpoll
*
ep
,
struct
file
*
file
,
int
fd
);
static
struct
list_head
*
ep_hash_entry
(
struct
eventpoll
*
ep
,
unsigned
int
index
);
static
unsigned
int
ep_hash_index
(
struct
eventpoll
*
ep
,
struct
file
*
file
,
int
fd
);
static
struct
list_head
*
ep_hash_entry
(
struct
eventpoll
*
ep
,
unsigned
int
index
);
static
int
ep_init
(
struct
eventpoll
*
ep
,
unsigned
int
hashbits
);
static
void
ep_free
(
struct
eventpoll
*
ep
);
static
struct
epitem
*
ep_find
(
struct
eventpoll
*
ep
,
struct
file
*
file
,
int
fd
);
...
...
@@ -299,7 +301,8 @@ static void ep_ptable_queue_proc(struct file *file, wait_queue_head_t *whead,
poll_table
*
pt
);
static
int
ep_insert
(
struct
eventpoll
*
ep
,
struct
epoll_event
*
event
,
struct
file
*
tfile
,
int
fd
);
static
int
ep_modify
(
struct
eventpoll
*
ep
,
struct
epitem
*
epi
,
struct
epoll_event
*
event
);
static
int
ep_modify
(
struct
eventpoll
*
ep
,
struct
epitem
*
epi
,
struct
epoll_event
*
event
);
static
void
ep_unregister_pollwait
(
struct
eventpoll
*
ep
,
struct
epitem
*
epi
);
static
int
ep_unlink
(
struct
eventpoll
*
ep
,
struct
epitem
*
epi
);
static
int
ep_remove
(
struct
eventpoll
*
ep
,
struct
epitem
*
epi
);
...
...
@@ -309,11 +312,12 @@ static unsigned int ep_eventpoll_poll(struct file *file, poll_table *wait);
static
int
ep_collect_ready_items
(
struct
eventpoll
*
ep
,
struct
list_head
*
txlist
,
int
maxevents
);
static
int
ep_send_events
(
struct
eventpoll
*
ep
,
struct
list_head
*
txlist
,
struct
epoll_event
*
events
);
struct
epoll_event
__user
*
events
);
static
void
ep_reinject_items
(
struct
eventpoll
*
ep
,
struct
list_head
*
txlist
);
static
int
ep_events_transfer
(
struct
eventpoll
*
ep
,
struct
epoll_event
*
events
,
int
maxevents
);
static
int
ep_poll
(
struct
eventpoll
*
ep
,
struct
epoll_event
*
events
,
struct
epoll_event
__user
*
events
,
int
maxevents
);
static
int
ep_poll
(
struct
eventpoll
*
ep
,
struct
epoll_event
__user
*
events
,
int
maxevents
,
long
timeout
);
static
int
eventpollfs_delete_dentry
(
struct
dentry
*
dentry
);
static
struct
inode
*
ep_eventpoll_inode
(
void
);
...
...
@@ -532,11 +536,13 @@ asmlinkage long sys_epoll_create(int size)
/*
* The following function implement the controller interface for the eventpoll
* file that enable the insertion/removal/change of file descriptors inside
* the interest set. It rapresents the kernel part of the user space epoll_ctl(2).
* The following function implements the controller interface for
* the eventpoll file that enables the insertion/removal/change of
* file descriptors inside the interest set. It represents
* the kernel part of the user space epoll_ctl(2).
*/
asmlinkage
long
sys_epoll_ctl
(
int
epfd
,
int
op
,
int
fd
,
struct
epoll_event
*
event
)
asmlinkage
long
sys_epoll_ctl
(
int
epfd
,
int
op
,
int
fd
,
struct
epoll_event
__user
*
event
)
{
int
error
;
struct
file
*
file
,
*
tfile
;
...
...
@@ -637,8 +643,8 @@ asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, struct epoll_event *even
* Implement the event wait interface for the eventpoll file. It is the kernel
* part of the user space epoll_wait(2).
*/
asmlinkage
long
sys_epoll_wait
(
int
epfd
,
struct
epoll_event
*
events
,
int
max
events
,
int
timeout
)
asmlinkage
long
sys_epoll_wait
(
int
epfd
,
struct
epoll_event
__user
*
events
,
int
maxevents
,
int
timeout
)
{
int
error
;
struct
file
*
file
;
...
...
@@ -662,7 +668,7 @@ asmlinkage long sys_epoll_wait(int epfd, struct epoll_event *events, int maxeven
goto
eexit_1
;
/*
* We have to check that the file structure underneath the f
ile descriptor
* We have to check that the file structure underneath the f
d
* the user passed to us _is_ an eventpoll file.
*/
error
=
-
EINVAL
;
...
...
@@ -1409,7 +1415,7 @@ static int ep_collect_ready_items(struct eventpoll *ep, struct list_head *txlist
* because of the way poll() is traditionally implemented in Linux.
*/
static
int
ep_send_events
(
struct
eventpoll
*
ep
,
struct
list_head
*
txlist
,
struct
epoll_event
*
events
)
struct
epoll_event
__user
*
events
)
{
int
eventcnt
=
0
,
eventbuf
=
0
;
unsigned
int
revents
;
...
...
@@ -1521,7 +1527,8 @@ static void ep_reinject_items(struct eventpoll *ep, struct list_head *txlist)
/*
* Perform the transfer of events to user space.
*/
static
int
ep_events_transfer
(
struct
eventpoll
*
ep
,
struct
epoll_event
*
events
,
int
maxevents
)
static
int
ep_events_transfer
(
struct
eventpoll
*
ep
,
struct
epoll_event
__user
*
events
,
int
maxevents
)
{
int
eventcnt
=
0
;
struct
list_head
txlist
;
...
...
@@ -1549,8 +1556,8 @@ static int ep_events_transfer(struct eventpoll *ep, struct epoll_event *events,
}
static
int
ep_poll
(
struct
eventpoll
*
ep
,
struct
epoll_event
*
events
,
int
max
events
,
long
timeout
)
static
int
ep_poll
(
struct
eventpoll
*
ep
,
struct
epoll_event
__user
*
events
,
int
maxevents
,
long
timeout
)
{
int
res
,
eavail
;
unsigned
long
flags
;
...
...
include/linux/eventpoll.h
View file @
48358d93
...
...
@@ -48,9 +48,10 @@ struct file;
/* Kernel space functions implementing the user space "epoll" API */
asmlinkage
long
sys_epoll_create
(
int
size
);
asmlinkage
long
sys_epoll_ctl
(
int
epfd
,
int
op
,
int
fd
,
struct
epoll_event
*
event
);
asmlinkage
long
sys_epoll_wait
(
int
epfd
,
struct
epoll_event
*
events
,
int
maxevents
,
int
timeout
);
asmlinkage
long
sys_epoll_ctl
(
int
epfd
,
int
op
,
int
fd
,
struct
epoll_event
__user
*
event
);
asmlinkage
long
sys_epoll_wait
(
int
epfd
,
struct
epoll_event
__user
*
events
,
int
maxevents
,
int
timeout
);
#ifdef CONFIG_EPOLL
...
...
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