aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-01-09 23:52:17 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:01:34 -0500
commitfc33a7bb9c6dd8f6e4a014976200f8fdabb3a45c (patch)
tree26f4d676de476075545e58057aa5d8c57618741d /fs/inode.c
parent0d456fa4261f43433287a10fe3ec04a9818fac64 (diff)
[PATCH] per-mountpoint noatime/nodiratime
Turn noatime and nodiratime into per-mount instead of per-sb flags. After all the preparations this is a rather trivial patch. The mount code needs to treat the two options as per-mount instead of per-superblock, and touch_atime needs to be changed to check the new MNT_ flags in addition to the MS_ flags that are kept for filesystems that are always noatime/nodiratime but not user settable anymore. Besides that core code only nfs needed an update because it's leaving atime updates to the server and thus sets the S_NOATIME flag on every inode, but needs to know whether it's a real noatime mount for an getattr optimization. While we're at it I've killed the IS_NOATIME/IS_NODIRATIME macros that were only used by touch_atime. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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);