Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jul 2002 06:07:26 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Alfred Perlstein <alfred@freebsd.org>
Cc:        fs@freebsd.org, <bde@freebsd.org>, <mckusick@freesd.org>
Subject:   Re: (forw) atime patch tested and fixed for 4.6 (fwd)
Message-ID:  <20020716055722.Q41780-100000@gamplex.bde.org>
In-Reply-To: <20020715172055.GM77219@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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