diff options
author | Tiger Yang <tiger.yang@oracle.com> | 2006-11-15 10:49:02 +0300 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-12-02 05:28:58 +0300 |
commit | 25899deef46c226c49c53b42c00e0f032379c04b (patch) | |
tree | ac8c19482ab05ee2e13d874eecd8b2eaa507a156 /fs/ocfs2/mmap.c | |
parent | 7f1a37e31f94b4f1c123d32ce9f69205ab2095bd (diff) | |
download | linux-25899deef46c226c49c53b42c00e0f032379c04b.tar.xz |
ocfs2: update file system paths to set atime
Conditionally update atime in ocfs2_file_aio_read(), ocfs2_readdir() and
ocfs2_mmap().
Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/mmap.c')
-rw-r--r-- | fs/ocfs2/mmap.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/ocfs2/mmap.c b/fs/ocfs2/mmap.c index 83934e33e5b0..69f85ae392dc 100644 --- a/fs/ocfs2/mmap.c +++ b/fs/ocfs2/mmap.c @@ -82,6 +82,8 @@ static struct vm_operations_struct ocfs2_file_vm_ops = { int ocfs2_mmap(struct file *file, struct vm_area_struct *vma) { + int ret = 0, lock_level = 0; + /* We don't want to support shared writable mappings yet. */ if (((vma->vm_flags & VM_SHARED) || (vma->vm_flags & VM_MAYSHARE)) && ((vma->vm_flags & VM_WRITE) || (vma->vm_flags & VM_MAYWRITE))) { @@ -91,7 +93,14 @@ int ocfs2_mmap(struct file *file, struct vm_area_struct *vma) return -EINVAL; } - file_accessed(file); + ret = ocfs2_meta_lock_atime(file->f_dentry->d_inode, + file->f_vfsmnt, &lock_level); + if (ret < 0) { + mlog_errno(ret); + goto out; + } + ocfs2_meta_unlock(file->f_dentry->d_inode, lock_level); +out: vma->vm_ops = &ocfs2_file_vm_ops; return 0; } |