X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Ffcntl.c;h=31836ec2045990cd632525fde47f3b0211dd2f98;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=2aa5db702ce5c173c7dfc1a93a79fbaf08876486;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/fs/fcntl.c b/fs/fcntl.c index 2aa5db702..31836ec20 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -75,8 +75,8 @@ repeat: * orig_start..fdt->next_fd */ start = orig_start; - if (start < files->next_fd) - start = files->next_fd; + if (start < fdt->next_fd) + start = fdt->next_fd; newfd = start; if (start < fdt->max_fdset) { @@ -106,8 +106,9 @@ repeat: * we reacquire the fdtable pointer and use it while holding * the lock, no one can free it during that time. */ - if (start <= files->next_fd) - files->next_fd = newfd + 1; + fdt = files_fdtable(files); + if (start <= fdt->next_fd) + fdt->next_fd = newfd + 1; error = newfd; @@ -115,7 +116,7 @@ out: return error; } -int dupfd(struct file *file, unsigned int start) +static int dupfd(struct file *file, unsigned int start) { struct files_struct * files = current->files; struct fdtable *fdt; @@ -139,8 +140,6 @@ int dupfd(struct file *file, unsigned int start) return fd; } -EXPORT_SYMBOL_GPL(dupfd); - asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd) { int err = -EBADF; @@ -422,7 +421,7 @@ out: /* Table to convert sigio signal codes into poll band bitmaps */ -static const long band_table[NSIGPOLL] = { +static long band_table[NSIGPOLL] = { POLLIN | POLLRDNORM, /* POLL_IN */ POLLOUT | POLLWRNORM | POLLWRBAND, /* POLL_OUT */ POLLIN | POLLRDNORM | POLLMSG, /* POLL_MSG */ @@ -463,7 +462,8 @@ static void send_sigio_to_task(struct task_struct *p, /* Make sure we are called with one of the POLL_* reasons, otherwise we could leak kernel stack into userspace. */ - BUG_ON((reason & __SI_MASK) != __SI_POLL); + if ((reason & __SI_MASK) != __SI_POLL) + BUG(); if (reason - POLL_IN >= NSIGPOLL) si.si_band = ~0L; else @@ -540,7 +540,7 @@ int send_sigurg(struct fown_struct *fown) } static DEFINE_RWLOCK(fasync_lock); -static kmem_cache_t *fasync_cache __read_mostly; +static kmem_cache_t *fasync_cache; /* * fasync_helper() is used by some character device drivers (mainly mice)