From owner-freebsd-fs Mon Jul 15 10:36:23 2002 Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EE6837B729; Mon, 15 Jul 2002 10:35:51 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD2E444245; Mon, 15 Jul 2002 10:21:57 -0700 (PDT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 5F73AAE03F; Mon, 15 Jul 2002 10:20:55 -0700 (PDT) Date: Mon, 15 Jul 2002 10:20:55 -0700 From: Alfred Perlstein To: fs@freebsd.org Cc: bde@freebsd.org, mckusick@freesd.org Subject: (forw) atime patch tested and fixed for 4.6 (fwd) Message-ID: <20020715172055.GM77219@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.27i Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org A friend whipped this patch up, what it does is update atime when mtime/ctime change. Is this ok? ----- Forwarded message from Nick Johnson ----- From: Nick Johnson To: Subject: atime patch tested and fixed for 4.6 (fwd) Date: Mon, 15 Jul 2002 00:12:21 -0700 (PDT) Message-ID: ---------- Forwarded message ---------- Date: Mon, 8 Jul 2002 19:50:25 -0700 (PDT) From: Nick Johnson To: alfred@freebsd.org Subject: atime patch tested and fixed for 4.6 [turing] ~/atime> perl testpatch.pl file created; atime=1026182996, mtime=1026182996, ctime=1026182996 file read; atime=1026182997, mtime=1026182996, ctime=1026182996 file append; atime=1026182998, mtime=1026182998, ctime=1026182998 [turing] ~/atime> su Password: turing# mount -o noatime -u /home turing# exit [turing] ~/atime> perl testpatch.pl file created; atime=1026183032, mtime=1026183032, ctime=1026183032 file read; atime=1026183032, mtime=1026183032, ctime=1026183032 file append; atime=1026183034, mtime=1026183034, ctime=1026183034 [turing] ~/atime> and here's the patch: --- ufs_vnops.c.orig Tue Feb 5 10:35:04 2002 +++ ufs_vnops.c Mon Jul 8 19:07:48 2002 @@ -159,6 +159,18 @@ ip->i_flag |= IN_LAZYMOD; else ip->i_flag |= IN_MODIFIED; + /* + * If we're going to be updating or changing, + * it makes sense that we're accessing as well. + * This changes the traditional semantics of + * mount -o noatime slightly. + */ + if (!(ip->i_flag & IN_ACCESS) && + ((ip->i_flag & IN_UPDATE) || + (ip->i_flag & IN_CHANGE))) { + ip->i_flag |= IN_ACCESS; + } + if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { vfs_timestamp(&ts); if (ip->i_flag & IN_ACCESS) { Nick -- "The aptly-named morons.org is an obscenity-laced screed..." -- Robert P. Lockwood, Catholic League director of research Nick Johnson, version 2.0 http://www.spatula.net/ ----- End forwarded message ----- -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' Tax deductible donations for FreeBSD: http://www.freebsdfoundation.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message