[PATCH] add EXPORT_SYMBOL_GPL_FUTURE() to USB subsystem
[pandora-kernel.git] / fs / inode.c
index 76980a9..d0be615 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/cdev.h>
 #include <linux/bootmem.h>
 #include <linux/inotify.h>
+#include <linux/mount.h>
 
 /*
  * This is needed for the following functions:
@@ -1178,7 +1179,7 @@ EXPORT_SYMBOL(bmap);
 /**
  *     touch_atime     -       update the access time
  *     @mnt: mount the inode is accessed on
- *     @inode: inode accessed
+ *     @dentry: dentry accessed
  *
  *     Update the accessed time on an inode and mark it for writeback.
  *     This function automatically handles read only file systems and media,
@@ -1189,12 +1190,20 @@ void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
        struct inode *inode = dentry->d_inode;
        struct timespec now;
 
-       /* per-mountpoint checks will go here */
-       if (IS_NOATIME(inode))
+       if (IS_RDONLY(inode))
                return;
-       if (IS_NODIRATIME(inode) && S_ISDIR(inode->i_mode))
+
+       if ((inode->i_flags & S_NOATIME) ||
+           (inode->i_sb->s_flags & MS_NOATIME) ||
+           ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode)))
                return;
-       if (IS_RDONLY(inode))
+
+       /*
+        * We may have a NULL vfsmount when coming from NFSD
+        */
+       if (mnt &&
+           ((mnt->mnt_flags & MNT_NOATIME) ||
+            ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))))
                return;
 
        now = current_fs_time(inode->i_sb);