linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / fcntl.c
index 3b9ab5f..84d0e40 100644 (file)
@@ -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)