🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #11801

Re: atime updates on news spool disk - FreeBSD

#11801
From: Marc Slemko
Date: Mon, 21 Oct 1996 00:00
232 lines
8655 bytes
In <54857u$19s@alive.ampr.ab.ca> marcs@alive.ampr.ab.ca (Marc Slemko) writes:

>In <545847$kn4@polaris.eurocontrol.fr> Ollivier.Robert@eurocontrol.fr (Ollivier Robert) writes:

>>In article <53tus7$1p9@nexp.crl.com>,
>>Eric Mehlhaff <mehlhaff@crl4.crl.com> wrote:
>>> Actually, I'm curious what OS's support this feature, and how it's
>>> implemented or activated on them.

>>FreeBSD 2.2-CURRENT has an option for this. It is enabled by an option
>>``noatime'' in /etc/fstab. 

>>davidg      96/09/03 00:13:57

>And davidg also made a similar patch for FreeBSD 2.1.5 or -stable.
>If anyone is interested, let me know and I can post it.

Here is the patch that David Greenman posted to a FreeBSD mailing
list.  Everything needed should be in there.

-------------------------------------------
From dg@root.com Mon Oct 21 19:45:21 1996
Date: Wed, 04 Sep 1996 18:19:22 -0700
From: David Greenman <dg@root.com>
To: Joe Greco <jgreco@brasil.moneng.mei.com>
Cc: "Matthew N. Dodd" <winter@jurai.net>, freebsd-isp@freebsd.org
Subject: Re: Anyone using ccd (FreeBSD disk striper) for news 

>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" },



Technical Details
Message-ID: <54h959$s0m@alive.ampr.ab.ca>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <jdvicggo2t.fsf@terminus.cs.umb.edu> <53tus7$1p9@nexp.crl.com> <545847$kn4@polaris.eurocontrol.fr> <54857u$19s@alive.ampr.ab.ca>

Show Full Headers
Complete Article Headers
Message-ID: <54h959$s0m@alive.ampr.ab.ca>
Subject: Re: atime updates on news spool disk - FreeBSD
Date: Mon, 21 Oct 1996 00:00:00 +0000
From: marcs@alive.ampr.ab.ca (Marc Slemko)
References: <jdvicggo2t.fsf@terminus.cs.umb.edu> <53tus7$1p9@nexp.crl.com> <545847$kn4@polaris.eurocontrol.fr> <54857u$19s@alive.ampr.ab.ca>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 191110886
Organization: The Meaning of Life
Newsgroups: news.software.nntp