Skip to content

Commit bb57c3e

Browse files
davideltorvalds
authored andcommitted
epoll: remove debugging code
Remove debugging code from epoll. There's no need for it to be included into mainline code. Signed-off-by: Davide Libenzi <davidel@xmailserver.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 296e236 commit bb57c3e

File tree

1 file changed

+11
-67
lines changed

1 file changed

+11
-67
lines changed

fs/eventpoll.c

+11-67
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,6 @@
7171
* a better scalability.
7272
*/
7373

74-
#define DEBUG_EPOLL 0
75-
76-
#if DEBUG_EPOLL > 0
77-
#define DPRINTK(x) printk x
78-
#define DNPRINTK(n, x) do { if ((n) <= DEBUG_EPOLL) printk x; } while (0)
79-
#else /* #if DEBUG_EPOLL > 0 */
80-
#define DPRINTK(x) (void) 0
81-
#define DNPRINTK(n, x) (void) 0
82-
#endif /* #if DEBUG_EPOLL > 0 */
83-
84-
#define DEBUG_EPI 0
85-
86-
#if DEBUG_EPI != 0
87-
#define EPI_SLAB_DEBUG (SLAB_DEBUG_FREE | SLAB_RED_ZONE /* | SLAB_POISON */)
88-
#else /* #if DEBUG_EPI != 0 */
89-
#define EPI_SLAB_DEBUG 0
90-
#endif /* #if DEBUG_EPI != 0 */
91-
9274
/* Epoll private bits inside the event mask */
9375
#define EP_PRIVATE_BITS (EPOLLONESHOT | EPOLLET)
9476

@@ -567,9 +549,6 @@ static int ep_remove(struct eventpoll *ep, struct epitem *epi)
567549

568550
atomic_dec(&ep->user->epoll_watches);
569551

570-
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_remove(%p, %p)\n",
571-
current, ep, file));
572-
573552
return 0;
574553
}
575554

@@ -625,7 +604,6 @@ static int ep_eventpoll_release(struct inode *inode, struct file *file)
625604
if (ep)
626605
ep_free(ep);
627606

628-
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: close() ep=%p\n", current, ep));
629607
return 0;
630608
}
631609

@@ -750,8 +728,6 @@ static int ep_alloc(struct eventpoll **pep)
750728

751729
*pep = ep;
752730

753-
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_alloc() ep=%p\n",
754-
current, ep));
755731
return 0;
756732

757733
free_uid:
@@ -785,9 +761,6 @@ static struct epitem *ep_find(struct eventpoll *ep, struct file *file, int fd)
785761
}
786762
}
787763

788-
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_find(%p) -> %p\n",
789-
current, file, epir));
790-
791764
return epir;
792765
}
793766

@@ -803,9 +776,6 @@ static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *k
803776
struct epitem *epi = ep_item_from_wait(wait);
804777
struct eventpoll *ep = epi->ep;
805778

806-
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: poll_callback(%p) epi=%p ep=%p\n",
807-
current, epi->ffd.file, epi, ep));
808-
809779
spin_lock_irqsave(&ep->lock, flags);
810780

811781
/*
@@ -978,9 +948,6 @@ static int ep_insert(struct eventpoll *ep, struct epoll_event *event,
978948
if (pwake)
979949
ep_poll_safewake(&ep->poll_wait);
980950

981-
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_insert(%p, %p, %d)\n",
982-
current, ep, tfile, fd));
983-
984951
return 0;
985952

986953
error_unregister:
@@ -1197,41 +1164,30 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
11971164
*/
11981165
SYSCALL_DEFINE1(epoll_create1, int, flags)
11991166
{
1200-
int error, fd = -1;
1201-
struct eventpoll *ep;
1167+
int error;
1168+
struct eventpoll *ep = NULL;
12021169

12031170
/* Check the EPOLL_* constant for consistency. */
12041171
BUILD_BUG_ON(EPOLL_CLOEXEC != O_CLOEXEC);
12051172

12061173
if (flags & ~EPOLL_CLOEXEC)
12071174
return -EINVAL;
1208-
1209-
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d)\n",
1210-
current, flags));
1211-
12121175
/*
1213-
* Create the internal data structure ( "struct eventpoll" ).
1176+
* Create the internal data structure ("struct eventpoll").
12141177
*/
12151178
error = ep_alloc(&ep);
1216-
if (error < 0) {
1217-
fd = error;
1218-
goto error_return;
1219-
}
1220-
1179+
if (error < 0)
1180+
return error;
12211181
/*
12221182
* Creates all the items needed to setup an eventpoll file. That is,
12231183
* a file structure and a free file descriptor.
12241184
*/
1225-
fd = anon_inode_getfd("[eventpoll]", &eventpoll_fops, ep,
1226-
flags & O_CLOEXEC);
1227-
if (fd < 0)
1185+
error = anon_inode_getfd("[eventpoll]", &eventpoll_fops, ep,
1186+
flags & O_CLOEXEC);
1187+
if (error < 0)
12281188
ep_free(ep);
12291189

1230-
error_return:
1231-
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d) = %d\n",
1232-
current, flags, fd));
1233-
1234-
return fd;
1190+
return error;
12351191
}
12361192

12371193
SYSCALL_DEFINE1(epoll_create, int, size)
@@ -1256,9 +1212,6 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
12561212
struct epitem *epi;
12571213
struct epoll_event epds;
12581214

1259-
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_ctl(%d, %d, %d, %p)\n",
1260-
current, epfd, op, fd, event));
1261-
12621215
error = -EFAULT;
12631216
if (ep_op_has_event(op) &&
12641217
copy_from_user(&epds, event, sizeof(struct epoll_event)))
@@ -1335,8 +1288,6 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
13351288
error_fput:
13361289
fput(file);
13371290
error_return:
1338-
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_ctl(%d, %d, %d, %p) = %d\n",
1339-
current, epfd, op, fd, event, error));
13401291

13411292
return error;
13421293
}
@@ -1352,9 +1303,6 @@ SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events,
13521303
struct file *file;
13531304
struct eventpoll *ep;
13541305

1355-
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_wait(%d, %p, %d, %d)\n",
1356-
current, epfd, events, maxevents, timeout));
1357-
13581306
/* The maximum number of event must be greater than zero */
13591307
if (maxevents <= 0 || maxevents > EP_MAX_EVENTS)
13601308
return -EINVAL;
@@ -1391,8 +1339,6 @@ SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events,
13911339
error_fput:
13921340
fput(file);
13931341
error_return:
1394-
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_wait(%d, %p, %d, %d) = %d\n",
1395-
current, epfd, events, maxevents, timeout, error));
13961342

13971343
return error;
13981344
}
@@ -1464,13 +1410,11 @@ static int __init eventpoll_init(void)
14641410

14651411
/* Allocates slab cache used to allocate "struct epitem" items */
14661412
epi_cache = kmem_cache_create("eventpoll_epi", sizeof(struct epitem),
1467-
0, SLAB_HWCACHE_ALIGN|EPI_SLAB_DEBUG|SLAB_PANIC,
1468-
NULL);
1413+
0, SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL);
14691414

14701415
/* Allocates slab cache used to allocate "struct eppoll_entry" */
14711416
pwq_cache = kmem_cache_create("eventpoll_pwq",
1472-
sizeof(struct eppoll_entry), 0,
1473-
EPI_SLAB_DEBUG|SLAB_PANIC, NULL);
1417+
sizeof(struct eppoll_entry), 0, SLAB_PANIC, NULL);
14741418

14751419
return 0;
14761420
}

0 commit comments

Comments
 (0)