X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Ffcntl.c;fp=fs%2Ffcntl.c;h=84d0e40daea07ae438a7be4fe2e0b116bc122210;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=3b9ab5fd51367f1b42cdc063d1da7c334e745571;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/fs/fcntl.c b/fs/fcntl.c index 3b9ab5fd5..84d0e40da 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -74,8 +74,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) { @@ -105,8 +105,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; @@ -114,7 +115,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; @@ -138,8 +139,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; @@ -421,7 +420,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 */ @@ -462,7 +461,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 @@ -538,10 +538,8 @@ int send_sigurg(struct fown_struct *fown) return ret; } -EXPORT_SYMBOL(send_sigurg); - 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)