aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 76980a9c92e7..108138d4e909 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -22,6 +22,7 @@
22#include <linux/cdev.h> 22#include <linux/cdev.h>
23#include <linux/bootmem.h> 23#include <linux/bootmem.h>
24#include <linux/inotify.h> 24#include <linux/inotify.h>
25#include <linux/mount.h>
25 26
26/* 27/*
27 * This is needed for the following functions: 28 * This is needed for the following functions:
@@ -1189,12 +1190,20 @@ void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
1189 struct inode *inode = dentry->d_inode; 1190 struct inode *inode = dentry->d_inode;
1190 struct timespec now; 1191 struct timespec now;
1191 1192
1192 /* per-mountpoint checks will go here */ 1193 if (IS_RDONLY(inode))
1193 if (IS_NOATIME(inode))
1194 return; 1194 return;
1195 if (IS_NODIRATIME(inode) && S_ISDIR(inode->i_mode)) 1195
1196 if ((inode->i_flags & S_NOATIME) ||
1197 (inode->i_sb->s_flags & MS_NOATIME) ||
1198 ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode)))
1196 return; 1199 return;
1197 if (IS_RDONLY(inode)) 1200
1201 /*
1202 * We may have a NULL vfsmount when coming from NFSD
1203 */
1204 if (mnt &&
1205 ((mnt->mnt_flags & MNT_NOATIME) ||
1206 ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))))
1198 return; 1207 return;
1199 1208
1200 now = current_fs_time(inode->i_sb); 1209 now = current_fs_time(inode->i_sb);