From owner-freebsd-fs Mon Jul 15 13: 4: 2 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 8BA2B37B400; Mon, 15 Jul 2002 13:04:00 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B0A343E3B; Mon, 15 Jul 2002 13:03:59 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id GAA01702; Tue, 16 Jul 2002 06:03:55 +1000 Date: Tue, 16 Jul 2002 06:07:26 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Alfred Perlstein Cc: fs@freebsd.org, , Subject: Re: (forw) atime patch tested and fixed for 4.6 (fwd) In-Reply-To: <20020715172055.GM77219@elvis.mu.org> Message-ID: <20020716055722.Q41780-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On Mon, 15 Jul 2002, Alfred Perlstein wrote: > A friend whipped this patch up, what it does is update atime when > mtime/ctime change. Is this ok? I disklike it for the same reasons as when it was proposed before. > 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) { > A better way would be to set IN_ACCESS without checking MNT_NOATIME elsewhere, and either ignore it or unset it here if MNT_NOATIME is set and one of the other IN_* flags is not set. It doesn't make sense that we are accessing if we didn't set the access flag. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message