Commit bb57c3ed authored by Davide Libenzi's avatar Davide Libenzi Committed by Linus Torvalds

epoll: remove debugging code

Remove debugging code from epoll.  There's no need for it to be included
into mainline code.
Signed-off-by: default avatarDavide Libenzi <davidel@xmailserver.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 296e236e
...@@ -71,24 +71,6 @@ ...@@ -71,24 +71,6 @@
* a better scalability. * a better scalability.
*/ */
#define DEBUG_EPOLL 0
#if DEBUG_EPOLL > 0
#define DPRINTK(x) printk x
#define DNPRINTK(n, x) do { if ((n) <= DEBUG_EPOLL) printk x; } while (0)
#else /* #if DEBUG_EPOLL > 0 */
#define DPRINTK(x) (void) 0
#define DNPRINTK(n, x) (void) 0
#endif /* #if DEBUG_EPOLL > 0 */
#define DEBUG_EPI 0
#if DEBUG_EPI != 0
#define EPI_SLAB_DEBUG (SLAB_DEBUG_FREE | SLAB_RED_ZONE /* | SLAB_POISON */)
#else /* #if DEBUG_EPI != 0 */
#define EPI_SLAB_DEBUG 0
#endif /* #if DEBUG_EPI != 0 */
/* Epoll private bits inside the event mask */ /* Epoll private bits inside the event mask */
#define EP_PRIVATE_BITS (EPOLLONESHOT | EPOLLET) #define EP_PRIVATE_BITS (EPOLLONESHOT | EPOLLET)
...@@ -567,9 +549,6 @@ static int ep_remove(struct eventpoll *ep, struct epitem *epi) ...@@ -567,9 +549,6 @@ static int ep_remove(struct eventpoll *ep, struct epitem *epi)
atomic_dec(&ep->user->epoll_watches); atomic_dec(&ep->user->epoll_watches);
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_remove(%p, %p)\n",
current, ep, file));
return 0; return 0;
} }
...@@ -625,7 +604,6 @@ static int ep_eventpoll_release(struct inode *inode, struct file *file) ...@@ -625,7 +604,6 @@ static int ep_eventpoll_release(struct inode *inode, struct file *file)
if (ep) if (ep)
ep_free(ep); ep_free(ep);
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: close() ep=%p\n", current, ep));
return 0; return 0;
} }
...@@ -750,8 +728,6 @@ static int ep_alloc(struct eventpoll **pep) ...@@ -750,8 +728,6 @@ static int ep_alloc(struct eventpoll **pep)
*pep = ep; *pep = ep;
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_alloc() ep=%p\n",
current, ep));
return 0; return 0;
free_uid: free_uid:
...@@ -785,9 +761,6 @@ static struct epitem *ep_find(struct eventpoll *ep, struct file *file, int fd) ...@@ -785,9 +761,6 @@ static struct epitem *ep_find(struct eventpoll *ep, struct file *file, int fd)
} }
} }
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_find(%p) -> %p\n",
current, file, epir));
return epir; return epir;
} }
...@@ -803,9 +776,6 @@ static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *k ...@@ -803,9 +776,6 @@ static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *k
struct epitem *epi = ep_item_from_wait(wait); struct epitem *epi = ep_item_from_wait(wait);
struct eventpoll *ep = epi->ep; struct eventpoll *ep = epi->ep;
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: poll_callback(%p) epi=%p ep=%p\n",
current, epi->ffd.file, epi, ep));
spin_lock_irqsave(&ep->lock, flags); spin_lock_irqsave(&ep->lock, flags);
/* /*
...@@ -978,9 +948,6 @@ static int ep_insert(struct eventpoll *ep, struct epoll_event *event, ...@@ -978,9 +948,6 @@ static int ep_insert(struct eventpoll *ep, struct epoll_event *event,
if (pwake) if (pwake)
ep_poll_safewake(&ep->poll_wait); ep_poll_safewake(&ep->poll_wait);
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_insert(%p, %p, %d)\n",
current, ep, tfile, fd));
return 0; return 0;
error_unregister: error_unregister:
...@@ -1197,41 +1164,30 @@ retry: ...@@ -1197,41 +1164,30 @@ retry:
*/ */
SYSCALL_DEFINE1(epoll_create1, int, flags) SYSCALL_DEFINE1(epoll_create1, int, flags)
{ {
int error, fd = -1; int error;
struct eventpoll *ep; struct eventpoll *ep = NULL;
/* Check the EPOLL_* constant for consistency. */ /* Check the EPOLL_* constant for consistency. */
BUILD_BUG_ON(EPOLL_CLOEXEC != O_CLOEXEC); BUILD_BUG_ON(EPOLL_CLOEXEC != O_CLOEXEC);
if (flags & ~EPOLL_CLOEXEC) if (flags & ~EPOLL_CLOEXEC)
return -EINVAL; return -EINVAL;
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d)\n",
current, flags));
/* /*
* Create the internal data structure ( "struct eventpoll" ). * Create the internal data structure ("struct eventpoll").
*/ */
error = ep_alloc(&ep); error = ep_alloc(&ep);
if (error < 0) { if (error < 0)
fd = error; return error;
goto error_return;
}
/* /*
* Creates all the items needed to setup an eventpoll file. That is, * Creates all the items needed to setup an eventpoll file. That is,
* a file structure and a free file descriptor. * a file structure and a free file descriptor.
*/ */
fd = anon_inode_getfd("[eventpoll]", &eventpoll_fops, ep, error = anon_inode_getfd("[eventpoll]", &eventpoll_fops, ep,
flags & O_CLOEXEC); flags & O_CLOEXEC);
if (fd < 0) if (error < 0)
ep_free(ep); ep_free(ep);
error_return: return error;
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d) = %d\n",
current, flags, fd));
return fd;
} }
SYSCALL_DEFINE1(epoll_create, int, size) SYSCALL_DEFINE1(epoll_create, int, size)
...@@ -1256,9 +1212,6 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, ...@@ -1256,9 +1212,6 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
struct epitem *epi; struct epitem *epi;
struct epoll_event epds; struct epoll_event epds;
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_ctl(%d, %d, %d, %p)\n",
current, epfd, op, fd, event));
error = -EFAULT; error = -EFAULT;
if (ep_op_has_event(op) && if (ep_op_has_event(op) &&
copy_from_user(&epds, event, sizeof(struct epoll_event))) copy_from_user(&epds, event, sizeof(struct epoll_event)))
...@@ -1335,8 +1288,6 @@ error_tgt_fput: ...@@ -1335,8 +1288,6 @@ error_tgt_fput:
error_fput: error_fput:
fput(file); fput(file);
error_return: error_return:
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_ctl(%d, %d, %d, %p) = %d\n",
current, epfd, op, fd, event, error));
return error; return error;
} }
...@@ -1352,9 +1303,6 @@ SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events, ...@@ -1352,9 +1303,6 @@ SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events,
struct file *file; struct file *file;
struct eventpoll *ep; struct eventpoll *ep;
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_wait(%d, %p, %d, %d)\n",
current, epfd, events, maxevents, timeout));
/* The maximum number of event must be greater than zero */ /* The maximum number of event must be greater than zero */
if (maxevents <= 0 || maxevents > EP_MAX_EVENTS) if (maxevents <= 0 || maxevents > EP_MAX_EVENTS)
return -EINVAL; return -EINVAL;
...@@ -1391,8 +1339,6 @@ SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events, ...@@ -1391,8 +1339,6 @@ SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events,
error_fput: error_fput:
fput(file); fput(file);
error_return: error_return:
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_wait(%d, %p, %d, %d) = %d\n",
current, epfd, events, maxevents, timeout, error));
return error; return error;
} }
...@@ -1464,13 +1410,11 @@ static int __init eventpoll_init(void) ...@@ -1464,13 +1410,11 @@ static int __init eventpoll_init(void)
/* Allocates slab cache used to allocate "struct epitem" items */ /* Allocates slab cache used to allocate "struct epitem" items */
epi_cache = kmem_cache_create("eventpoll_epi", sizeof(struct epitem), epi_cache = kmem_cache_create("eventpoll_epi", sizeof(struct epitem),
0, SLAB_HWCACHE_ALIGN|EPI_SLAB_DEBUG|SLAB_PANIC, 0, SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL);
NULL);
/* Allocates slab cache used to allocate "struct eppoll_entry" */ /* Allocates slab cache used to allocate "struct eppoll_entry" */
pwq_cache = kmem_cache_create("eventpoll_pwq", pwq_cache = kmem_cache_create("eventpoll_pwq",
sizeof(struct eppoll_entry), 0, sizeof(struct eppoll_entry), 0, SLAB_PANIC, NULL);
EPI_SLAB_DEBUG|SLAB_PANIC, NULL);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment