Commit 31c49eac authored by Souptick Joarder's avatar Souptick Joarder Committed by Richard Weinberger

fs: ubifs: Adding new return type vm_fault_t

Use new return type vm_fault_t for page_mkwrite handler.
Signed-off-by: default avatarSouptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 29dcea88
...@@ -1513,7 +1513,7 @@ static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags) ...@@ -1513,7 +1513,7 @@ static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags)
* mmap()d file has taken write protection fault and is being made writable. * mmap()d file has taken write protection fault and is being made writable.
* UBIFS must ensure page is budgeted for. * UBIFS must ensure page is budgeted for.
*/ */
static int ubifs_vm_page_mkwrite(struct vm_fault *vmf) static vm_fault_t ubifs_vm_page_mkwrite(struct vm_fault *vmf)
{ {
struct page *page = vmf->page; struct page *page = vmf->page;
struct inode *inode = file_inode(vmf->vma->vm_file); struct inode *inode = file_inode(vmf->vma->vm_file);
...@@ -1567,8 +1567,7 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf) ...@@ -1567,8 +1567,7 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf)
if (unlikely(page->mapping != inode->i_mapping || if (unlikely(page->mapping != inode->i_mapping ||
page_offset(page) > i_size_read(inode))) { page_offset(page) > i_size_read(inode))) {
/* Page got truncated out from underneath us */ /* Page got truncated out from underneath us */
err = -EINVAL; goto sigbus;
goto out_unlock;
} }
if (PagePrivate(page)) if (PagePrivate(page))
...@@ -1597,12 +1596,10 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf) ...@@ -1597,12 +1596,10 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf)
wait_for_stable_page(page); wait_for_stable_page(page);
return VM_FAULT_LOCKED; return VM_FAULT_LOCKED;
out_unlock: sigbus:
unlock_page(page); unlock_page(page);
ubifs_release_budget(c, &req); ubifs_release_budget(c, &req);
if (err) return VM_FAULT_SIGBUS;
err = VM_FAULT_SIGBUS;
return err;
} }
static const struct vm_operations_struct ubifs_file_vm_ops = { static const struct vm_operations_struct ubifs_file_vm_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment