Re: Relative atime (was Re: What's in ocfs2.git)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mark Fasheh
Date: Tuesday, December 5, 2006 - 3:20 pm

On Mon, Dec 04, 2006 at 04:36:20PM -0800, Valerie Henson wrote:

Well, here's what the ocfs2 patch would look like. If we care to push this
forward, some time in -mm would be nice...
	--Mark

From: Mark Fasheh <mark.fasheh@oracle.com>
Date: Tue, 5 Dec 2006 14:13:41 -0800
Subject: [PATCH] ocfs2: relative atime support

Update ocfs2_should_update_atime() to understand the MNT_RELATIME flag and
to test against mtime / ctime accordingly.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
---
 fs/ocfs2/file.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 8786b3c..16a9b5e 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -154,6 +154,15 @@ int ocfs2_should_update_atime(struct ino
 		return 0;
 
 	now = CURRENT_TIME;
+
+	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;
+	}
+
 	if ((now.tv_sec - inode->i_atime.tv_sec <= osb->s_atime_quantum))
 		return 0;
 	else
-- 
1.4.2.4

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Relative atime (was Re: What's in ocfs2.git), Valerie Henson, (Mon Dec 4, 5:36 pm)
Re: Relative atime (was Re: What's in ocfs2.git), Valerie Henson, (Mon Dec 4, 5:56 pm)
Re: Relative atime (was Re: What's in ocfs2.git), Mark Fasheh, (Tue Dec 5, 3:20 pm)
Re: Relative atime (was Re: What's in ocfs2.git), Andrew Morton, (Tue Dec 5, 9:58 pm)
Re: Relative atime (was Re: What's in ocfs2.git), Andrew Morton, (Tue Dec 5, 11:11 pm)
Re: Relative atime (was Re: What's in ocfs2.git), Valerie Henson, (Wed Dec 6, 1:58 am)
Re: Relative atime (was Re: What's in ocfs2.git), Eric Dumazet, (Wed Dec 6, 2:42 am)
Re: Relative atime (was Re: What's in ocfs2.git), Arjan van de Ven, (Wed Dec 6, 5:48 am)
Re: Relative atime (was Re: What's in ocfs2.git), Valerie Henson, (Fri Dec 8, 8:15 pm)
Re: Relative atime (was Re: What's in ocfs2.git), Karel Zak, (Tue Dec 12, 2:30 am)