mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
[PATCH] ocfs2: relative atime support
Update ocfs2_should_update_atime() to understand the MNT_RELATIME flag and to test against mtime / ctime accordingly. [[email protected]: cleanups] Signed-off-by: Mark Fasheh <[email protected]> Cc: Valerie Henson <[email protected]> Cc: Al Viro <[email protected]> Cc: Christoph Hellwig <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
47ae32d6a5
commit
7e913c5360
1 changed files with 8 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue