diff options
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 83934e33e5b..69f85ae392d 100644 --- a/fs/ocfs2/mmap.c +++ b/fs/ocfs2/mmap.c | |||
@@ -82,6 +82,8 @@ static struct vm_operations_struct ocfs2_file_vm_ops = { | |||
82 | 82 | ||
83 | int ocfs2_mmap(struct file *file, struct vm_area_struct *vma) | 83 | int ocfs2_mmap(struct file *file, struct vm_area_struct *vma) |
84 | { | 84 | { |
85 | int ret = 0, lock_level = 0; | ||
86 | |||
85 | /* We don't want to support shared writable mappings yet. */ | 87 | /* We don't want to support shared writable mappings yet. */ |
86 | if (((vma->vm_flags & VM_SHARED) || (vma->vm_flags & VM_MAYSHARE)) | 88 | if (((vma->vm_flags & VM_SHARED) || (vma->vm_flags & VM_MAYSHARE)) |
87 | && ((vma->vm_flags & VM_WRITE) || (vma->vm_flags & VM_MAYWRITE))) { | 89 | && ((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) | |||
91 | return -EINVAL; | 93 | return -EINVAL; |
92 | } | 94 | } |
93 | 95 | ||
94 | file_accessed(file); | 96 | ret = ocfs2_meta_lock_atime(file->f_dentry->d_inode, |
97 | file->f_vfsmnt, &lock_level); | ||
98 | if (ret < 0) { | ||
99 | mlog_errno(ret); | ||
100 | goto out; | ||
101 | } | ||
102 | ocfs2_meta_unlock(file->f_dentry->d_inode, lock_level); | ||
103 | out: | ||
95 | vma->vm_ops = &ocfs2_file_vm_ops; | 104 | vma->vm_ops = &ocfs2_file_vm_ops; |
96 | return 0; | 105 | return 0; |
97 | } | 106 | } |