diff options
Diffstat (limited to 'fs/ocfs2/mmap.c')
-rw-r--r-- | fs/ocfs2/mmap.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/fs/ocfs2/mmap.c b/fs/ocfs2/mmap.c index cd75508b1c8a..ee64749e2eeb 100644 --- a/fs/ocfs2/mmap.c +++ b/fs/ocfs2/mmap.c | |||
@@ -60,30 +60,28 @@ static inline int ocfs2_vm_op_unblock_sigs(sigset_t *oldset) | |||
60 | return sigprocmask(SIG_SETMASK, oldset, NULL); | 60 | return sigprocmask(SIG_SETMASK, oldset, NULL); |
61 | } | 61 | } |
62 | 62 | ||
63 | static struct page *ocfs2_fault(struct vm_area_struct *area, | 63 | static int ocfs2_fault(struct vm_area_struct *area, struct vm_fault *vmf) |
64 | struct fault_data *fdata) | ||
65 | { | 64 | { |
66 | struct page *page = NULL; | ||
67 | sigset_t blocked, oldset; | 65 | sigset_t blocked, oldset; |
68 | int ret; | 66 | int error, ret; |
69 | 67 | ||
70 | mlog_entry("(area=%p, page offset=%lu)\n", area, fdata->pgoff); | 68 | mlog_entry("(area=%p, page offset=%lu)\n", area, vmf->pgoff); |
71 | 69 | ||
72 | ret = ocfs2_vm_op_block_sigs(&blocked, &oldset); | 70 | error = ocfs2_vm_op_block_sigs(&blocked, &oldset); |
73 | if (ret < 0) { | 71 | if (error < 0) { |
74 | fdata->type = VM_FAULT_SIGBUS; | 72 | mlog_errno(error); |
75 | mlog_errno(ret); | 73 | ret = VM_FAULT_SIGBUS; |
76 | goto out; | 74 | goto out; |
77 | } | 75 | } |
78 | 76 | ||
79 | page = filemap_fault(area, fdata); | 77 | ret = filemap_fault(area, vmf); |
80 | 78 | ||
81 | ret = ocfs2_vm_op_unblock_sigs(&oldset); | 79 | error = ocfs2_vm_op_unblock_sigs(&oldset); |
82 | if (ret < 0) | 80 | if (error < 0) |
83 | mlog_errno(ret); | 81 | mlog_errno(error); |
84 | out: | 82 | out: |
85 | mlog_exit_ptr(page); | 83 | mlog_exit_ptr(vmf->page); |
86 | return page; | 84 | return ret; |
87 | } | 85 | } |
88 | 86 | ||
89 | static int __ocfs2_page_mkwrite(struct inode *inode, struct buffer_head *di_bh, | 87 | static int __ocfs2_page_mkwrite(struct inode *inode, struct buffer_head *di_bh, |
@@ -225,7 +223,7 @@ int ocfs2_mmap(struct file *file, struct vm_area_struct *vma) | |||
225 | ocfs2_meta_unlock(file->f_dentry->d_inode, lock_level); | 223 | ocfs2_meta_unlock(file->f_dentry->d_inode, lock_level); |
226 | out: | 224 | out: |
227 | vma->vm_ops = &ocfs2_file_vm_ops; | 225 | vma->vm_ops = &ocfs2_file_vm_ops; |
228 | vma->vm_flags |= VM_CAN_INVALIDATE | VM_CAN_NONLINEAR; | 226 | vma->vm_flags |= VM_CAN_NONLINEAR; |
229 | return 0; | 227 | return 0; |
230 | } | 228 | } |
231 | 229 | ||