From: Mark Fasheh Date: Wed, 13 Dec 2006 08:34:35 +0000 (-0800) Subject: [PATCH] ocfs2: relative atime support X-Git-Tag: v2.6.20-rc1~94 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e913c53609d5e8374f55d6f29c0bcd6650a2362;p=linux-2.6 [PATCH] ocfs2: relative atime support Update ocfs2_should_update_atime() to understand the MNT_RELATIME flag and to test against mtime / ctime accordingly. [akpm@osdl.org: cleanups] Signed-off-by: Mark Fasheh Cc: Valerie Henson Cc: Al Viro Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index e9a82ad95c..9fd590b9bd 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -153,6 +153,14 @@ int ocfs2_should_update_atime(struct inode *inode, ((vfsmnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))) return 0; + if (vfsmnt->mnt_flags & MNT_RELATIME) { + if ((timespec_compare(&inode->i_atime, &inode->i_mtime) <= 0) || + (timespec_compare(&inode->i_atime, &inode->i_ctime) <= 0)) + return 1; + + return 0; + } + now = CURRENT_TIME; if ((now.tv_sec - inode->i_atime.tv_sec <= osb->s_atime_quantum)) return 0;