summaryrefslogtreecommitdiffstats
path: root/fs/select.c
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2006-03-28 11:56:34 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-28 19:16:04 +0200
commite4a1f129f9e43a5e5d28fe6d1b214246a398cdce (patch)
tree9a8277520d5ef1bf8e86f11d76e6f0244efd9330 /fs/select.c
parent[PATCH] Optimize select/poll by putting small data sets on the stack (diff)
downloadlinux-e4a1f129f9e43a5e5d28fe6d1b214246a398cdce.tar.xz
linux-e4a1f129f9e43a5e5d28fe6d1b214246a398cdce.zip
[PATCH] use fget_light() in select/poll
Cc: Andi Kleen <ak@muc.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to '')
-rw-r--r--fs/select.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/select.c b/fs/select.c
index d8b4f0722b8d..05cd199a1127 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -231,17 +231,18 @@ int do_select(int n, fd_set_bits *fds, s64 *timeout)
}
for (j = 0; j < __NFDBITS; ++j, ++i, bit <<= 1) {
+ int fput_needed;
if (i >= n)
break;
if (!(bit & all_bits))
continue;
- file = fget(i);
+ file = fget_light(i, &fput_needed);
if (file) {
f_op = file->f_op;
mask = DEFAULT_POLLMASK;
if (f_op && f_op->poll)
mask = (*f_op->poll)(file, retval ? NULL : wait);
- fput(file);
+ fput_light(file, fput_needed);
if ((mask & POLLIN_SET) && (in & bit)) {
res_in |= bit;
retval++;
@@ -557,14 +558,15 @@ static void do_pollfd(unsigned int num, struct pollfd * fdpage,
fdp = fdpage+i;
fd = fdp->fd;
if (fd >= 0) {
- struct file * file = fget(fd);
+ int fput_needed;
+ struct file * file = fget_light(fd, &fput_needed);
mask = POLLNVAL;
if (file != NULL) {
mask = DEFAULT_POLLMASK;
if (file->f_op && file->f_op->poll)
mask = file->f_op->poll(file, *pwait);
mask &= fdp->events | POLLERR | POLLHUP;
- fput(file);
+ fput_light(file, fput_needed);
}
if (mask) {
*pwait = NULL;