This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / fs / open.c
index 66a77f5..8bdcf32 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -23,6 +23,8 @@
 #include <linux/fs.h>
 #include <linux/pagemap.h>
 
+#include <asm/unistd.h>
+
 int vfs_statfs(struct super_block *sb, struct kstatfs *buf)
 {
        int retval = -ENODEV;
@@ -335,7 +337,7 @@ asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length)
 }
 #endif
 
-#if !(defined(__alpha__) || defined(__ia64__))
+#ifdef __ARCH_WANT_SYS_UTIME
 
 /*
  * sys_utime() can be implemented in user-level using sys_utimes().
@@ -788,7 +790,6 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
        }
 
        f->f_mapping = inode->i_mapping;
-       file_ra_state_init(&f->f_ra, f->f_mapping);
        f->f_dentry = dentry;
        f->f_vfsmnt = mnt;
        f->f_pos = 0;
@@ -802,12 +803,13 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
        }
        f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
 
+       file_ra_state_init(&f->f_ra, f->f_mapping->host->i_mapping);
+
        /* NB: we're sure to have correct a_ops only after f_op->open */
        if (f->f_flags & O_DIRECT) {
-               if (!f->f_mapping || !f->f_mapping->a_ops ||
-                       !f->f_mapping->a_ops->direct_IO) {
-                               fput(f);
-                               f = ERR_PTR(-EINVAL);
+               if (!f->f_mapping->a_ops || !f->f_mapping->a_ops->direct_IO) {
+                       fput(f);
+                       f = ERR_PTR(-EINVAL);
                }
        }
 
@@ -965,7 +967,6 @@ out_error:
        fd = error;
        goto out;
 }
-EXPORT_SYMBOL_GPL(sys_open);
 
 #ifndef __alpha__
 
@@ -1039,7 +1040,6 @@ out_unlock:
        return -EBADF;
 }
 
-EXPORT_SYMBOL(sys_close);
 
 /*
  * This routine simulates a hangup on the tty, to arrange that users