[OracleOSS] [TitleIndex] [WordIndex]

OCFS2/DesignDocs/Atime

OCFS2 atime support

Tiger Yang <tiger.yang@oracle.com>

November 06, 2006

Goals

Support update/not update access time stamp when a file/directory is read in a file system with different mount options.

Support list/change file's attribute about atime with lsattr/chattr. This is compatable with ext2.

Support setting the threshold of atime update. Because we don't want to update atime at each access so we can set a minimum period between updates with mount option atime_quantum. The default value of atime_quantum is 60 seconds.

VFS

VFS invoke file_accessed()/touch_atime() to update file's atime. Touch_atime() will check flags to determine whether or not update inode atime. Those flags are corresponding to the options.

Flags in mnt_flags of vfsmount structure.

Flags in i_flags of inode structure.

Flags in s_flags of super_block structure.

OCFS2

In ocfs2, We always set super_block->s_flags with MS_NOATIME to prevent VFS touch_atime() update ocfs2 inode atime.
We add a new API to update atime.

{
   get_PR_meta_lock();
   check_flags();
   if (should_update_atime) {
      get_EX_meta_lock();
      update_atime();
   }
}

2011-12-23 01:01