diff options
author | Nick Piggin <npiggin@suse.de> | 2007-07-19 01:47:03 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 10:04:41 -0700 |
commit | d0217ac04ca6591841e5665f518e38064f4e65bd (patch) | |
tree | d3309094bb734d34773f97d642593e298a5cfcfc /fs/ocfs2/mmap.c | |
parent | ed2f2f9b3ff8debdf512f7687b232c3c1d7d60d7 (diff) | |
download | op-kernel-dev-d0217ac04ca6591841e5665f518e38064f4e65bd.zip op-kernel-dev-d0217ac04ca6591841e5665f518e38064f4e65bd.tar.gz |
mm: fault feedback #1
Change ->fault prototype. We now return an int, which contains
VM_FAULT_xxx code in the low byte, and FAULT_RET_xxx code in the next byte.
FAULT_RET_ code tells the VM whether a page was found, whether it has been
locked, and potentially other things. This is not quite the way he wanted
it yet, but that's changed in the next patch (which requires changes to
arch code).
This means we no longer set VM_CAN_INVALIDATE in the vma in order to say
that a page is locked which requires filemap_nopage to go away (because we
can no longer remain backward compatible without that flag), but we were
going to do that anyway.
struct fault_data is renamed to struct vm_fault as Linus asked. address
is now a void __user * that we should firmly encourage drivers not to use
without really good reason.
The page is now returned via a page pointer in the vm_fault struct.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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 cd75508..ee64749 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) return sigprocmask(SIG_SETMASK, oldset, NULL); } -static struct page *ocfs2_fault(struct vm_area_struct *area, - struct fault_data *fdata) +static int ocfs2_fault(struct vm_area_struct *area, struct vm_fault *vmf) { - struct page *page = NULL; sigset_t blocked, oldset; - int ret; + int error, ret; - mlog_entry("(area=%p, page offset=%lu)\n", area, fdata->pgoff); + mlog_entry("(area=%p, page offset=%lu)\n", area, vmf->pgoff); - ret = ocfs2_vm_op_block_sigs(&blocked, &oldset); - if (ret < 0) { - fdata->type = VM_FAULT_SIGBUS; - mlog_errno(ret); + error = ocfs2_vm_op_block_sigs(&blocked, &oldset); + if (error < 0) { + mlog_errno(error); + ret = VM_FAULT_SIGBUS; goto out; } - page = filemap_fault(area, fdata); + ret = filemap_fault(area, vmf); - ret = ocfs2_vm_op_unblock_sigs(&oldset); - if (ret < 0) - mlog_errno(ret); + error = ocfs2_vm_op_unblock_sigs(&oldset); + if (error < 0) + mlog_errno(error); out: - mlog_exit_ptr(page); - return page; + mlog_exit_ptr(vmf->page); + return ret; } 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) ocfs2_meta_unlock(file->f_dentry->d_inode, lock_level); out: vma->vm_ops = &ocfs2_file_vm_ops; - vma->vm_flags |= VM_CAN_INVALIDATE | VM_CAN_NONLINEAR; + vma->vm_flags |= VM_CAN_NONLINEAR; return 0; } |