LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Valerie Henson <val_henson@linux.intel.com>,
	mark.fasheh@oracle.com, steve@chygwyn.com,
	linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	linux-fsdevel@vger.kernel.org, viro@ftp.linux.org.uk
Subject: Re: Relative atime (was Re: What's in ocfs2.git)
Date: Wed, 6 Dec 2006 10:42:58 +0100	[thread overview]
Message-ID: <200612061042.58595.dada1@cosmosbay.com> (raw)
In-Reply-To: <20061205205802.92b91ce1.akpm@osdl.org>

On Wednesday 06 December 2006 05:58, Andrew Morton wrote:
> > On Mon, 4 Dec 2006 16:36:20 -0800 Valerie Henson
> > <val_henson@linux.intel.com> wrote: Add "relatime" (relative atime)
> > support.  Relative atime only updates the atime if the previous atime is
> > older than the mtime or ctime. Like noatime, but useful for applications
> > like mutt that need to know when a file has been read since it was last
> > modified.
>
> That seems like a good idea.
>
> I found touch_atime() to be rather putrid, so I hacked it around a bit. 

I find this function full of tests...

> The end result:
>
> void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
> {
> 	struct inode *inode = dentry->d_inode;
> 	struct timespec now;
>
> 	if (IS_RDONLY(inode))
> 		return;

While we are adding new tests, we could try to be smart here testing both 
MS_RDONLY and MS_NOATIME.

if (__IS_FLG(inode, MS_RDONLY | MS_NOATIME))
	return;

> 	if (inode->i_flags & S_NOATIME)
> 		return;

> 	if (inode->i_sb->s_flags & MS_NOATIME)
> 		return;
So that that one can be deleted.

>        if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))
>                return;

	if (__IS_FLG(inode, MS_NODIRATIME) && S_ISDIR(inode->i_mode))
		return;

Eric

  parent reply	other threads:[~2006-12-06  9:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-03 20:31 What's in ocfs2.git Mark Fasheh
2006-12-04 10:54 ` Steven Whitehouse
2006-12-05  0:10   ` Mark Fasheh
2006-12-05  0:36     ` Relative atime (was Re: What's in ocfs2.git) Valerie Henson
2006-12-05  0:56       ` Valerie Henson
2006-12-05 22:20       ` Mark Fasheh
2006-12-06  6:11         ` Andrew Morton
2006-12-06  4:58       ` Andrew Morton
2006-12-06  8:58         ` Valerie Henson
2006-12-06  9:42         ` Eric Dumazet [this message]
2006-12-06 12:48           ` Arjan van de Ven
2006-12-09  3:15         ` Valerie Henson
2006-12-12  9:30           ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200612061042.58595.dada1@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=akpm@osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.fasheh@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=steve@chygwyn.com \
    --cc=val_henson@linux.intel.com \
    --cc=viro@ftp.linux.org.uk \
    --subject='Re: Relative atime (was Re: What'\''s in ocfs2.git)' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).