Implemented kernel side of MNT_NOATIME mount option. This option disables

the file access time update on reads and can be useful in reducing
filesystem overhead in cases where the access time is not important (like
Usenet news spools).
This commit is contained in:
David Greenman 1996-09-03 07:09:11 +00:00
parent 6bf10e790e
commit 9e04304259
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18006
4 changed files with 20 additions and 13 deletions

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
* $Id: vfs_syscalls.c,v 1.47 1996/05/11 04:39:53 bde Exp $
* $Id: vfs_syscalls.c,v 1.48 1996/05/24 16:19:23 peter Exp $
*/
/*
@ -182,9 +182,9 @@ mount(p, uap, retval)
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 |= uap->flags & (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_FORCE);
MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_FORCE | MNT_NOATIME);
/*
* Mount the filesystem.
*/

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
* $Id: vfs_syscalls.c,v 1.47 1996/05/11 04:39:53 bde Exp $
* $Id: vfs_syscalls.c,v 1.48 1996/05/24 16:19:23 peter Exp $
*/
/*
@ -182,9 +182,9 @@ mount(p, uap, retval)
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 |= uap->flags & (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_FORCE);
MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_FORCE | MNT_NOATIME);
/*
* Mount the filesystem.
*/

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mount.h 8.13 (Berkeley) 3/27/94
* $Id: mount.h,v 1.30 1995/12/22 16:02:39 phk Exp $
* $Id: mount.h,v 1.31 1996/01/30 23:00:54 mpp Exp $
*/
#ifndef _SYS_MOUNT_H_
@ -63,8 +63,7 @@ struct fid {
#define MNAMELEN 90 /* length of buffer for returned name */
struct statfs {
short f_type; /* type of filesystem (see below) */
short f_flags; /* copy of mount flags */
long f_spare2; /* placeholder */
long f_bsize; /* fundamental file system block size */
long f_iosize; /* optimal transfer block size */
long f_blocks; /* total data blocks in file system */
@ -73,7 +72,10 @@ struct statfs {
long f_files; /* total file nodes in file system */
long f_ffree; /* free file nodes in fs */
fsid_t f_fsid; /* file system id */
long f_spare[9]; /* spare for later */
uid_t f_owner; /* user that mounted the filesystem */
int f_type; /* type of filesystem (see below) */
int f_flags; /* copy of mount flags */
long f_spare[6]; /* spare for later */
char f_mntonname[MNAMELEN]; /* directory on which mounted */
char f_mntfromname[MNAMELEN];/* mounted filesystem */
};
@ -156,6 +158,7 @@ struct mount {
#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 0x10000000 /* Disable update of file access times */
/*
* exported mount flags.
@ -177,7 +180,10 @@ struct mount {
/*
* Mask of flags that are visible to statfs()
*/
#define MNT_VISFLAGMASK 0x0000ffff
#define MNT_VISFLAGMASK (MNT_RDONLY|MNT_SYNCHRONOUS|MNT_NOEXEC|MNT_NOSUID| \
MNT_NODEV|MNT_UNION|MNT_ASYNC|MNT_EXRDONLY|MNT_EXPORTED| \
MNT_DEFEXPORTED|MNT_EXPORTANON|MNT_EXKERB|MNT_LOCAL| \
MNT_QUOTA|MNT_ROOTFS|MNT_USER|MNT_NOATIME)
/*
* filesystem control flags.

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_readwrite.c 8.7 (Berkeley) 1/21/94
* $Id: ufs_readwrite.c,v 1.20 1996/01/19 03:59:26 dyson Exp $
* $Id: ufs_readwrite.c,v 1.21 1996/06/25 03:00:44 davidg Exp $
*/
#ifdef LFS_READWRITE
@ -163,7 +163,8 @@ READ(ap)
}
if (bp != NULL)
bqrelse(bp);
ip->i_flag |= IN_ACCESS;
if (!(vp->v_mount->mnt_flag & MNT_NOATIME))
ip->i_flag |= IN_ACCESS;
return (error);
}