summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/file.c
diff options
context:
space:
mode:
authorMark Fasheh2006-12-13 09:34:35 +0100
committerLinus Torvalds2006-12-13 18:05:50 +0100
commit7e913c53609d5e8374f55d6f29c0bcd6650a2362 (patch)
tree77082566215aa8c8a43e2217819e35ce39ffbe63 /fs/ocfs2/file.c
parent[PATCH] relative atime (diff)
downloadkernel-qcow2-linux-7e913c53609d5e8374f55d6f29c0bcd6650a2362.tar.gz
kernel-qcow2-linux-7e913c53609d5e8374f55d6f29c0bcd6650a2362.tar.xz
kernel-qcow2-linux-7e913c53609d5e8374f55d6f29c0bcd6650a2362.zip
[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 <mark.fasheh@oracle.com> Cc: Valerie Henson <val_henson@linux.intel.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r--fs/ocfs2/file.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index e9a82ad95c1e..9fd590b9bde3 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;