ctime or mtime has changed). Useful for laptops and news servers.
-/* $OpenBSD: mntopts.h,v 1.2 1996/06/23 14:31:11 deraadt Exp $ */
+/* $OpenBSD: mntopts.h,v 1.3 1997/03/02 09:38:30 millert Exp $ */
/* $NetBSD: mntopts.h,v 1.3 1995/03/18 14:56:59 cgd Exp $ */
/*-
/* User-visible MNT_ flags. */
#define MOPT_ASYNC { "async", 0, MNT_ASYNC }
+#define MOPT_NOATIME { "atime", 1, MNT_NOATIME }
#define MOPT_NODEV { "dev", 1, MNT_NODEV }
#define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC }
#define MOPT_NOSUID { "suid", 1, MNT_NOSUID }
MOPT_USERQUOTA, \
MOPT_GROUPQUOTA, \
MOPT_FSTAB_COMPAT, \
+ MOPT_NOATIME, \
MOPT_NODEV, \
MOPT_NOEXEC, \
MOPT_NOSUID, \
-.\" $OpenBSD: mount.8,v 1.2 1996/06/23 14:31:11 deraadt Exp $
+.\" $OpenBSD: mount.8,v 1.3 1997/03/02 09:38:25 millert Exp $
.\" $NetBSD: mount.8,v 1.11 1995/07/12 06:23:21 cgd Exp $
.\"
.\" Copyright (c) 1980, 1989, 1991, 1993
.Fl f ;
forces the revocation of write access when trying to downgrade
a filesystem mount status from read-write to read-only.
+.It noatime
+Do not update atime on files in the system unless the mtime or ctime
+is being changed as well.
+This option is useful for laptops and news servers where one does
+not want the extra disk activity associated with updating the atime.
.It nodev
Do not interpret character or block special devices on the file system.
This option is useful for a server that has file systems containing
-/* $OpenBSD: mount.c,v 1.13 1997/01/15 23:41:15 millert Exp $ */
+/* $OpenBSD: mount.c,v 1.14 1997/03/02 09:38:28 millert Exp $ */
/* $NetBSD: mount.c,v 1.24 1995/11/18 03:34:29 cgd Exp $ */
/*
#if 0
static char sccsid[] = "@(#)mount.c 8.19 (Berkeley) 4/19/94";
#else
-static char rcsid[] = "$OpenBSD: mount.c,v 1.13 1997/01/15 23:41:15 millert Exp $";
+static char rcsid[] = "$OpenBSD: mount.c,v 1.14 1997/03/02 09:38:28 millert Exp $";
#endif
#endif /* not lint */
{ MNT_EXPORTANON, 1, "anon uid mapping" },
{ MNT_EXRDONLY, 1, "exported read-only" },
{ MNT_LOCAL, 0, "local" },
+ { MNT_NOATIME, 0, "noatime" },
{ MNT_NODEV, 0, "nodev" },
{ MNT_NOEXEC, 0, "noexec" },
{ MNT_NOSUID, 0, "nosuid" },
-/* $OpenBSD: vfs_syscalls.c,v 1.24 1997/02/26 16:38:20 niklas Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.25 1997/03/02 09:38:35 millert Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
else if (mp->mnt_flag & MNT_RDONLY)
mp->mnt_flag |= MNT_WANTRDWR;
mp->mnt_flag &=~ (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
- MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC);
+ MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOATIME);
mp->mnt_flag |= SCARG(uap, flags) & (MNT_NOSUID | MNT_NOEXEC |
- MNT_NODEV | MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC);
+ MNT_NODEV | MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOATIME);
/*
* Mount the filesystem.
*/
-/* $OpenBSD: mount.h,v 1.12 1996/12/24 20:14:35 dm Exp $ */
+/* $OpenBSD: mount.h,v 1.13 1997/03/02 09:38:22 millert Exp $ */
/* $NetBSD: mount.h,v 1.48 1996/02/18 11:55:47 fvdl Exp $ */
/*
#define MNT_NODEV 0x00000010 /* don't interpret special files */
#define MNT_UNION 0x00000020 /* union with underlying filesystem */
#define MNT_ASYNC 0x00000040 /* file system written asynchronously */
+#define MNT_NOATIME 0x00000080 /* don't update atime on files */
/*
* exported mount flags.
*/
-#define MNT_EXRDONLY 0x00000080 /* exported read only */
-#define MNT_EXPORTED 0x00000100 /* file system is exported */
-#define MNT_DEFEXPORTED 0x00000200 /* exported to the world */
-#define MNT_EXPORTANON 0x00000400 /* use anon uid mapping for everyone */
-#define MNT_EXKERB 0x00000800 /* exported with Kerberos uid mapping */
+#define MNT_EXRDONLY 0x00000100 /* exported read only */
+#define MNT_EXPORTED 0x00000200 /* file system is exported */
+#define MNT_DEFEXPORTED 0x00000400 /* exported to the world */
+#define MNT_EXPORTANON 0x00000800 /* use anon uid mapping for everyone */
+#define MNT_EXKERB 0x00001000 /* exported with Kerberos uid mapping */
/*
* Flags set by internal operations.
*/
-#define MNT_LOCAL 0x00001000 /* filesystem is stored locally */
-#define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */
-#define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */
+#define MNT_LOCAL 0x00002000 /* filesystem is stored locally */
+#define MNT_QUOTA 0x00004000 /* quotas are enabled on filesystem */
+#define MNT_ROOTFS 0x00008000 /* identifies the root filesystem */
/*
* Mask of flags that are visible to statfs()
-/* $OpenBSD: ffs_inode.c,v 1.4 1996/11/05 03:30:12 tholo Exp $ */
+/* $OpenBSD: ffs_inode.c,v 1.5 1997/03/02 09:38:13 millert Exp $ */
/* $NetBSD: ffs_inode.c,v 1.10 1996/05/11 18:27:19 mycroft Exp $ */
/*
ip->i_flag &=
~(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE);
return (0);
+ } else if ((ap->a_vp->v_mount->mnt_flag & MNT_NOATIME) &&
+ !(ip->i_flag & (IN_CHANGE | IN_UPDATE))) {
+ ip->i_flag &= ~IN_ACCESS;
}
if ((ip->i_flag &
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0)
-/* $OpenBSD: lfs_inode.c,v 1.4 1996/07/01 07:41:51 downsj Exp $ */
+/* $OpenBSD: lfs_inode.c,v 1.5 1997/03/02 09:38:18 millert Exp $ */
/* $NetBSD: lfs_inode.c,v 1.5 1996/05/11 18:27:35 mycroft Exp $ */
/*
if (vp->v_mount->mnt_flag & MNT_RDONLY)
return (0);
ip = VTOI(vp);
+ if ((ap->a_vp->v_mount->mnt_flag & MNT_NOATIME) &&
+ !(ip->i_flag & (IN_CHANGE | IN_UPDATE)))
+ ip->i_flag &= ~IN_ACCESS;
if ((ip->i_flag &
(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0)
return (0);