aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.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/namespace.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/namespace.c')
-rw-r--r--fs/namespace.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index f0e353f5bc30..2ca6145f43d6 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -355,14 +355,14 @@ static int show_vfsmnt(struct seq_file *m, void *v)
355 { MS_SYNCHRONOUS, ",sync" }, 355 { MS_SYNCHRONOUS, ",sync" },
356 { MS_DIRSYNC, ",dirsync" }, 356 { MS_DIRSYNC, ",dirsync" },
357 { MS_MANDLOCK, ",mand" }, 357 { MS_MANDLOCK, ",mand" },
358 { MS_NOATIME, ",noatime" },
359 { MS_NODIRATIME, ",nodiratime" },
360 { 0, NULL } 358 { 0, NULL }
361 }; 359 };
362 static struct proc_fs_info mnt_info[] = { 360 static struct proc_fs_info mnt_info[] = {
363 { MNT_NOSUID, ",nosuid" }, 361 { MNT_NOSUID, ",nosuid" },
364 { MNT_NODEV, ",nodev" }, 362 { MNT_NODEV, ",nodev" },
365 { MNT_NOEXEC, ",noexec" }, 363 { MNT_NOEXEC, ",noexec" },
364 { MNT_NOATIME, ",noatime" },
365 { MNT_NODIRATIME, ",nodiratime" },
366 { 0, NULL } 366 { 0, NULL }
367 }; 367 };
368 struct proc_fs_info *fs_infop; 368 struct proc_fs_info *fs_infop;
@@ -1286,7 +1286,13 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
1286 mnt_flags |= MNT_NODEV; 1286 mnt_flags |= MNT_NODEV;
1287 if (flags & MS_NOEXEC) 1287 if (flags & MS_NOEXEC)
1288 mnt_flags |= MNT_NOEXEC; 1288 mnt_flags |= MNT_NOEXEC;
1289 flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE); 1289 if (flags & MS_NOATIME)
1290 mnt_flags |= MNT_NOATIME;
1291 if (flags & MS_NODIRATIME)
1292 mnt_flags |= MNT_NODIRATIME;
1293
1294 flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE |
1295 MS_NOATIME | MS_NODIRATIME);
1290 1296
1291 /* ... and get the mountpoint */ 1297 /* ... and get the mountpoint */
1292 retval = path_lookup(dir_name, LOOKUP_FOLLOW, &nd); 1298 retval = path_lookup(dir_name, LOOKUP_FOLLOW, &nd);