Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 Sep 1996 18:19:22 -0700
From:      David Greenman <dg@root.com>
To:        Joe Greco <jgreco@brasil.moneng.mei.com>
Cc:        winter@jurai.net (Matthew N. Dodd), freebsd-isp@FreeBSD.org
Subject:   Re: Anyone using ccd (FreeBSD disk striper) for news 
Message-ID:  <199609050119.SAA01918@root.com>
In-Reply-To: Your message of "Wed, 04 Sep 1996 15:41:27 CDT." <199609042041.PAA14028@brasil.moneng.mei.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>Sorry :-(  Blew them away when I upgraded the box to 2.1.5R.  I was
>convinced that they were not the right way to do it and DG had mentioned
>"almost" having it working, and I figured that somebody who had a clue
>about FreeBSD/BSD system internals had a much better chance of getting 
>a technically correct implementation than I did.
>
>> > It's icky, at least the way I did it.  DG had also worked on this and
>> > I'd really really like to see his work....
>> 
>> Yes, wasn't he talking about cleaning it up and commiting it?
>
>Yes...  :-)
>
>> That would be a spiffy option to have out of box.
>
>Agreed.

   I committed the changes for -current, although I haven't documented the new
"noatime" option in the manual page yet - I'd like to get a little more testing
done with it first by other people.
   The changes for 2.1.5 are attached.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project

Index: sys/kern/vfs_syscalls.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/vfs_syscalls.c,v
retrieving revision 1.25.4.4
diff -c -r1.25.4.4 vfs_syscalls.c
*** vfs_syscalls.c	1996/01/16 13:09:33	1.25.4.4
--- vfs_syscalls.c	1996/09/03 04:40:11
***************
*** 168,176 ****
  	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);
  	mp->mnt_flag |= uap->flags & (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
! 	    MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_FORCE);
  	/*
  	 * Mount the filesystem.
  	 */
--- 168,176 ----
  	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_NOATIME);
  	mp->mnt_flag |= uap->flags & (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
! 	    MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_FORCE | MNT_NOATIME);
  	/*
  	 * Mount the filesystem.
  	 */
Index: sys/sys/mount.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/mount.h,v
retrieving revision 1.19.4.1
diff -c -r1.19.4.1 mount.h
*** mount.h	1996/03/21 20:30:14	1.19.4.1
--- mount.h	1996/09/03 05:54:29
***************
*** 63,70 ****
  #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_bsize;		/* fundamental file system block size */
  	long	f_iosize;		/* optimal transfer block size */
  	long	f_blocks;		/* total data blocks in file system */
--- 63,69 ----
  #define MNAMELEN 90	/* length of buffer for returned name */
  
  struct statfs {
! 	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,79 ****
  	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 */
  	char	f_mntonname[MNAMELEN];	/* directory on which mounted */
  	char	f_mntfromname[MNAMELEN];/* mounted filesystem */
  };
--- 72,81 ----
  	long	f_files;		/* total file nodes in file system */
  	long	f_ffree;		/* free file nodes in fs */
  	fsid_t	f_fsid;			/* file system id */
! 	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 */
  };
***************
*** 152,157 ****
--- 154,160 ----
  #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.
***************
*** 173,179 ****
  /*
   * Mask of flags that are visible to statfs()
   */
! #define	MNT_VISFLAGMASK	0x0000ffff
  
  /*
   * filesystem control flags.
--- 176,185 ----
  /*
   * Mask of flags that are visible to statfs()
   */
! #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.
Index: sys/ufs/ufs/ufs_readwrite.c
===================================================================
RCS file: /home/ncvs/src/sys/ufs/ufs/ufs_readwrite.c,v
retrieving revision 1.9.4.1
diff -c -r1.9.4.1 ufs_readwrite.c
*** ufs_readwrite.c	1996/06/25 03:02:11	1.9.4.1
--- ufs_readwrite.c	1996/09/03 04:30:36
***************
*** 156,162 ****
  	}
  	if (bp != NULL)
  		brelse(bp);
! 	ip->i_flag |= IN_ACCESS;
  	return (error);
  }
  
--- 156,163 ----
  	}
  	if (bp != NULL)
  		brelse(bp);
! 	if (!(vp->v_mount->mnt_flag & MNT_NOATIME))
! 		ip->i_flag |= IN_ACCESS;
  	return (error);
  }
  
Index: sbin/mount/mntopts.h
===================================================================
RCS file: /home/ncvs/src/sbin/mount/mntopts.h,v
retrieving revision 1.4.4.1
diff -c -r1.4.4.1 mntopts.h
*** mntopts.h	1995/08/30 09:21:55	1.4.4.1
--- mntopts.h	1996/09/03 04:45:22
***************
*** 42,47 ****
--- 42,48 ----
  
  /* User-visible MNT_ flags. */
  #define MOPT_ASYNC		{ "async",	0, MNT_ASYNC, 0 }
+ #define MOPT_NOATIME		{ "atime",	1, MNT_NOATIME, 0 }
  #define	MOPT_NOAUTO		{ "auto",	1, 0, 0 }
  #define MOPT_NODEV		{ "dev",	1, MNT_NODEV, 0 }
  #define MOPT_NOEXEC		{ "exec",	1, MNT_NOEXEC, 0 }
***************
*** 69,74 ****
--- 70,76 ----
  /* Standard options which all mounts can understand. */
  #define MOPT_STDOPTS							\
  	MOPT_FSTAB_COMPAT,						\
+ 	MOPT_NOATIME,							\
  	MOPT_NOAUTO,							\
  	MOPT_NODEV,							\
  	MOPT_NOEXEC,							\
Index: sbin/mount/mount.c
===================================================================
RCS file: /home/ncvs/src/sbin/mount/mount.c,v
retrieving revision 1.6.4.1
diff -c -r1.6.4.1 mount.c
*** mount.c	1995/08/30 09:22:02	1.6.4.1
--- mount.c	1996/09/03 04:44:43
***************
*** 84,89 ****
--- 84,90 ----
  	{ MNT_ASYNC,		"asynchronous" },
  	{ MNT_EXPORTED,		"NFS exported" },
  	{ MNT_LOCAL,		"local" },
+ 	{ MNT_NOATIME,		"noatime" },
  	{ MNT_NODEV,		"nodev" },
  	{ MNT_NOEXEC,		"noexec" },
  	{ MNT_NOSUID,		"nosuid" },



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609050119.SAA01918>