Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Mark Fasheh and committed by
Linus Torvalds
7e913c53 47ae32d6

+8
+8
fs/ocfs2/file.c
··· 153 153 ((vfsmnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))) 154 154 return 0; 155 155 156 + if (vfsmnt->mnt_flags & MNT_RELATIME) { 157 + if ((timespec_compare(&inode->i_atime, &inode->i_mtime) <= 0) || 158 + (timespec_compare(&inode->i_atime, &inode->i_ctime) <= 0)) 159 + return 1; 160 + 161 + return 0; 162 + } 163 + 156 164 now = CURRENT_TIME; 157 165 if ((now.tv_sec - inode->i_atime.tv_sec <= osb->s_atime_quantum)) 158 166 return 0;