mm, fs: reduce fault, page_mkwrite, and pfn_mkwrite to take only vmf

->fault(), ->page_mkwrite(), and ->pfn_mkwrite() calls do not need to
take a vma and vmf parameter when the vma already resides in vmf.

Remove the vma parameter to simplify things.

[[email protected]: fix ARM build]
  Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/148521301778.19116.10840599906674778980.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Dave Jiang <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
Reviewed-by: Ross Zwisler <[email protected]>
Cc: Theodore Ts'o <[email protected]>
Cc: Darrick J. Wong <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: Dan Williams <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Dave Jiang 2017-02-24 14:56:41 -08:00 • committed by Linus Torvalds
commit 11bac80004
87 changed files with 283 additions and 290 deletions

View file

@ -348,9 +348,9 @@ static void kernfs_vma_open(struct vm_area_struct *vma)
kernfs_put_active(of->kn);
}
static int kernfs_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
static int kernfs_vma_fault(struct vm_fault *vmf)
{
struct file *file = vma->vm_file;
struct file *file = vmf->vma->vm_file;
struct kernfs_open_file *of = kernfs_of(file);
int ret;
@ -362,16 +362,15 @@ static int kernfs_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
ret = VM_FAULT_SIGBUS;
if (of->vm_ops->fault)
ret = of->vm_ops->fault(vma, vmf);
ret = of->vm_ops->fault(vmf);
kernfs_put_active(of->kn);
return ret;
}
static int kernfs_vma_page_mkwrite(struct vm_area_struct *vma,
struct vm_fault *vmf)
static int kernfs_vma_page_mkwrite(struct vm_fault *vmf)
{
struct file *file = vma->vm_file;
struct file *file = vmf->vma->vm_file;
struct kernfs_open_file *of = kernfs_of(file);
int ret;
@ -383,7 +382,7 @@ static int kernfs_vma_page_mkwrite(struct vm_area_struct *vma,
ret = 0;
if (of->vm_ops->page_mkwrite)
ret = of->vm_ops->page_mkwrite(vma, vmf);
ret = of->vm_ops->page_mkwrite(vmf);
else
file_update_time(file);