linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / open.c
index bd7c18a..d92305b 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -27,8 +27,6 @@
 #include <linux/pagemap.h>
 #include <linux/syscalls.h>
 #include <linux/rcupdate.h>
-#include <linux/audit.h>
-#include <linux/vs_base.h>
 #include <linux/vs_limit.h>
 #include <linux/vs_dlimit.h>
 #include <linux/vserver/xid.h>
@@ -569,8 +567,6 @@ out:
        return error;
 }
 
-EXPORT_SYMBOL_GPL(sys_chdir);
-
 asmlinkage long sys_fchdir(unsigned int fd)
 {
        struct file *file;
@@ -627,8 +623,6 @@ out:
        return error;
 }
 
-EXPORT_SYMBOL_GPL(sys_chroot);
-
 asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
 {
        struct inode * inode;
@@ -644,8 +638,6 @@ asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
        dentry = file->f_dentry;
        inode = dentry->d_inode;
 
-       audit_inode(NULL, inode, 0);
-
        err = -EROFS;
        if (IS_RDONLY(inode) || MNT_IS_RDONLY(file->f_vfsmnt))
                goto out_putf;
@@ -796,10 +788,7 @@ asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group)
 
        file = fget(fd);
        if (file) {
-               struct dentry * dentry;
-               dentry = file->f_dentry;
-               audit_inode(NULL, dentry->d_inode, 0);
-               error = chown_common(dentry, file->f_vfsmnt, user, group);
+               error = chown_common(file->f_dentry, file->f_vfsmnt, user, group);
                fput(file);
        }
        return error;
@@ -914,10 +903,6 @@ EXPORT_SYMBOL(filp_open);
  * a fully instantiated struct file to the caller.
  * This function is meant to be called from within a filesystem's
  * lookup method.
- * Beware of calling it for non-regular files! Those ->open methods might block
- * (e.g. in fifo_open), leaving you with parent locked (and in case of fifo,
- * leading to a deadlock, as nobody can open that fifo anymore, because
- * another process to open fifo will block on locked parent when doing lookup).
  * Note that in case of error, nd->intent.open.file is destroyed, but the
  * path information remains valid.
  * If the open callback is set to NULL, then the standard f_op->open()
@@ -1001,7 +986,7 @@ repeat:
        fdt = files_fdtable(files);
        fd = find_next_zero_bit(fdt->open_fds->fds_bits,
                                fdt->max_fdset,
-                               files->next_fd);
+                               fdt->next_fd);
 
        /*
         * N.B. For clone tasks sharing a files structure, this test
@@ -1026,7 +1011,7 @@ repeat:
 
        FD_SET(fd, fdt->open_fds);
        FD_CLR(fd, fdt->close_on_exec);
-       files->next_fd = fd + 1;
+       fdt->next_fd = fd + 1;
        vx_openfd_inc(fd);
 #if 1
        /* Sanity check */
@@ -1048,8 +1033,8 @@ static void __put_unused_fd(struct files_struct *files, unsigned int fd)
 {
        struct fdtable *fdt = files_fdtable(files);
        __FD_CLR(fd, fdt->open_fds);
-       if (fd < files->next_fd)
-               files->next_fd = fd;
+       if (fd < fdt->next_fd)
+               fdt->next_fd = fd;
        vx_openfd_dec(fd);
 }
 
@@ -1123,6 +1108,7 @@ asmlinkage long sys_open(const char __user *filename, int flags, int mode)
        prevent_tail_call(ret);
        return ret;
 }
+EXPORT_SYMBOL_GPL(sys_open);
 
 asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
                           int mode)
@@ -1137,6 +1123,7 @@ asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
        prevent_tail_call(ret);
        return ret;
 }
+EXPORT_SYMBOL_GPL(sys_openat);
 
 #ifndef __alpha__