]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mm, fs: reduce fault, page_mkwrite, and pfn_mkwrite to take only vmf
authorDave Jiang <dave.jiang@intel.com>
Fri, 24 Feb 2017 22:56:41 +0000 (14:56 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 25 Feb 2017 01:46:54 +0000 (17:46 -0800)
->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.

[arnd@arndb.de: fix ARM build]
Link: http://lkml.kernel.org/r/20170125223558.1451224-1-arnd@arndb.de
Link: http://lkml.kernel.org/r/148521301778.19116.10840599906674778980.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Darrick J. Wong <darrick.wong@oracle.com>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jan Kara <jack@suse.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
87 files changed:
arch/powerpc/kvm/book3s_64_vio.c
arch/powerpc/platforms/cell/spufs/file.c
drivers/android/binder.c
drivers/char/agp/alpha-agp.c
drivers/char/mspec.c
drivers/dax/dax.c
drivers/gpu/drm/armada/armada_gem.c
drivers/gpu/drm/drm_vm.c
drivers/gpu/drm/etnaviv/etnaviv_drv.h
drivers/gpu/drm/etnaviv/etnaviv_gem.c
drivers/gpu/drm/exynos/exynos_drm_gem.c
drivers/gpu/drm/exynos/exynos_drm_gem.h
drivers/gpu/drm/gma500/framebuffer.c
drivers/gpu/drm/gma500/gem.c
drivers/gpu/drm/gma500/psb_drv.h
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/msm/msm_drv.h
drivers/gpu/drm/msm/msm_gem.c
drivers/gpu/drm/omapdrm/omap_drv.h
drivers/gpu/drm/omapdrm/omap_gem.c
drivers/gpu/drm/qxl/qxl_ttm.c
drivers/gpu/drm/radeon/radeon_ttm.c
drivers/gpu/drm/tegra/gem.c
drivers/gpu/drm/ttm/ttm_bo_vm.c
drivers/gpu/drm/udl/udl_drv.h
drivers/gpu/drm/udl/udl_gem.c
drivers/gpu/drm/vgem/vgem_drv.c
drivers/gpu/drm/virtio/virtgpu_ttm.c
drivers/hsi/clients/cmt_speech.c
drivers/hwtracing/intel_th/msu.c
drivers/infiniband/hw/hfi1/file_ops.c
drivers/infiniband/hw/qib/qib_file_ops.c
drivers/media/v4l2-core/videobuf-dma-sg.c
drivers/misc/cxl/context.c
drivers/misc/sgi-gru/grumain.c
drivers/misc/sgi-gru/grutables.h
drivers/scsi/cxlflash/superpipe.c
drivers/scsi/sg.c
drivers/staging/android/ion/ion.c
drivers/staging/lustre/lustre/llite/llite_mmap.c
drivers/staging/lustre/lustre/llite/vvp_io.c
drivers/target/target_core_user.c
drivers/uio/uio.c
drivers/usb/mon/mon_bin.c
drivers/video/fbdev/core/fb_defio.c
drivers/xen/privcmd.c
fs/9p/vfs_file.c
fs/btrfs/ctree.h
fs/btrfs/inode.c
fs/ceph/addr.c
fs/cifs/file.c
fs/dax.c
fs/ext2/file.c
fs/ext4/ext4.h
fs/ext4/file.c
fs/ext4/inode.c
fs/f2fs/file.c
fs/fuse/file.c
fs/gfs2/file.c
fs/iomap.c
fs/kernfs/file.c
fs/ncpfs/mmap.c
fs/nfs/file.c
fs/nilfs2/file.c
fs/ocfs2/mmap.c
fs/proc/vmcore.c
fs/ubifs/file.c
fs/xfs/xfs_file.c
include/linux/dax.h
include/linux/iomap.h
include/linux/mm.h
ipc/shm.c
kernel/events/core.c
kernel/relay.c
mm/filemap.c
mm/hugetlb.c
mm/memory.c
mm/mmap.c
mm/nommu.c
mm/shmem.c
security/selinux/selinuxfs.c
sound/core/pcm_native.c
sound/usb/usx2y/us122l.c
sound/usb/usx2y/usX2Yhwdep.c
sound/usb/usx2y/usx2yhwdeppcm.c
virt/kvm/kvm_main.c

index 491c5d8120f75da870e8d030b1044ddfb9c8279d..ab9d14c0e4609ab727e37da83ec62c43cbddf977 100644 (file)
@@ -102,9 +102,9 @@ static void release_spapr_tce_table(struct rcu_head *head)
        kfree(stt);
 }
 
-static int kvm_spapr_tce_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int kvm_spapr_tce_fault(struct vm_fault *vmf)
 {
-       struct kvmppc_spapr_tce_table *stt = vma->vm_file->private_data;
+       struct kvmppc_spapr_tce_table *stt = vmf->vma->vm_file->private_data;
        struct page *page;
 
        if (vmf->pgoff >= kvmppc_tce_pages(stt->size))
index a35e2c29d7eed3b0ee15f2e088e3c0d4aeb8b19a..e5ec1368f0cd7723a6f80c86fd5eadd516f8f6c0 100644 (file)
@@ -233,8 +233,9 @@ spufs_mem_write(struct file *file, const char __user *buffer,
 }
 
 static int
-spufs_mem_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+spufs_mem_mmap_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct spu_context *ctx = vma->vm_file->private_data;
        unsigned long pfn, offset;
 
@@ -311,12 +312,11 @@ static const struct file_operations spufs_mem_fops = {
        .mmap                   = spufs_mem_mmap,
 };
 
-static int spufs_ps_fault(struct vm_area_struct *vma,
-                                   struct vm_fault *vmf,
+static int spufs_ps_fault(struct vm_fault *vmf,
                                    unsigned long ps_offs,
                                    unsigned long ps_size)
 {
-       struct spu_context *ctx = vma->vm_file->private_data;
+       struct spu_context *ctx = vmf->vma->vm_file->private_data;
        unsigned long area, offset = vmf->pgoff << PAGE_SHIFT;
        int ret = 0;
 
@@ -354,7 +354,7 @@ static int spufs_ps_fault(struct vm_area_struct *vma,
                down_read(&current->mm->mmap_sem);
        } else {
                area = ctx->spu->problem_phys + ps_offs;
-               vm_insert_pfn(vma, vmf->address, (area + offset) >> PAGE_SHIFT);
+               vm_insert_pfn(vmf->vma, vmf->address, (area + offset) >> PAGE_SHIFT);
                spu_context_trace(spufs_ps_fault__insert, ctx, ctx->spu);
        }
 
@@ -367,10 +367,9 @@ refault:
 }
 
 #if SPUFS_MMAP_4K
-static int spufs_cntl_mmap_fault(struct vm_area_struct *vma,
-                                          struct vm_fault *vmf)
+static int spufs_cntl_mmap_fault(struct vm_fault *vmf)
 {
-       return spufs_ps_fault(vma, vmf, 0x4000, SPUFS_CNTL_MAP_SIZE);
+       return spufs_ps_fault(vmf, 0x4000, SPUFS_CNTL_MAP_SIZE);
 }
 
 static const struct vm_operations_struct spufs_cntl_mmap_vmops = {
@@ -1067,15 +1066,15 @@ static ssize_t spufs_signal1_write(struct file *file, const char __user *buf,
 }
 
 static int
-spufs_signal1_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+spufs_signal1_mmap_fault(struct vm_fault *vmf)
 {
 #if SPUFS_SIGNAL_MAP_SIZE == 0x1000
-       return spufs_ps_fault(vma, vmf, 0x14000, SPUFS_SIGNAL_MAP_SIZE);
+       return spufs_ps_fault(vmf, 0x14000, SPUFS_SIGNAL_MAP_SIZE);
 #elif SPUFS_SIGNAL_MAP_SIZE == 0x10000
        /* For 64k pages, both signal1 and signal2 can be used to mmap the whole
         * signal 1 and 2 area
         */
-       return spufs_ps_fault(vma, vmf, 0x10000, SPUFS_SIGNAL_MAP_SIZE);
+       return spufs_ps_fault(vmf, 0x10000, SPUFS_SIGNAL_MAP_SIZE);
 #else
 #error unsupported page size
 #endif
@@ -1205,15 +1204,15 @@ static ssize_t spufs_signal2_write(struct file *file, const char __user *buf,
 
 #if SPUFS_MMAP_4K
 static int
-spufs_signal2_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+spufs_signal2_mmap_fault(struct vm_fault *vmf)
 {
 #if SPUFS_SIGNAL_MAP_SIZE == 0x1000
-       return spufs_ps_fault(vma, vmf, 0x1c000, SPUFS_SIGNAL_MAP_SIZE);
+       return spufs_ps_fault(vmf, 0x1c000, SPUFS_SIGNAL_MAP_SIZE);
 #elif SPUFS_SIGNAL_MAP_SIZE == 0x10000
        /* For 64k pages, both signal1 and signal2 can be used to mmap the whole
         * signal 1 and 2 area
         */
-       return spufs_ps_fault(vma, vmf, 0x10000, SPUFS_SIGNAL_MAP_SIZE);
+       return spufs_ps_fault(vmf, 0x10000, SPUFS_SIGNAL_MAP_SIZE);
 #else
 #error unsupported page size
 #endif
@@ -1334,9 +1333,9 @@ DEFINE_SPUFS_ATTRIBUTE(spufs_signal2_type, spufs_signal2_type_get,
 
 #if SPUFS_MMAP_4K
 static int
-spufs_mss_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+spufs_mss_mmap_fault(struct vm_fault *vmf)
 {
-       return spufs_ps_fault(vma, vmf, 0x0000, SPUFS_MSS_MAP_SIZE);
+       return spufs_ps_fault(vmf, 0x0000, SPUFS_MSS_MAP_SIZE);
 }
 
 static const struct vm_operations_struct spufs_mss_mmap_vmops = {
@@ -1396,9 +1395,9 @@ static const struct file_operations spufs_mss_fops = {
 };
 
 static int
-spufs_psmap_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+spufs_psmap_mmap_fault(struct vm_fault *vmf)
 {
-       return spufs_ps_fault(vma, vmf, 0x0000, SPUFS_PS_MAP_SIZE);
+       return spufs_ps_fault(vmf, 0x0000, SPUFS_PS_MAP_SIZE);
 }
 
 static const struct vm_operations_struct spufs_psmap_mmap_vmops = {
@@ -1456,9 +1455,9 @@ static const struct file_operations spufs_psmap_fops = {
 
 #if SPUFS_MMAP_4K
 static int
-spufs_mfc_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+spufs_mfc_mmap_fault(struct vm_fault *vmf)
 {
-       return spufs_ps_fault(vma, vmf, 0x3000, SPUFS_MFC_MAP_SIZE);
+       return spufs_ps_fault(vmf, 0x3000, SPUFS_MFC_MAP_SIZE);
 }
 
 static const struct vm_operations_struct spufs_mfc_mmap_vmops = {
index 15b263a420e8c00168faea63965bf25208980921..2bbcdc6fdfeec96b0c31ef43f3cf0024cfbd4a38 100644 (file)
@@ -3342,7 +3342,7 @@ static void binder_vma_close(struct vm_area_struct *vma)
        binder_defer_work(proc, BINDER_DEFERRED_PUT_FILES);
 }
 
-static int binder_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int binder_vm_fault(struct vm_fault *vmf)
 {
        return VM_FAULT_SIGBUS;
 }
index 737187865269e9470ae6ef59556727144afb54d4..53fe633df1e8d9c1187e862b6a305a1905bbc2bb 100644 (file)
 
 #include "agp.h"
 
-static int alpha_core_agp_vm_fault(struct vm_area_struct *vma,
-                                       struct vm_fault *vmf)
+static int alpha_core_agp_vm_fault(struct vm_fault *vmf)
 {
        alpha_agp_info *agp = agp_bridge->dev_private_data;
        dma_addr_t dma_addr;
        unsigned long pa;
        struct page *page;
 
-       dma_addr = vmf->address - vma->vm_start + agp->aperture.bus_base;
+       dma_addr = vmf->address - vmf->vma->vm_start + agp->aperture.bus_base;
        pa = agp->ops->translate(agp, dma_addr);
 
        if (pa == (unsigned long)-EINVAL)
index a697ca0cab1e1e2ff56fcf86c41793aad507c524..a9c2fa3c81e5385def9e50b3d35cd16ac747efde 100644 (file)
@@ -191,12 +191,12 @@ mspec_close(struct vm_area_struct *vma)
  * Creates a mspec page and maps it to user space.
  */
 static int
-mspec_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+mspec_fault(struct vm_fault *vmf)
 {
        unsigned long paddr, maddr;
        unsigned long pfn;
        pgoff_t index = vmf->pgoff;
-       struct vma_data *vdata = vma->vm_private_data;
+       struct vma_data *vdata = vmf->vma->vm_private_data;
 
        maddr = (volatile unsigned long) vdata->maddr[index];
        if (maddr == 0) {
@@ -227,7 +227,7 @@ mspec_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
         * be because another thread has installed the pte first, so it
         * is no problem.
         */
-       vm_insert_pfn(vma, vmf->address, pfn);
+       vm_insert_pfn(vmf->vma, vmf->address, pfn);
 
        return VM_FAULT_NOPAGE;
 }
index 18e9875f627711b6970bece1a6270901dc6a1497..0261f332bf3ec88f839849eb4574826a2ef4ff2c 100644 (file)
@@ -419,8 +419,7 @@ static phys_addr_t pgoff_to_phys(struct dax_dev *dax_dev, pgoff_t pgoff,
        return -1;
 }
 
-static int __dax_dev_fault(struct dax_dev *dax_dev, struct vm_area_struct *vma,
-               struct vm_fault *vmf)
+static int __dax_dev_fault(struct dax_dev *dax_dev, struct vm_fault *vmf)
 {
        struct device *dev = &dax_dev->dev;
        struct dax_region *dax_region;
@@ -428,7 +427,7 @@ static int __dax_dev_fault(struct dax_dev *dax_dev, struct vm_area_struct *vma,
        phys_addr_t phys;
        pfn_t pfn;
 
-       if (check_vma(dax_dev, vma, __func__))
+       if (check_vma(dax_dev, vmf->vma, __func__))
                return VM_FAULT_SIGBUS;
 
        dax_region = dax_dev->region;
@@ -446,7 +445,7 @@ static int __dax_dev_fault(struct dax_dev *dax_dev, struct vm_area_struct *vma,
 
        pfn = phys_to_pfn_t(phys, dax_region->pfn_flags);
 
-       rc = vm_insert_mixed(vma, vmf->address, pfn);
+       rc = vm_insert_mixed(vmf->vma, vmf->address, pfn);
 
        if (rc == -ENOMEM)
                return VM_FAULT_OOM;
@@ -456,8 +455,9 @@ static int __dax_dev_fault(struct dax_dev *dax_dev, struct vm_area_struct *vma,
        return VM_FAULT_NOPAGE;
 }
 
-static int dax_dev_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int dax_dev_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        int rc;
        struct file *filp = vma->vm_file;
        struct dax_dev *dax_dev = filp->private_data;
@@ -466,7 +466,7 @@ static int dax_dev_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
                        current->comm, (vmf->flags & FAULT_FLAG_WRITE)
                        ? "write" : "read", vma->vm_start, vma->vm_end);
        rcu_read_lock();
-       rc = __dax_dev_fault(dax_dev, vma, vmf);
+       rc = __dax_dev_fault(dax_dev, vmf);
        rcu_read_unlock();
 
        return rc;
index 560d416deab2d8d34575baaefe2c32ae14f31135..1597458d884e26d7a77e75baae3f8dd2343e4cf1 100644 (file)
 #include <drm/armada_drm.h>
 #include "armada_ioctlP.h"
 
-static int armada_gem_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int armada_gem_vm_fault(struct vm_fault *vmf)
 {
-       struct armada_gem_object *obj = drm_to_armada_gem(vma->vm_private_data);
+       struct drm_gem_object *gobj = vmf->vma->vm_private_data;
+       struct armada_gem_object *obj = drm_to_armada_gem(gobj);
        unsigned long pfn = obj->phys_addr >> PAGE_SHIFT;
        int ret;
 
-       pfn += (vmf->address - vma->vm_start) >> PAGE_SHIFT;
-       ret = vm_insert_pfn(vma, vmf->address, pfn);
+       pfn += (vmf->address - vmf->vma->vm_start) >> PAGE_SHIFT;
+       ret = vm_insert_pfn(vmf->vma, vmf->address, pfn);
 
        switch (ret) {
        case 0:
index bd311c77c25447fdc0d167f47dbdd02a2312072f..bae6e26038ee7fd6a4158d23f47d21eaae7c1b85 100644 (file)
@@ -96,8 +96,9 @@ static pgprot_t drm_dma_prot(uint32_t map_type, struct vm_area_struct *vma)
  * map, get the page, increment the use count and return it.
  */
 #if IS_ENABLED(CONFIG_AGP)
-static int drm_do_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int drm_do_vm_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct drm_file *priv = vma->vm_file->private_data;
        struct drm_device *dev = priv->minor->dev;
        struct drm_local_map *map = NULL;
@@ -168,7 +169,7 @@ vm_fault_error:
        return VM_FAULT_SIGBUS; /* Disallow mremap */
 }
 #else
-static int drm_do_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int drm_do_vm_fault(struct vm_fault *vmf)
 {
        return VM_FAULT_SIGBUS;
 }
@@ -184,8 +185,9 @@ static int drm_do_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
  * Get the mapping, find the real physical page to map, get the page, and
  * return it.
  */
-static int drm_do_vm_shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int drm_do_vm_shm_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct drm_local_map *map = vma->vm_private_data;
        unsigned long offset;
        unsigned long i;
@@ -280,14 +282,14 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
 /**
  * \c fault method for DMA virtual memory.
  *
- * \param vma virtual memory area.
  * \param address access address.
  * \return pointer to the page structure.
  *
  * Determine the page number from the page offset and get it from drm_device_dma::pagelist.
  */
-static int drm_do_vm_dma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int drm_do_vm_dma_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct drm_file *priv = vma->vm_file->private_data;
        struct drm_device *dev = priv->minor->dev;
        struct drm_device_dma *dma = dev->dma;
@@ -315,14 +317,14 @@ static int drm_do_vm_dma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 /**
  * \c fault method for scatter-gather virtual memory.
  *
- * \param vma virtual memory area.
  * \param address access address.
  * \return pointer to the page structure.
  *
  * Determine the map offset from the page offset and get it from drm_sg_mem::pagelist.
  */
-static int drm_do_vm_sg_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int drm_do_vm_sg_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct drm_local_map *map = vma->vm_private_data;
        struct drm_file *priv = vma->vm_file->private_data;
        struct drm_device *dev = priv->minor->dev;
@@ -347,24 +349,24 @@ static int drm_do_vm_sg_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        return 0;
 }
 
-static int drm_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int drm_vm_fault(struct vm_fault *vmf)
 {
-       return drm_do_vm_fault(vma, vmf);
+       return drm_do_vm_fault(vmf);
 }
 
-static int drm_vm_shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int drm_vm_shm_fault(struct vm_fault *vmf)
 {
-       return drm_do_vm_shm_fault(vma, vmf);
+       return drm_do_vm_shm_fault(vmf);
 }
 
-static int drm_vm_dma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int drm_vm_dma_fault(struct vm_fault *vmf)
 {
-       return drm_do_vm_dma_fault(vma, vmf);
+       return drm_do_vm_dma_fault(vmf);
 }
 
-static int drm_vm_sg_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int drm_vm_sg_fault(struct vm_fault *vmf)
 {
-       return drm_do_vm_sg_fault(vma, vmf);
+       return drm_do_vm_sg_fault(vmf);
 }
 
 /** AGP virtual memory operations */
index c255eda40526f8082d721541d4e6f2e74079fcb4..e41f38667c1c858a6f28d69d692e72160850c48a 100644 (file)
@@ -73,7 +73,7 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data,
                struct drm_file *file);
 
 int etnaviv_gem_mmap(struct file *filp, struct vm_area_struct *vma);
-int etnaviv_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
+int etnaviv_gem_fault(struct vm_fault *vmf);
 int etnaviv_gem_mmap_offset(struct drm_gem_object *obj, u64 *offset);
 struct sg_table *etnaviv_gem_prime_get_sg_table(struct drm_gem_object *obj);
 void *etnaviv_gem_prime_vmap(struct drm_gem_object *obj);
index aa6e35ddc87f5b5596a5f318ad7d2c5d7098449c..e78f1406885d102af012979e00a1a7a35ee61017 100644 (file)
@@ -175,8 +175,9 @@ int etnaviv_gem_mmap(struct file *filp, struct vm_area_struct *vma)
        return obj->ops->mmap(obj, vma);
 }
 
-int etnaviv_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+int etnaviv_gem_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct drm_gem_object *obj = vma->vm_private_data;
        struct etnaviv_gem_object *etnaviv_obj = to_etnaviv_bo(obj);
        struct page **pages, *page;
index 57b81460fec88743816e1f6ccaefcc2c109728af..4c28f7ffcc4dd1a0593e5c37bb878f6481f1ed70 100644 (file)
@@ -447,8 +447,9 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv,
        return ret;
 }
 
-int exynos_drm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+int exynos_drm_gem_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct drm_gem_object *obj = vma->vm_private_data;
        struct exynos_drm_gem *exynos_gem = to_exynos_gem(obj);
        unsigned long pfn;
index df7c543d6558bdd821b99bc97e2ad01ff5acf471..85457255fcd1aa093ddfb9a8c4e09b5d63720c7f 100644 (file)
@@ -116,7 +116,7 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv,
                                   uint64_t *offset);
 
 /* page fault handler and mmap fault address(virtual) to physical memory. */
-int exynos_drm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
+int exynos_drm_gem_fault(struct vm_fault *vmf);
 
 /* set vm_flags and we can change the vm attribute to other one at here. */
 int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
index da42d2e1d3976b46b267d0b6f00fc398402181c3..ffe6b4ffa1a8a75dabb1a6fcb0017d0ccb6c0f99 100644 (file)
@@ -111,8 +111,9 @@ static int psbfb_pan(struct fb_var_screeninfo *var, struct fb_info *info)
         return 0;
 }
 
-static int psbfb_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int psbfb_vm_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct psb_framebuffer *psbfb = vma->vm_private_data;
        struct drm_device *dev = psbfb->base.dev;
        struct drm_psb_private *dev_priv = dev->dev_private;
index 527c629176603a2369a186b4128785c1c51723ad..7da061aab7299c2b2a38e14fb784c8f233f62468 100644 (file)
@@ -164,8 +164,9 @@ int psb_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
  *     vma->vm_private_data points to the GEM object that is backing this
  *     mapping.
  */
-int psb_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+int psb_gem_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct drm_gem_object *obj;
        struct gtt_range *r;
        int ret;
index 05d7aaf47eea7ce0dda783b027133473f38375d8..83e22fd4cfc0111da5a3b5de8a9d3ce05ba7c7f7 100644 (file)
@@ -752,7 +752,7 @@ extern int psb_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
                        struct drm_mode_create_dumb *args);
 extern int psb_gem_dumb_map_gtt(struct drm_file *file, struct drm_device *dev,
                        uint32_t handle, uint64_t *offset);
-extern int psb_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
+extern int psb_gem_fault(struct vm_fault *vmf);
 
 /* psb_device.c */
 extern const struct psb_ops psb_chip_ops;
index bcc81912b5e5afa23ec9833e5991e835e202e540..0a4b42d313912c3c5b56a449cfac33e63afeb16e 100644 (file)
@@ -3352,7 +3352,7 @@ int __must_check i915_gem_wait_for_idle(struct drm_i915_private *dev_priv,
                                        unsigned int flags);
 int __must_check i915_gem_suspend(struct drm_i915_private *dev_priv);
 void i915_gem_resume(struct drm_i915_private *dev_priv);
-int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
+int i915_gem_fault(struct vm_fault *vmf);
 int i915_gem_object_wait(struct drm_i915_gem_object *obj,
                         unsigned int flags,
                         long timeout,
index 88f3628b4e29bd92707430932d1900034ac35645..6908123162d17cd998c1e7f0bf54a27064e67588 100644 (file)
@@ -1772,7 +1772,6 @@ compute_partial_view(struct drm_i915_gem_object *obj,
 
 /**
  * i915_gem_fault - fault a page into the GTT
- * @area: CPU VMA in question
  * @vmf: fault info
  *
  * The fault handler is set up by drm_gem_mmap() when a object is GTT mapped
@@ -1789,9 +1788,10 @@ compute_partial_view(struct drm_i915_gem_object *obj,
  * The current feature set supported by i915_gem_fault() and thus GTT mmaps
  * is exposed via I915_PARAM_MMAP_GTT_VERSION (see i915_gem_mmap_gtt_version).
  */
-int i915_gem_fault(struct vm_area_struct *area, struct vm_fault *vmf)
+int i915_gem_fault(struct vm_fault *vmf)
 {
 #define MIN_CHUNK_PAGES ((1 << 20) >> PAGE_SHIFT) /* 1 MiB */
+       struct vm_area_struct *area = vmf->vma;
        struct drm_i915_gem_object *obj = to_intel_bo(area->vm_private_data);
        struct drm_device *dev = obj->base.dev;
        struct drm_i915_private *dev_priv = to_i915(dev);
index cdd7b2f8e977644114db727a3309496ef3ecada1..c3b14876edaa0b2d11e08a9edf7873c7752a674e 100644 (file)
@@ -206,7 +206,7 @@ void msm_gem_shrinker_cleanup(struct drm_device *dev);
 int msm_gem_mmap_obj(struct drm_gem_object *obj,
                        struct vm_area_struct *vma);
 int msm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
-int msm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
+int msm_gem_fault(struct vm_fault *vmf);
 uint64_t msm_gem_mmap_offset(struct drm_gem_object *obj);
 int msm_gem_get_iova_locked(struct drm_gem_object *obj, int id,
                uint64_t *iova);
index e140b05af134ae4b92c81991b871d129ea182de0..59811f29607de60f2a22d53f9ec969e62bb39d98 100644 (file)
@@ -191,8 +191,9 @@ int msm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
        return msm_gem_mmap_obj(vma->vm_private_data, vma);
 }
 
-int msm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+int msm_gem_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct drm_gem_object *obj = vma->vm_private_data;
        struct drm_device *dev = obj->dev;
        struct msm_drm_private *priv = dev->dev_private;
index 36d93ce84a294f867e94a63a87d2e5f799da589e..65977982f15f88114f86ee4b7fc2b4bfe5faeb53 100644 (file)
@@ -188,7 +188,7 @@ int omap_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
 int omap_gem_mmap(struct file *filp, struct vm_area_struct *vma);
 int omap_gem_mmap_obj(struct drm_gem_object *obj,
                struct vm_area_struct *vma);
-int omap_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
+int omap_gem_fault(struct vm_fault *vmf);
 int omap_gem_op_start(struct drm_gem_object *obj, enum omap_gem_op op);
 int omap_gem_op_finish(struct drm_gem_object *obj, enum omap_gem_op op);
 int omap_gem_op_sync(struct drm_gem_object *obj, enum omap_gem_op op);
index 74a9968df421dfdc888443b0c2fd387f8f53dd1d..5d5a9f517c30e0a6a0f17fb0d93fe19eae95bd28 100644 (file)
@@ -518,7 +518,6 @@ static int fault_2d(struct drm_gem_object *obj,
 
 /**
  * omap_gem_fault              -       pagefault handler for GEM objects
- * @vma: the VMA of the GEM object
  * @vmf: fault detail
  *
  * Invoked when a fault occurs on an mmap of a GEM managed area. GEM
@@ -529,8 +528,9 @@ static int fault_2d(struct drm_gem_object *obj,
  * vma->vm_private_data points to the GEM object that is backing this
  * mapping.
  */
-int omap_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+int omap_gem_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct drm_gem_object *obj = vma->vm_private_data;
        struct omap_gem_object *omap_obj = to_omap_bo(obj);
        struct drm_device *dev = obj->dev;
index 4e1a40389964fc6416206cf51d2b88c9ed2be6b1..7d1cab57c89ea86a5eb612399d4e871652ad84c0 100644 (file)
@@ -105,15 +105,15 @@ static void qxl_ttm_global_fini(struct qxl_device *qdev)
 static struct vm_operations_struct qxl_ttm_vm_ops;
 static const struct vm_operations_struct *ttm_vm_ops;
 
-static int qxl_ttm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int qxl_ttm_fault(struct vm_fault *vmf)
 {
        struct ttm_buffer_object *bo;
        int r;
 
-       bo = (struct ttm_buffer_object *)vma->vm_private_data;
+       bo = (struct ttm_buffer_object *)vmf->vma->vm_private_data;
        if (bo == NULL)
                return VM_FAULT_NOPAGE;
-       r = ttm_vm_ops->fault(vma, vmf);
+       r = ttm_vm_ops->fault(vmf);
        return r;
 }
 
index 7a10b38529702f68cc82c3557fce6fe3e13b00ec..684f1703aa5c7189bc55ca1633aeafd78a97c55a 100644 (file)
@@ -979,19 +979,19 @@ void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size)
 static struct vm_operations_struct radeon_ttm_vm_ops;
 static const struct vm_operations_struct *ttm_vm_ops = NULL;
 
-static int radeon_ttm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int radeon_ttm_fault(struct vm_fault *vmf)
 {
        struct ttm_buffer_object *bo;
        struct radeon_device *rdev;
        int r;
 
-       bo = (struct ttm_buffer_object *)vma->vm_private_data;  
+       bo = (struct ttm_buffer_object *)vmf->vma->vm_private_data;
        if (bo == NULL) {
                return VM_FAULT_NOPAGE;
        }
        rdev = radeon_get_rdev(bo->bdev);
        down_read(&rdev->pm.mclk_lock);
-       r = ttm_vm_ops->fault(vma, vmf);
+       r = ttm_vm_ops->fault(vmf);
        up_read(&rdev->pm.mclk_lock);
        return r;
 }
index b523a5d4a38c6c57dc79ef5a34c31fa459b4589a..17e62ecb5d4d59d009ef019adb07b0335f60a87d 100644 (file)
@@ -441,8 +441,9 @@ int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm,
        return 0;
 }
 
-static int tegra_bo_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int tegra_bo_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct drm_gem_object *gem = vma->vm_private_data;
        struct tegra_bo *bo = to_tegra_bo(gem);
        struct page *page;
index 88169141bef546e193ac4ed7f6f5ae7f82cba3ab..35ffb3754febc5e2acccfffe0d8c8cc9dc8a8909 100644 (file)
@@ -43,7 +43,6 @@
 #define TTM_BO_VM_NUM_PREFAULT 16
 
 static int ttm_bo_vm_fault_idle(struct ttm_buffer_object *bo,
-                               struct vm_area_struct *vma,
                                struct vm_fault *vmf)
 {
        int ret = 0;
@@ -67,7 +66,7 @@ static int ttm_bo_vm_fault_idle(struct ttm_buffer_object *bo,
                        goto out_unlock;
 
                ttm_bo_reference(bo);
-               up_read(&vma->vm_mm->mmap_sem);
+               up_read(&vmf->vma->vm_mm->mmap_sem);
                (void) dma_fence_wait(bo->moving, true);
                ttm_bo_unreserve(bo);
                ttm_bo_unref(&bo);
@@ -92,8 +91,9 @@ out_unlock:
        return ret;
 }
 
-static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int ttm_bo_vm_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct ttm_buffer_object *bo = (struct ttm_buffer_object *)
            vma->vm_private_data;
        struct ttm_bo_device *bdev = bo->bdev;
@@ -124,7 +124,7 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
                if (vmf->flags & FAULT_FLAG_ALLOW_RETRY) {
                        if (!(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) {
                                ttm_bo_reference(bo);
-                               up_read(&vma->vm_mm->mmap_sem);
+                               up_read(&vmf->vma->vm_mm->mmap_sem);
                                (void) ttm_bo_wait_unreserved(bo);
                                ttm_bo_unref(&bo);
                        }
@@ -168,7 +168,7 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
         * Wait for buffer data in transit, due to a pipelined
         * move.
         */
-       ret = ttm_bo_vm_fault_idle(bo, vma, vmf);
+       ret = ttm_bo_vm_fault_idle(bo, vmf);
        if (unlikely(ret != 0)) {
                retval = ret;
 
index 6c4286e57362ad5af12790c3c9d7742d5d12417c..2a75ab80527a954990c6ee2305883a97fa2ea41b 100644 (file)
@@ -134,7 +134,7 @@ void udl_gem_put_pages(struct udl_gem_object *obj);
 int udl_gem_vmap(struct udl_gem_object *obj);
 void udl_gem_vunmap(struct udl_gem_object *obj);
 int udl_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
-int udl_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
+int udl_gem_fault(struct vm_fault *vmf);
 
 int udl_handle_damage(struct udl_framebuffer *fb, int x, int y,
                      int width, int height);
index 3c0c4bd3f7506f56c165d457ba68841e9f987a57..775c50e4f02cdc7d6b6ef1ddbb35a8d67e63badd 100644 (file)
@@ -100,8 +100,9 @@ int udl_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
        return ret;
 }
 
-int udl_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+int udl_gem_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct udl_gem_object *obj = to_udl_bo(vma->vm_private_data);
        struct page *page;
        unsigned int page_offset;
index 477e07f0ecb674e906994595e60a948e79896c30..7ccbb03e98de5db2f04319d831963aacfc9498db 100644 (file)
@@ -50,8 +50,9 @@ static void vgem_gem_free_object(struct drm_gem_object *obj)
        kfree(vgem_obj);
 }
 
-static int vgem_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int vgem_gem_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct drm_vgem_gem_object *obj = vma->vm_private_data;
        /* We don't use vmf->pgoff since that has the fake offset */
        unsigned long vaddr = vmf->address;
index 9cc7079f7acad025b89beae96c88c47eb45ec9b0..70ec8ca8d9b19cb6fb1a078a2ceaeec309d57523 100644 (file)
@@ -114,18 +114,17 @@ static void virtio_gpu_ttm_global_fini(struct virtio_gpu_device *vgdev)
 static struct vm_operations_struct virtio_gpu_ttm_vm_ops;
 static const struct vm_operations_struct *ttm_vm_ops;
 
-static int virtio_gpu_ttm_fault(struct vm_area_struct *vma,
-                               struct vm_fault *vmf)
+static int virtio_gpu_ttm_fault(struct vm_fault *vmf)
 {
        struct ttm_buffer_object *bo;
        struct virtio_gpu_device *vgdev;
        int r;
 
-       bo = (struct ttm_buffer_object *)vma->vm_private_data;
+       bo = (struct ttm_buffer_object *)vmf->vma->vm_private_data;
        if (bo == NULL)
                return VM_FAULT_NOPAGE;
        vgdev = virtio_gpu_get_vgdev(bo->bdev);
-       r = ttm_vm_ops->fault(vma, vmf);
+       r = ttm_vm_ops->fault(vmf);
        return r;
 }
 #endif
index 3deef6cc7d7c230dfa3527b5a53b9089239c9de6..7175e6bedf2185876b622d4467bc23e61d75ca21 100644 (file)
@@ -1098,9 +1098,9 @@ static void cs_hsi_stop(struct cs_hsi_iface *hi)
        kfree(hi);
 }
 
-static int cs_char_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int cs_char_vma_fault(struct vm_fault *vmf)
 {
-       struct cs_char *csdata = vma->vm_private_data;
+       struct cs_char *csdata = vmf->vma->vm_private_data;
        struct page *page;
 
        page = virt_to_page(csdata->mmap_base);
index e8d55a153a654881d4339712872a87e5b407c372..e88afe1a435cc7fc9be0cb15cf7eee8bfcf8ff6e 100644 (file)
@@ -1188,9 +1188,9 @@ static void msc_mmap_close(struct vm_area_struct *vma)
        mutex_unlock(&msc->buf_mutex);
 }
 
-static int msc_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int msc_mmap_fault(struct vm_fault *vmf)
 {
-       struct msc_iter *iter = vma->vm_file->private_data;
+       struct msc_iter *iter = vmf->vma->vm_file->private_data;
        struct msc *msc = iter->msc;
 
        vmf->page = msc_buffer_get_page(msc, vmf->pgoff);
@@ -1198,7 +1198,7 @@ static int msc_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
                return VM_FAULT_SIGBUS;
 
        get_page(vmf->page);
-       vmf->page->mapping = vma->vm_file->f_mapping;
+       vmf->page->mapping = vmf->vma->vm_file->f_mapping;
        vmf->page->index = vmf->pgoff;
 
        return 0;
index bd786b7bd30b1256f523a89357e52d12f2a4266c..f46033984d077e0eda4fd8c63a39b4b33a93b4ca 100644 (file)
@@ -92,7 +92,7 @@ static unsigned int poll_next(struct file *, struct poll_table_struct *);
 static int user_event_ack(struct hfi1_ctxtdata *, int, unsigned long);
 static int set_ctxt_pkey(struct hfi1_ctxtdata *, unsigned, u16);
 static int manage_rcvq(struct hfi1_ctxtdata *, unsigned, int);
-static int vma_fault(struct vm_area_struct *, struct vm_fault *);
+static int vma_fault(struct vm_fault *);
 static long hfi1_file_ioctl(struct file *fp, unsigned int cmd,
                            unsigned long arg);
 
@@ -695,7 +695,7 @@ done:
  * Local (non-chip) user memory is not mapped right away but as it is
  * accessed by the user-level code.
  */
-static int vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int vma_fault(struct vm_fault *vmf)
 {
        struct page *page;
 
index 2d1eacf1dfed601c0b5f3f04a87d5ca8ebc532e0..9396c1807cc3ec5d023f1bb1ce60a2d359da0a2f 100644 (file)
@@ -893,7 +893,7 @@ bail:
 /*
  * qib_file_vma_fault - handle a VMA page fault.
  */
-static int qib_file_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int qib_file_vma_fault(struct vm_fault *vmf)
 {
        struct page *page;
 
index ba63ca57ed7ebe0bf47cb6826b66e22518ca02ab..36bd904946bd34c0dec9d0295020117a31322933 100644 (file)
@@ -434,8 +434,9 @@ static void videobuf_vm_close(struct vm_area_struct *vma)
  * now ...).  Bounce buffers don't work very well for the data rates
  * video capture has.
  */
-static int videobuf_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int videobuf_vm_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct page *page;
 
        dprintk(3, "fault: fault @ %08lx [vma %08lx-%08lx]\n",
index 3907387b6d1564c5ffc7a7fbcc17a6402d1aaf68..062bf6ca262580a61f0cc57f09261312b5015d69 100644 (file)
@@ -121,8 +121,9 @@ void cxl_context_set_mapping(struct cxl_context *ctx,
        mutex_unlock(&ctx->mapping_lock);
 }
 
-static int cxl_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int cxl_mmap_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct cxl_context *ctx = vma->vm_file->private_data;
        u64 area, offset;
 
index af2e077da4b89402d3b256de648e0cbaadd17f4e..3641f1334cf0889934f74aa960f7879f5c8d53f8 100644 (file)
@@ -926,8 +926,9 @@ again:
  *
  *     Note: gru segments alway mmaped on GRU_GSEG_PAGESIZE boundaries.
  */
-int gru_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+int gru_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct gru_thread_state *gts;
        unsigned long paddr, vaddr;
        unsigned long expires;
index 5c3ce24596753afad29180aa88e6dd7a78d209c8..b5e308b50ed18036fa71aaadbf9e6c22c6481533 100644 (file)
@@ -665,7 +665,7 @@ extern unsigned long gru_reserve_cb_resources(struct gru_state *gru,
                int cbr_au_count, char *cbmap);
 extern unsigned long gru_reserve_ds_resources(struct gru_state *gru,
                int dsr_au_count, char *dsmap);
-extern int gru_fault(struct vm_area_struct *, struct vm_fault *vmf);
+extern int gru_fault(struct vm_fault *vmf);
 extern struct gru_mm_struct *gru_register_mmu_notifier(void);
 extern void gru_drop_mmu_notifier(struct gru_mm_struct *gms);
 
index 90869cee2b20b2bcf682d54425dd9fe66b72b519..ef5bf55f08a4c6e837c10fe14785cb1a40a286a8 100644 (file)
@@ -1053,7 +1053,6 @@ out:
 
 /**
  * cxlflash_mmap_fault() - mmap fault handler for adapter file descriptor
- * @vma:       VM area associated with mapping.
  * @vmf:       VM fault associated with current fault.
  *
  * To support error notification via MMIO, faults are 'caught' by this routine
@@ -1067,8 +1066,9 @@ out:
  *
  * Return: 0 on success, VM_FAULT_SIGBUS on failure
  */
-static int cxlflash_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int cxlflash_mmap_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct file *file = vma->vm_file;
        struct cxl_context *ctx = cxl_fops_get_context(file);
        struct cxlflash_cfg *cfg = container_of(file->f_op, struct cxlflash_cfg,
@@ -1097,7 +1097,7 @@ static int cxlflash_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 
        if (likely(!ctxi->err_recovery_active)) {
                vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-               rc = ctxi->cxl_mmap_vmops->fault(vma, vmf);
+               rc = ctxi->cxl_mmap_vmops->fault(vmf);
        } else {
                dev_dbg(dev, "%s: err recovery active, use err_page\n",
                        __func__);
index e831e01f9fa68546083ae43c82d708980425d83c..29b86505f796d9fa57c19b958c1c7ae4ef31b298 100644 (file)
@@ -1185,8 +1185,9 @@ sg_fasync(int fd, struct file *filp, int mode)
 }
 
 static int
-sg_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+sg_vma_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        Sg_fd *sfp;
        unsigned long offset, len, sa;
        Sg_scatter_hold *rsv_schp;
index 969600779e44d7e664121177d86e95ea9d61089b..2c3ffbcbd621a5d3236e25e72ee8dda2884b75c3 100644 (file)
@@ -870,9 +870,9 @@ static void ion_buffer_sync_for_device(struct ion_buffer *buffer,
        mutex_unlock(&buffer->lock);
 }
 
-static int ion_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int ion_vm_fault(struct vm_fault *vmf)
 {
-       struct ion_buffer *buffer = vma->vm_private_data;
+       struct ion_buffer *buffer = vmf->vma->vm_private_data;
        unsigned long pfn;
        int ret;
 
@@ -881,7 +881,7 @@ static int ion_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        BUG_ON(!buffer->pages || !buffer->pages[vmf->pgoff]);
 
        pfn = page_to_pfn(ion_buffer_page(buffer->pages[vmf->pgoff]));
-       ret = vm_insert_pfn(vma, vmf->address, pfn);
+       ret = vm_insert_pfn(vmf->vma, vmf->address, pfn);
        mutex_unlock(&buffer->lock);
        if (ret)
                return VM_FAULT_ERROR;
index 9afa6bec3e6f44e22f1bf4fbcbd76e4476348fb3..896196c74cd2b91766e45cefb7f8cf00f2f63fc5 100644 (file)
@@ -321,7 +321,7 @@ out:
        return fault_ret;
 }
 
-static int ll_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int ll_fault(struct vm_fault *vmf)
 {
        int count = 0;
        bool printed = false;
@@ -335,7 +335,7 @@ static int ll_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        set = cfs_block_sigsinv(sigmask(SIGKILL) | sigmask(SIGTERM));
 
 restart:
-       result = ll_fault0(vma, vmf);
+       result = ll_fault0(vmf->vma, vmf);
        LASSERT(!(result & VM_FAULT_LOCKED));
        if (result == 0) {
                struct page *vmpage = vmf->page;
@@ -362,8 +362,9 @@ restart:
        return result;
 }
 
-static int ll_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int ll_page_mkwrite(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        int count = 0;
        bool printed = false;
        bool retry;
index 3e9cf710501b7c5847d73414a6e689709de867a6..4c57755e06e75b834393a87e83ea4e5c4c7a4acb 100644 (file)
@@ -1014,7 +1014,7 @@ static int vvp_io_kernel_fault(struct vvp_fault_io *cfio)
 {
        struct vm_fault *vmf = cfio->ft_vmf;
 
-       cfio->ft_flags = filemap_fault(cfio->ft_vma, vmf);
+       cfio->ft_flags = filemap_fault(vmf);
        cfio->ft_flags_valid = 1;
 
        if (vmf->page) {
index 8041710b697298ec7073c4e5910849bd1a154703..5c1cb2df3a548b354a712dd12bba926eb2786bdd 100644 (file)
@@ -783,15 +783,15 @@ static int tcmu_find_mem_index(struct vm_area_struct *vma)
        return -1;
 }
 
-static int tcmu_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int tcmu_vma_fault(struct vm_fault *vmf)
 {
-       struct tcmu_dev *udev = vma->vm_private_data;
+       struct tcmu_dev *udev = vmf->vma->vm_private_data;
        struct uio_info *info = &udev->uio_info;
        struct page *page;
        unsigned long offset;
        void *addr;
 
-       int mi = tcmu_find_mem_index(vma);
+       int mi = tcmu_find_mem_index(vmf->vma);
        if (mi < 0)
                return VM_FAULT_SIGBUS;
 
index fba021f5736afdee41fd914da4648e8bf71874b6..31d95dc9c202daab21e996015ee7d4b8e466ea32 100644 (file)
@@ -597,14 +597,14 @@ static int uio_find_mem_index(struct vm_area_struct *vma)
        return -1;
 }
 
-static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int uio_vma_fault(struct vm_fault *vmf)
 {
-       struct uio_device *idev = vma->vm_private_data;
+       struct uio_device *idev = vmf->vma->vm_private_data;
        struct page *page;
        unsigned long offset;
        void *addr;
 
-       int mi = uio_find_mem_index(vma);
+       int mi = uio_find_mem_index(vmf->vma);
        if (mi < 0)
                return VM_FAULT_SIGBUS;
 
index 91c22276c03b55c2c78e0de55e8a2a9b618607ea..9fb8b1e6ecc26dec4c93a24ee9192d7ccc0b8f19 100644 (file)
@@ -1223,9 +1223,9 @@ static void mon_bin_vma_close(struct vm_area_struct *vma)
 /*
  * Map ring pages to user space.
  */
-static int mon_bin_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int mon_bin_vma_fault(struct vm_fault *vmf)
 {
-       struct mon_reader_bin *rp = vma->vm_private_data;
+       struct mon_reader_bin *rp = vmf->vma->vm_private_data;
        unsigned long offset, chunk_idx;
        struct page *pageptr;
 
index 74b5bcac8bf22af140f5c1afb9062eef0639f221..37f69c061210edf8a4b30799535555ed676fe2fd 100644 (file)
@@ -37,12 +37,11 @@ static struct page *fb_deferred_io_page(struct fb_info *info, unsigned long offs
 }
 
 /* this is to find and return the vmalloc-ed fb pages */
-static int fb_deferred_io_fault(struct vm_area_struct *vma,
-                               struct vm_fault *vmf)
+static int fb_deferred_io_fault(struct vm_fault *vmf)
 {
        unsigned long offset;
        struct page *page;
-       struct fb_info *info = vma->vm_private_data;
+       struct fb_info *info = vmf->vma->vm_private_data;
 
        offset = vmf->pgoff << PAGE_SHIFT;
        if (offset >= info->fix.smem_len)
@@ -54,8 +53,8 @@ static int fb_deferred_io_fault(struct vm_area_struct *vma,
 
        get_page(page);
 
-       if (vma->vm_file)
-               page->mapping = vma->vm_file->f_mapping;
+       if (vmf->vma->vm_file)
+               page->mapping = vmf->vma->vm_file->f_mapping;
        else
                printk(KERN_ERR "no mapping available\n");
 
@@ -91,11 +90,10 @@ int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasy
 EXPORT_SYMBOL_GPL(fb_deferred_io_fsync);
 
 /* vm_ops->page_mkwrite handler */
-static int fb_deferred_io_mkwrite(struct vm_area_struct *vma,
-                                 struct vm_fault *vmf)
+static int fb_deferred_io_mkwrite(struct vm_fault *vmf)
 {
        struct page *page = vmf->page;
-       struct fb_info *info = vma->vm_private_data;
+       struct fb_info *info = vmf->vma->vm_private_data;
        struct fb_deferred_io *fbdefio = info->fbdefio;
        struct page *cur;
 
@@ -105,7 +103,7 @@ static int fb_deferred_io_mkwrite(struct vm_area_struct *vma,
        deferred framebuffer IO. then if userspace touches a page
        again, we repeat the same scheme */
 
-       file_update_time(vma->vm_file);
+       file_update_time(vmf->vma->vm_file);
 
        /* protect against the workqueue changing the page list */
        mutex_lock(&fbdefio->lock);
index 2077a3ac7c0ca5ac12b111981ec7c64a59fa77f0..7a92a5e1d40c6f17227936ee2b6925286deab511 100644 (file)
@@ -804,10 +804,10 @@ static void privcmd_close(struct vm_area_struct *vma)
        kfree(pages);
 }
 
-static int privcmd_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int privcmd_fault(struct vm_fault *vmf)
 {
        printk(KERN_DEBUG "privcmd_fault: vma=%p %lx-%lx, pgoff=%lx, uv=%p\n",
-              vma, vma->vm_start, vma->vm_end,
+              vmf->vma, vmf->vma->vm_start, vmf->vma->vm_end,
               vmf->pgoff, (void *)vmf->address);
 
        return VM_FAULT_SIGBUS;
index 6a0f3fa85ef7c3390fa00d79c0b1773f41a68778..3de3b4a89d89a16a2f23b63a990f8959568583df 100644 (file)
@@ -534,11 +534,11 @@ v9fs_mmap_file_mmap(struct file *filp, struct vm_area_struct *vma)
 }
 
 static int
-v9fs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
+v9fs_vm_page_mkwrite(struct vm_fault *vmf)
 {
        struct v9fs_inode *v9inode;
        struct page *page = vmf->page;
-       struct file *filp = vma->vm_file;
+       struct file *filp = vmf->vma->vm_file;
        struct inode *inode = file_inode(filp);
 
 
index 6a823719b6c580557cccab3d01123d50857ad334..adf16307842ab51b53f6b66eeb383aba7ba8a8e2 100644 (file)
@@ -3147,7 +3147,7 @@ int btrfs_create_subvol_root(struct btrfs_trans_handle *trans,
 int btrfs_merge_bio_hook(struct page *page, unsigned long offset,
                         size_t size, struct bio *bio,
                         unsigned long bio_flags);
-int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);
+int btrfs_page_mkwrite(struct vm_fault *vmf);
 int btrfs_readpage(struct file *file, struct page *page);
 void btrfs_evict_inode(struct inode *inode);
 int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc);
index 1e861a063721e7c173a770cd68d0fea484cb75b3..ea1d500cfba6d941c8dd5f78a76c6b97ad19c924 100644 (file)
@@ -8964,10 +8964,10 @@ again:
  * beyond EOF, then the page is guaranteed safe against truncation until we
  * unlock the page.
  */
-int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
+int btrfs_page_mkwrite(struct vm_fault *vmf)
 {
        struct page *page = vmf->page;
-       struct inode *inode = file_inode(vma->vm_file);
+       struct inode *inode = file_inode(vmf->vma->vm_file);
        struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
        struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
        struct btrfs_ordered_extent *ordered;
@@ -9000,7 +9000,7 @@ int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
        ret = btrfs_delalloc_reserve_space(inode, page_start,
                                           reserved_space);
        if (!ret) {
-               ret = file_update_time(vma->vm_file);
+               ret = file_update_time(vmf->vma->vm_file);
                reserved = 1;
        }
        if (ret) {
index e4b066cd912ad9ea249c3c88f81026a68186095c..09860c0ec7c1d4aeaeb348d9719b15f7e015b7b6 100644 (file)
@@ -1386,8 +1386,9 @@ static void ceph_restore_sigs(sigset_t *oldset)
 /*
  * vm ops
  */
-static int ceph_filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int ceph_filemap_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct inode *inode = file_inode(vma->vm_file);
        struct ceph_inode_info *ci = ceph_inode(inode);
        struct ceph_file_info *fi = vma->vm_file->private_data;
@@ -1416,7 +1417,7 @@ static int ceph_filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        if ((got & (CEPH_CAP_FILE_CACHE | CEPH_CAP_FILE_LAZYIO)) ||
            ci->i_inline_version == CEPH_INLINE_NONE) {
                current->journal_info = vma->vm_file;
-               ret = filemap_fault(vma, vmf);
+               ret = filemap_fault(vmf);
                current->journal_info = NULL;
        } else
                ret = -EAGAIN;
@@ -1477,8 +1478,9 @@ out_restore:
 /*
  * Reuse write_begin here for simplicity.
  */
-static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int ceph_page_mkwrite(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct inode *inode = file_inode(vma->vm_file);
        struct ceph_inode_info *ci = ceph_inode(inode);
        struct ceph_file_info *fi = vma->vm_file->private_data;
index 98dc842e724512cb5eb71d5f1d94ccb0afe1222e..aa3debbba82648944a1e1426516abebb268b7ca0 100644 (file)
@@ -3282,7 +3282,7 @@ cifs_read(struct file *file, char *read_data, size_t read_size, loff_t *offset)
  * sure that it doesn't change while being written back.
  */
 static int
-cifs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
+cifs_page_mkwrite(struct vm_fault *vmf)
 {
        struct page *page = vmf->page;
 
index 3f1181563fb173a268147f8626a072ac289269fa..f955c0df33bbf29530f331008c1cfa9f1a0b6932 100644 (file)
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -925,12 +925,11 @@ static int dax_insert_mapping(struct address_space *mapping,
 
 /**
  * dax_pfn_mkwrite - handle first write to DAX page
- * @vma: The virtual memory area where the fault occurred
  * @vmf: The description of the fault
  */
-int dax_pfn_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
+int dax_pfn_mkwrite(struct vm_fault *vmf)
 {
-       struct file *file = vma->vm_file;
+       struct file *file = vmf->vma->vm_file;
        struct address_space *mapping = file->f_mapping;
        void *entry, **slot;
        pgoff_t index = vmf->pgoff;
@@ -1121,7 +1120,6 @@ static int dax_fault_return(int error)
 
 /**
  * dax_iomap_fault - handle a page fault on a DAX file
- * @vma: The virtual memory area where the fault occurred
  * @vmf: The description of the fault
  * @ops: iomap ops passed from the file system
  *
@@ -1129,10 +1127,9 @@ static int dax_fault_return(int error)
  * or mkwrite handler for DAX files. Assumes the caller has done all the
  * necessary locking for the page fault to proceed successfully.
  */
-int dax_iomap_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
-                       const struct iomap_ops *ops)
+int dax_iomap_fault(struct vm_fault *vmf, const struct iomap_ops *ops)
 {
-       struct address_space *mapping = vma->vm_file->f_mapping;
+       struct address_space *mapping = vmf->vma->vm_file->f_mapping;
        struct inode *inode = mapping->host;
        unsigned long vaddr = vmf->address;
        loff_t pos = (loff_t)vmf->pgoff << PAGE_SHIFT;
@@ -1205,11 +1202,11 @@ int dax_iomap_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
        case IOMAP_MAPPED:
                if (iomap.flags & IOMAP_F_NEW) {
                        count_vm_event(PGMAJFAULT);
-                       mem_cgroup_count_vm_event(vma->vm_mm, PGMAJFAULT);
+                       mem_cgroup_count_vm_event(vmf->vma->vm_mm, PGMAJFAULT);
                        major = VM_FAULT_MAJOR;
                }
                error = dax_insert_mapping(mapping, iomap.bdev, sector,
-                               PAGE_SIZE, &entry, vma, vmf);
+                               PAGE_SIZE, &entry, vmf->vma, vmf);
                /* -EBUSY is fine, somebody else faulted on the same PTE */
                if (error == -EBUSY)
                        error = 0;
index b0f241528a30a5e631e134556c1e9db9e3772c41..0bf0d971205a5693334c448ac36dba907c9de8e1 100644 (file)
@@ -87,19 +87,19 @@ out_unlock:
  * The default page_lock and i_size verification done by non-DAX fault paths
  * is sufficient because ext2 doesn't support hole punching.
  */
-static int ext2_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int ext2_dax_fault(struct vm_fault *vmf)
 {
-       struct inode *inode = file_inode(vma->vm_file);
+       struct inode *inode = file_inode(vmf->vma->vm_file);
        struct ext2_inode_info *ei = EXT2_I(inode);
        int ret;
 
        if (vmf->flags & FAULT_FLAG_WRITE) {
                sb_start_pagefault(inode->i_sb);
-               file_update_time(vma->vm_file);
+               file_update_time(vmf->vma->vm_file);
        }
        down_read(&ei->dax_sem);
 
-       ret = dax_iomap_fault(vma, vmf, &ext2_iomap_ops);
+       ret = dax_iomap_fault(vmf, &ext2_iomap_ops);
 
        up_read(&ei->dax_sem);
        if (vmf->flags & FAULT_FLAG_WRITE)
@@ -107,16 +107,15 @@ static int ext2_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        return ret;
 }
 
-static int ext2_dax_pfn_mkwrite(struct vm_area_struct *vma,
-               struct vm_fault *vmf)
+static int ext2_dax_pfn_mkwrite(struct vm_fault *vmf)
 {
-       struct inode *inode = file_inode(vma->vm_file);
+       struct inode *inode = file_inode(vmf->vma->vm_file);
        struct ext2_inode_info *ei = EXT2_I(inode);
        loff_t size;
        int ret;
 
        sb_start_pagefault(inode->i_sb);
-       file_update_time(vma->vm_file);
+       file_update_time(vmf->vma->vm_file);
        down_read(&ei->dax_sem);
 
        /* check that the faulting page hasn't raced with truncate */
@@ -124,7 +123,7 @@ static int ext2_dax_pfn_mkwrite(struct vm_area_struct *vma,
        if (vmf->pgoff >= size)
                ret = VM_FAULT_SIGBUS;
        else
-               ret = dax_pfn_mkwrite(vma, vmf);
+               ret = dax_pfn_mkwrite(vmf);
 
        up_read(&ei->dax_sem);
        sb_end_pagefault(inode->i_sb);
index cee23b684f4784e5ed067f7bbd4e5fb7d3c57384..2fd17e8e498416a360ee04bc9a612df0096c5a42 100644 (file)
@@ -2483,8 +2483,8 @@ extern int ext4_writepage_trans_blocks(struct inode *);
 extern int ext4_chunk_trans_blocks(struct inode *, int nrblocks);
 extern int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode,
                             loff_t lstart, loff_t lend);
-extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);
-extern int ext4_filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
+extern int ext4_page_mkwrite(struct vm_fault *vmf);
+extern int ext4_filemap_fault(struct vm_fault *vmf);
 extern qsize_t *ext4_get_reserved_space(struct inode *inode);
 extern int ext4_get_projid(struct inode *inode, kprojid_t *projid);
 extern void ext4_da_update_reserve_space(struct inode *inode,
index 13021a054fc080e4a75de2ecec11daa139cd7443..21e1f17fe36da1a611e2e1ba0552245a6dd7d889 100644 (file)
@@ -253,19 +253,19 @@ out:
 }
 
 #ifdef CONFIG_FS_DAX
-static int ext4_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int ext4_dax_fault(struct vm_fault *vmf)
 {
        int result;
-       struct inode *inode = file_inode(vma->vm_file);
+       struct inode *inode = file_inode(vmf->vma->vm_file);
        struct super_block *sb = inode->i_sb;
        bool write = vmf->flags & FAULT_FLAG_WRITE;
 
        if (write) {
                sb_start_pagefault(sb);
-               file_update_time(vma->vm_file);
+               file_update_time(vmf->vma->vm_file);
        }
        down_read(&EXT4_I(inode)->i_mmap_sem);
-       result = dax_iomap_fault(vma, vmf, &ext4_iomap_ops);
+       result = dax_iomap_fault(vmf, &ext4_iomap_ops);
        up_read(&EXT4_I(inode)->i_mmap_sem);
        if (write)
                sb_end_pagefault(sb);
@@ -303,22 +303,21 @@ ext4_dax_pmd_fault(struct vm_fault *vmf)
  * wp_pfn_shared() fails. Thus fault gets retried and things work out as
  * desired.
  */
-static int ext4_dax_pfn_mkwrite(struct vm_area_struct *vma,
-                               struct vm_fault *vmf)
+static int ext4_dax_pfn_mkwrite(struct vm_fault *vmf)
 {
-       struct inode *inode = file_inode(vma->vm_file);
+       struct inode *inode = file_inode(vmf->vma->vm_file);
        struct super_block *sb = inode->i_sb;
        loff_t size;
        int ret;
 
        sb_start_pagefault(sb);
-       file_update_time(vma->vm_file);
+       file_update_time(vmf->vma->vm_file);
        down_read(&EXT4_I(inode)->i_mmap_sem);
        size = (i_size_read(inode) + PAGE_SIZE - 1) >> PAGE_SHIFT;
        if (vmf->pgoff >= size)
                ret = VM_FAULT_SIGBUS;
        else
-               ret = dax_pfn_mkwrite(vma, vmf);
+               ret = dax_pfn_mkwrite(vmf);
        up_read(&EXT4_I(inode)->i_mmap_sem);
        sb_end_pagefault(sb);
 
index 75212a6e69f8e7ceb05e1ac38ab46f9d71e0f7ce..41d8e53e5a7f402c5b4de9d3d2bc018059290010 100644 (file)
@@ -5821,8 +5821,9 @@ static int ext4_bh_unmapped(handle_t *handle, struct buffer_head *bh)
        return !buffer_mapped(bh);
 }
 
-int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
+int ext4_page_mkwrite(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct page *page = vmf->page;
        loff_t size;
        unsigned long len;
@@ -5912,13 +5913,13 @@ out:
        return ret;
 }
 
-int ext4_filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+int ext4_filemap_fault(struct vm_fault *vmf)
 {
-       struct inode *inode = file_inode(vma->vm_file);
+       struct inode *inode = file_inode(vmf->vma->vm_file);
        int err;
 
        down_read(&EXT4_I(inode)->i_mmap_sem);
-       err = filemap_fault(vma, vmf);
+       err = filemap_fault(vmf);
        up_read(&EXT4_I(inode)->i_mmap_sem);
 
        return err;
index 49f10dce817dc9e4806b6a417b96391a1c794fd1..1edc86e874e37054a10d367b0a44c1f80b7bebfd 100644 (file)
 #include "trace.h"
 #include <trace/events/f2fs.h>
 
-static int f2fs_vm_page_mkwrite(struct vm_area_struct *vma,
-                                               struct vm_fault *vmf)
+static int f2fs_vm_page_mkwrite(struct vm_fault *vmf)
 {
        struct page *page = vmf->page;
-       struct inode *inode = file_inode(vma->vm_file);
+       struct inode *inode = file_inode(vmf->vma->vm_file);
        struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
        struct dnode_of_data dn;
        int err;
@@ -58,7 +57,7 @@ static int f2fs_vm_page_mkwrite(struct vm_area_struct *vma,
 
        f2fs_balance_fs(sbi, dn.node_changed);
 
-       file_update_time(vma->vm_file);
+       file_update_time(vmf->vma->vm_file);
        lock_page(page);
        if (unlikely(page->mapping != inode->i_mapping ||
                        page_offset(page) > i_size_read(inode) ||
index 2401c5dabb2a227b6511be01b1589ffa5180e636..e80bfd06daf5fc760a16a4a4315a791a1bc347e5 100644 (file)
@@ -2043,12 +2043,12 @@ static void fuse_vma_close(struct vm_area_struct *vma)
  * - sync(2)
  * - try_to_free_pages() with order > PAGE_ALLOC_COSTLY_ORDER
  */
-static int fuse_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int fuse_page_mkwrite(struct vm_fault *vmf)
 {
        struct page *page = vmf->page;
-       struct inode *inode = file_inode(vma->vm_file);
+       struct inode *inode = file_inode(vmf->vma->vm_file);
 
-       file_update_time(vma->vm_file);
+       file_update_time(vmf->vma->vm_file);
        lock_page(page);
        if (page->mapping != inode->i_mapping) {
                unlock_page(page);
index 016c11eaca7cdd687bbbf88fb8d979f4eddc6010..6fe2a59c6a9a5e8ba14e7ff4f4fefd729686bf58 100644 (file)
@@ -379,10 +379,10 @@ static int gfs2_allocate_page_backing(struct page *page)
  * blocks allocated on disk to back that page.
  */
 
-static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int gfs2_page_mkwrite(struct vm_fault *vmf)
 {
        struct page *page = vmf->page;
-       struct inode *inode = file_inode(vma->vm_file);
+       struct inode *inode = file_inode(vmf->vma->vm_file);
        struct gfs2_inode *ip = GFS2_I(inode);
        struct gfs2_sbd *sdp = GFS2_SB(inode);
        struct gfs2_alloc_parms ap = { .aflags = 0, };
@@ -399,7 +399,7 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
        if (ret)
                goto out;
 
-       gfs2_size_hint(vma->vm_file, pos, PAGE_SIZE);
+       gfs2_size_hint(vmf->vma->vm_file, pos, PAGE_SIZE);
 
        gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
        ret = gfs2_glock_nq(&gh);
@@ -407,7 +407,7 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
                goto out_uninit;
 
        /* Update file times before taking page lock */
-       file_update_time(vma->vm_file);
+       file_update_time(vmf->vma->vm_file);
 
        set_bit(GLF_DIRTY, &ip->i_gl->gl_flags);
        set_bit(GIF_SW_PAGED, &ip->i_flags);
index d89f70bbb952f0d9b72a54f02a5d76c76f0a8888..d209f42cdcb836cf071164a2e702726d82513d8a 100644 (file)
@@ -445,11 +445,10 @@ iomap_page_mkwrite_actor(struct inode *inode, loff_t pos, loff_t length,
        return length;
 }
 
-int iomap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
-               const struct iomap_ops *ops)
+int iomap_page_mkwrite(struct vm_fault *vmf, const struct iomap_ops *ops)
 {
        struct page *page = vmf->page;
-       struct inode *inode = file_inode(vma->vm_file);
+       struct inode *inode = file_inode(vmf->vma->vm_file);
        unsigned long length;
        loff_t offset, size;
        ssize_t ret;
index 78219d5644e90aacaf3aeb9fdfe2a234f4e31b84..4f0535890b30c7c8844b7998852449898db3463e 100644 (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);
 
index 39f57bef85318e343857e23452f60c478b804005..0c3905e0542e8902f5d988a0fe89491a378cbe51 100644 (file)
  * XXX: how are we excluding truncate/invalidate here? Maybe need to lock
  * page?
  */
-static int ncp_file_mmap_fault(struct vm_area_struct *area,
-                                       struct vm_fault *vmf)
+static int ncp_file_mmap_fault(struct vm_fault *vmf)
 {
-       struct inode *inode = file_inode(area->vm_file);
+       struct inode *inode = file_inode(vmf->vma->vm_file);
        char *pg_addr;
        unsigned int already_read;
        unsigned int count;
@@ -90,7 +89,7 @@ static int ncp_file_mmap_fault(struct vm_area_struct *area,
         * -- nyc
         */
        count_vm_event(PGMAJFAULT);
-       mem_cgroup_count_vm_event(area->vm_mm, PGMAJFAULT);
+       mem_cgroup_count_vm_event(vmf->vma->vm_mm, PGMAJFAULT);
        return VM_FAULT_MAJOR;
 }
 
index 26dbe8b0c10dbf00c0aca1f800c1f99eb87c5cc7..668213984d68708c3d54cccce36ad3a0c048657e 100644 (file)
@@ -528,10 +528,10 @@ const struct address_space_operations nfs_file_aops = {
  * writable, implying that someone is about to modify the page through a
  * shared-writable mapping
  */
-static int nfs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int nfs_vm_page_mkwrite(struct vm_fault *vmf)
 {
        struct page *page = vmf->page;
-       struct file *filp = vma->vm_file;
+       struct file *filp = vmf->vma->vm_file;
        struct inode *inode = file_inode(filp);
        unsigned pagelen;
        int ret = VM_FAULT_NOPAGE;
index 547381f3ce137f1371805fea00a94206bb8e1b56..c5fa3dee72fc0b962dec9d3134d8c0d723422134 100644 (file)
@@ -51,8 +51,9 @@ int nilfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
        return err;
 }
 
-static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int nilfs_page_mkwrite(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct page *page = vmf->page;
        struct inode *inode = file_inode(vma->vm_file);
        struct nilfs_transaction_info ti;
index 429088786e93d95c6e107783ea4d09cbefaab290..098f5c71256966f492bb7d1e17b908776b48f7df 100644 (file)
 #include "ocfs2_trace.h"
 
 
-static int ocfs2_fault(struct vm_area_struct *area, struct vm_fault *vmf)
+static int ocfs2_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        sigset_t oldset;
        int ret;
 
        ocfs2_block_signals(&oldset);
-       ret = filemap_fault(area, vmf);
+       ret = filemap_fault(vmf);
        ocfs2_unblock_signals(&oldset);
 
-       trace_ocfs2_fault(OCFS2_I(area->vm_file->f_mapping->host)->ip_blkno,
-                         area, vmf->page, vmf->pgoff);
+       trace_ocfs2_fault(OCFS2_I(vma->vm_file->f_mapping->host)->ip_blkno,
+                         vma, vmf->page, vmf->pgoff);
        return ret;
 }
 
@@ -127,10 +128,10 @@ out:
        return ret;
 }
 
-static int ocfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int ocfs2_page_mkwrite(struct vm_fault *vmf)
 {
        struct page *page = vmf->page;
-       struct inode *inode = file_inode(vma->vm_file);
+       struct inode *inode = file_inode(vmf->vma->vm_file);
        struct buffer_head *di_bh = NULL;
        sigset_t oldset;
        int ret;
@@ -160,7 +161,7 @@ static int ocfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
         */
        down_write(&OCFS2_I(inode)->ip_alloc_sem);
 
-       ret = __ocfs2_page_mkwrite(vma->vm_file, di_bh, page);
+       ret = __ocfs2_page_mkwrite(vmf->vma->vm_file, di_bh, page);
 
        up_write(&OCFS2_I(inode)->ip_alloc_sem);
 
index 5105b1599981e176908eb3ebc79d2352f43b9c96..f52d8e857ff78a7780fdaacfb695efc8e0d4c37b 100644 (file)
@@ -265,10 +265,10 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer,
  * On s390 the fault handler is used for memory regions that can't be mapped
  * directly with remap_pfn_range().
  */
-static int mmap_vmcore_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int mmap_vmcore_fault(struct vm_fault *vmf)
 {
 #ifdef CONFIG_S390
-       struct address_space *mapping = vma->vm_file->f_mapping;
+       struct address_space *mapping = vmf->vma->vm_file->f_mapping;
        pgoff_t index = vmf->pgoff;
        struct page *page;
        loff_t offset;
index b0d783774c963c97f32df7649feeb8fb7e4e3e4f..d9ae86f96df7b52255c259489b5343a7cd94faf8 100644 (file)
@@ -1506,11 +1506,10 @@ 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.
  * UBIFS must ensure page is budgeted for.
  */
-static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma,
-                                struct vm_fault *vmf)
+static int ubifs_vm_page_mkwrite(struct vm_fault *vmf)
 {
        struct page *page = vmf->page;
-       struct inode *inode = file_inode(vma->vm_file);
+       struct inode *inode = file_inode(vmf->vma->vm_file);
        struct ubifs_info *c = inode->i_sb->s_fs_info;
        struct timespec now = ubifs_current_time(inode);
        struct ubifs_budget_req req = { .new_page = 1 };
index 022014016d806aabd95e81a4652a38576779dc3f..9cc10136ba0b9838258ecf71a065262954dcd3e8 100644 (file)
@@ -1379,22 +1379,21 @@ xfs_file_llseek(
  */
 STATIC int
 xfs_filemap_page_mkwrite(
-       struct vm_area_struct   *vma,
        struct vm_fault         *vmf)
 {
-       struct inode            *inode = file_inode(vma->vm_file);
+       struct inode            *inode = file_inode(vmf->vma->vm_file);
        int                     ret;
 
        trace_xfs_filemap_page_mkwrite(XFS_I(inode));
 
        sb_start_pagefault(inode->i_sb);
-       file_update_time(vma->vm_file);
+       file_update_time(vmf->vma->vm_file);
        xfs_ilock(XFS_I(inode), XFS_MMAPLOCK_SHARED);
 
        if (IS_DAX(inode)) {
-               ret = dax_iomap_fault(vma, vmf, &xfs_iomap_ops);
+               ret = dax_iomap_fault(vmf, &xfs_iomap_ops);
        } else {
-               ret = iomap_page_mkwrite(vma, vmf, &xfs_iomap_ops);
+               ret = iomap_page_mkwrite(vmf, &xfs_iomap_ops);
                ret = block_page_mkwrite_return(ret);
        }
 
@@ -1406,23 +1405,22 @@ xfs_filemap_page_mkwrite(
 
 STATIC int
 xfs_filemap_fault(
-       struct vm_area_struct   *vma,
        struct vm_fault         *vmf)
 {
-       struct inode            *inode = file_inode(vma->vm_file);
+       struct inode            *inode = file_inode(vmf->vma->vm_file);
        int                     ret;
 
        trace_xfs_filemap_fault(XFS_I(inode));
 
        /* DAX can shortcut the normal fault path on write faults! */
        if ((vmf->flags & FAULT_FLAG_WRITE) && IS_DAX(inode))
-               return xfs_filemap_page_mkwrite(vma, vmf);
+               return xfs_filemap_page_mkwrite(vmf);
 
        xfs_ilock(XFS_I(inode), XFS_MMAPLOCK_SHARED);
        if (IS_DAX(inode))
-               ret = dax_iomap_fault(vma, vmf, &xfs_iomap_ops);
+               ret = dax_iomap_fault(vmf, &xfs_iomap_ops);
        else
-               ret = filemap_fault(vma, vmf);
+               ret = filemap_fault(vmf);
        xfs_iunlock(XFS_I(inode), XFS_MMAPLOCK_SHARED);
 
        return ret;
@@ -1471,11 +1469,10 @@ xfs_filemap_pmd_fault(
  */
 static int
 xfs_filemap_pfn_mkwrite(
-       struct vm_area_struct   *vma,
        struct vm_fault         *vmf)
 {
 
-       struct inode            *inode = file_inode(vma->vm_file);
+       struct inode            *inode = file_inode(vmf->vma->vm_file);
        struct xfs_inode        *ip = XFS_I(inode);
        int                     ret = VM_FAULT_NOPAGE;
        loff_t                  size;
@@ -1483,7 +1480,7 @@ xfs_filemap_pfn_mkwrite(
        trace_xfs_filemap_pfn_mkwrite(ip);
 
        sb_start_pagefault(inode->i_sb);
-       file_update_time(vma->vm_file);
+       file_update_time(vmf->vma->vm_file);
 
        /* check if the faulting page hasn't raced with truncate */
        xfs_ilock(ip, XFS_MMAPLOCK_SHARED);
@@ -1491,7 +1488,7 @@ xfs_filemap_pfn_mkwrite(
        if (vmf->pgoff >= size)
                ret = VM_FAULT_SIGBUS;
        else if (IS_DAX(inode))
-               ret = dax_pfn_mkwrite(vma, vmf);
+               ret = dax_pfn_mkwrite(vmf);
        xfs_iunlock(ip, XFS_MMAPLOCK_SHARED);
        sb_end_pagefault(inode->i_sb);
        return ret;
index 1e77ff5818f14e72f66e90d06275eb8994cfc3eb..eeb02421c848ccb21ef81914a425da4427b53adf 100644 (file)
@@ -38,8 +38,7 @@ static inline void *dax_radix_locked_entry(sector_t sector, unsigned long flags)
 
 ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
                const struct iomap_ops *ops);
-int dax_iomap_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
-                       const struct iomap_ops *ops);
+int dax_iomap_fault(struct vm_fault *vmf, const struct iomap_ops *ops);
 int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index);
 int dax_invalidate_mapping_entry(struct address_space *mapping, pgoff_t index);
 int dax_invalidate_mapping_entry_sync(struct address_space *mapping,
@@ -83,7 +82,7 @@ static inline int dax_iomap_pmd_fault(struct vm_fault *vmf,
        return VM_FAULT_FALLBACK;
 }
 #endif
-int dax_pfn_mkwrite(struct vm_area_struct *, struct vm_fault *);
+int dax_pfn_mkwrite(struct vm_fault *vmf);
 
 static inline bool vma_is_dax(struct vm_area_struct *vma)
 {
index 891459caa278001d8412d1e2fa729bbbbbe7bfcf..7291810067eb636dfa622b8b385ac45d7a520395 100644 (file)
@@ -79,8 +79,7 @@ int iomap_zero_range(struct inode *inode, loff_t pos, loff_t len,
                bool *did_zero, const struct iomap_ops *ops);
 int iomap_truncate_page(struct inode *inode, loff_t pos, bool *did_zero,
                const struct iomap_ops *ops);
-int iomap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
-               const struct iomap_ops *ops);
+int iomap_page_mkwrite(struct vm_fault *vmf, const struct iomap_ops *ops);
 int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
                loff_t start, loff_t len, const struct iomap_ops *ops);
 
index 574bc157a27c3e358aae6fa6f5690a15c2a82635..3dd80ba6568a0a9235beba71468aa3b814a1d608 100644 (file)
@@ -350,17 +350,17 @@ struct vm_operations_struct {
        void (*open)(struct vm_area_struct * area);
        void (*close)(struct vm_area_struct * area);
        int (*mremap)(struct vm_area_struct * area);
-       int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf);
+       int (*fault)(struct vm_fault *vmf);
        int (*pmd_fault)(struct vm_fault *vmf);
        void (*map_pages)(struct vm_fault *vmf,
                        pgoff_t start_pgoff, pgoff_t end_pgoff);
 
        /* notification that a previously read-only page is about to become
         * writable, if an error is returned it will cause a SIGBUS */
-       int (*page_mkwrite)(struct vm_area_struct *vma, struct vm_fault *vmf);
+       int (*page_mkwrite)(struct vm_fault *vmf);
 
        /* same as page_mkwrite when using VM_PFNMAP|VM_MIXEDMAP */
-       int (*pfn_mkwrite)(struct vm_area_struct *vma, struct vm_fault *vmf);
+       int (*pfn_mkwrite)(struct vm_fault *vmf);
 
        /* called by access_process_vm when get_user_pages() fails, typically
         * for use by special VMAs that can switch between memory and hardware
@@ -2124,10 +2124,10 @@ extern void truncate_inode_pages_range(struct address_space *,
 extern void truncate_inode_pages_final(struct address_space *);
 
 /* generic vm_area_ops exported for stackable file systems */
-extern int filemap_fault(struct vm_area_struct *, struct vm_fault *);
+extern int filemap_fault(struct vm_fault *vmf);
 extern void filemap_map_pages(struct vm_fault *vmf,
                pgoff_t start_pgoff, pgoff_t end_pgoff);
-extern int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);
+extern int filemap_page_mkwrite(struct vm_fault *vmf);
 
 /* mm/page-writeback.c */
 int write_one_page(struct page *page, int wait);
index 81203e8ba013597895444a02cdd90c5798f70c34..7f6537b84ef5ee5b518ca8cf5c0328c224e320f4 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -374,12 +374,12 @@ void exit_shm(struct task_struct *task)
        up_write(&shm_ids(ns).rwsem);
 }
 
-static int shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int shm_fault(struct vm_fault *vmf)
 {
-       struct file *file = vma->vm_file;
+       struct file *file = vmf->vma->vm_file;
        struct shm_file_data *sfd = shm_file_data(file);
 
-       return sfd->vm_ops->fault(vma, vmf);
+       return sfd->vm_ops->fault(vmf);
 }
 
 #ifdef CONFIG_NUMA
index 77a932b54a64fbeb2640b35c1cc4c096994bf1d7..b2eb3542e829a10f911dfef8782500eb03f1c618 100644 (file)
@@ -4925,9 +4925,9 @@ unlock:
        rcu_read_unlock();
 }
 
-static int perf_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int perf_mmap_fault(struct vm_fault *vmf)
 {
-       struct perf_event *event = vma->vm_file->private_data;
+       struct perf_event *event = vmf->vma->vm_file->private_data;
        struct ring_buffer *rb;
        int ret = VM_FAULT_SIGBUS;
 
@@ -4950,7 +4950,7 @@ static int perf_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
                goto unlock;
 
        get_page(vmf->page);
-       vmf->page->mapping = vma->vm_file->f_mapping;
+       vmf->page->mapping = vmf->vma->vm_file->f_mapping;
        vmf->page->index   = vmf->pgoff;
 
        ret = 0;
index 8f18d314a96a49a1e9fc6c4cf1c5bead5c96a787..8f8dc91db6802a46496bea63eb6c5fe130f10aeb 100644 (file)
@@ -39,10 +39,10 @@ static void relay_file_mmap_close(struct vm_area_struct *vma)
 /*
  * fault() vm_op implementation for relay file mapping.
  */
-static int relay_buf_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int relay_buf_fault(struct vm_fault *vmf)
 {
        struct page *page;
-       struct rchan_buf *buf = vma->vm_private_data;
+       struct rchan_buf *buf = vmf->vma->vm_private_data;
        pgoff_t pgoff = vmf->pgoff;
 
        if (!buf)
index 416d563468a3abfa6649fe48717d073dede899ac..2ba46f410c7c937ba6ad55e6803ab3680a7a659c 100644 (file)
@@ -2169,7 +2169,6 @@ static void do_async_mmap_readahead(struct vm_area_struct *vma,
 
 /**
  * filemap_fault - read in file data for page fault handling
- * @vma:       vma in which the fault was taken
  * @vmf:       struct vm_fault containing details of the fault
  *
  * filemap_fault() is invoked via the vma operations vector for a
@@ -2191,10 +2190,10 @@ static void do_async_mmap_readahead(struct vm_area_struct *vma,
  *
  * We never return with VM_FAULT_RETRY and a bit from VM_FAULT_ERROR set.
  */
-int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+int filemap_fault(struct vm_fault *vmf)
 {
        int error;
-       struct file *file = vma->vm_file;
+       struct file *file = vmf->vma->vm_file;
        struct address_space *mapping = file->f_mapping;
        struct file_ra_state *ra = &file->f_ra;
        struct inode *inode = mapping->host;
@@ -2216,12 +2215,12 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
                 * We found the page, so try async readahead before
                 * waiting for the lock.
                 */
-               do_async_mmap_readahead(vma, ra, file, page, offset);
+               do_async_mmap_readahead(vmf->vma, ra, file, page, offset);
        } else if (!page) {
                /* No page in the page cache at all */
-               do_sync_mmap_readahead(vma, ra, file, offset);
+               do_sync_mmap_readahead(vmf->vma, ra, file, offset);
                count_vm_event(PGMAJFAULT);
-               mem_cgroup_count_vm_event(vma->vm_mm, PGMAJFAULT);
+               mem_cgroup_count_vm_event(vmf->vma->vm_mm, PGMAJFAULT);
                ret = VM_FAULT_MAJOR;
 retry_find:
                page = find_get_page(mapping, offset);
@@ -2229,7 +2228,7 @@ retry_find:
                        goto no_cached_page;
        }
 
-       if (!lock_page_or_retry(page, vma->vm_mm, vmf->flags)) {
+       if (!lock_page_or_retry(page, vmf->vma->vm_mm, vmf->flags)) {
                put_page(page);
                return ret | VM_FAULT_RETRY;
        }
@@ -2396,14 +2395,14 @@ next:
 }
 EXPORT_SYMBOL(filemap_map_pages);
 
-int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
+int filemap_page_mkwrite(struct vm_fault *vmf)
 {
        struct page *page = vmf->page;
-       struct inode *inode = file_inode(vma->vm_file);
+       struct inode *inode = file_inode(vmf->vma->vm_file);
        int ret = VM_FAULT_LOCKED;
 
        sb_start_pagefault(inode->i_sb);
-       file_update_time(vma->vm_file);
+       file_update_time(vmf->vma->vm_file);
        lock_page(page);
        if (page->mapping != inode->i_mapping) {
                unlock_page(page);
index 30e7709a5121981c6792dfe2294e8137adc1ece5..167fd0722c15eaccbac571911bb2b3ecbdb62668 100644 (file)
@@ -3142,7 +3142,7 @@ static void hugetlb_vm_op_close(struct vm_area_struct *vma)
  * hugegpage VMA.  do_page_fault() is supposed to trap this, so BUG is we get
  * this far.
  */
-static int hugetlb_vm_op_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int hugetlb_vm_op_fault(struct vm_fault *vmf)
 {
        BUG();
        return 0;
index 7663068a33c6674a4e9ea1de34f02dc936316c24..cf97d88158cd38607ff7917d05a91e9524207358 100644 (file)
@@ -2035,7 +2035,7 @@ static int do_page_mkwrite(struct vm_fault *vmf)
 
        vmf->flags = FAULT_FLAG_WRITE|FAULT_FLAG_MKWRITE;
 
-       ret = vmf->vma->vm_ops->page_mkwrite(vmf->vma, vmf);
+       ret = vmf->vma->vm_ops->page_mkwrite(vmf);
        /* Restore original flags so that caller is not surprised */
        vmf->flags = old_flags;
        if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE)))
@@ -2307,7 +2307,7 @@ static int wp_pfn_shared(struct vm_fault *vmf)
 
                pte_unmap_unlock(vmf->pte, vmf->ptl);
                vmf->flags |= FAULT_FLAG_MKWRITE;
-               ret = vma->vm_ops->pfn_mkwrite(vma, vmf);
+               ret = vma->vm_ops->pfn_mkwrite(vmf);
                if (ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE))
                        return ret;
                return finish_mkwrite_fault(vmf);
@@ -2861,7 +2861,7 @@ static int __do_fault(struct vm_fault *vmf)
        struct vm_area_struct *vma = vmf->vma;
        int ret;
 
-       ret = vma->vm_ops->fault(vma, vmf);
+       ret = vma->vm_ops->fault(vmf);
        if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY |
                            VM_FAULT_DONE_COW)))
                return ret;
index b729084eea901d3917fcbd2ae474eb8f5d7c57ba..1cd70010edf0c53581918a10ec0633fd2b72f5f7 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -3125,8 +3125,7 @@ void vm_stat_account(struct mm_struct *mm, vm_flags_t flags, long npages)
                mm->data_vm += npages;
 }
 
-static int special_mapping_fault(struct vm_area_struct *vma,
-                                struct vm_fault *vmf);
+static int special_mapping_fault(struct vm_fault *vmf);
 
 /*
  * Having a close hook prevents vma merging regardless of flags.
@@ -3161,9 +3160,9 @@ static const struct vm_operations_struct legacy_special_mapping_vmops = {
        .fault = special_mapping_fault,
 };
 
-static int special_mapping_fault(struct vm_area_struct *vma,
-                               struct vm_fault *vmf)
+static int special_mapping_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        pgoff_t pgoff;
        struct page **pages;
 
@@ -3173,7 +3172,7 @@ static int special_mapping_fault(struct vm_area_struct *vma,
                struct vm_special_mapping *sm = vma->vm_private_data;
 
                if (sm->fault)
-                       return sm->fault(sm, vma, vmf);
+                       return sm->fault(sm, vmf->vma, vmf);
 
                pages = sm->pages;
        }
index bc964c26be8c1a47f70ed3c639a5bb58e698d8e1..62600ba0d1d8821efe258194b221832e851fc865 100644 (file)
@@ -1794,7 +1794,7 @@ void unmap_mapping_range(struct address_space *mapping,
 }
 EXPORT_SYMBOL(unmap_mapping_range);
 
-int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+int filemap_fault(struct vm_fault *vmf)
 {
        BUG();
        return 0;
index 9c6d22ff44e26280505729463acaa96e8bf88d6a..f7f2330c6cb6f90e3de91e7265725bac04292c7c 100644 (file)
@@ -1908,8 +1908,9 @@ static int synchronous_wake_function(wait_queue_t *wait, unsigned mode, int sync
        return ret;
 }
 
-static int shmem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int shmem_fault(struct vm_fault *vmf)
 {
+       struct vm_area_struct *vma = vmf->vma;
        struct inode *inode = file_inode(vma->vm_file);
        gfp_t gfp = mapping_gfp_mask(inode->i_mapping);
        enum sgp_type sgp;
index c354807381c11949604a458b5286989385395a7b..c9e8a9898ce48111af344584534c19f9cdc483a9 100644 (file)
@@ -424,10 +424,9 @@ out:
        return ret;
 }
 
-static int sel_mmap_policy_fault(struct vm_area_struct *vma,
-                                struct vm_fault *vmf)
+static int sel_mmap_policy_fault(struct vm_fault *vmf)
 {
-       struct policy_load_memory *plm = vma->vm_file->private_data;
+       struct policy_load_memory *plm = vmf->vma->vm_file->private_data;
        unsigned long offset;
        struct page *page;
 
index 9d33c1e85c79b1f6b66f74e6117a198e60244b28..aec9c92250fd72b46ac14c65a6efef1bacc7589c 100644 (file)
@@ -3245,10 +3245,9 @@ static unsigned int snd_pcm_capture_poll(struct file *file, poll_table * wait)
 /*
  * mmap status record
  */
-static int snd_pcm_mmap_status_fault(struct vm_area_struct *area,
-                                               struct vm_fault *vmf)
+static int snd_pcm_mmap_status_fault(struct vm_fault *vmf)
 {
-       struct snd_pcm_substream *substream = area->vm_private_data;
+       struct snd_pcm_substream *substream = vmf->vma->vm_private_data;
        struct snd_pcm_runtime *runtime;
        
        if (substream == NULL)
@@ -3282,10 +3281,9 @@ static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file
 /*
  * mmap control record
  */
-static int snd_pcm_mmap_control_fault(struct vm_area_struct *area,
-                                               struct vm_fault *vmf)
+static int snd_pcm_mmap_control_fault(struct vm_fault *vmf)
 {
-       struct snd_pcm_substream *substream = area->vm_private_data;
+       struct snd_pcm_substream *substream = vmf->vma->vm_private_data;
        struct snd_pcm_runtime *runtime;
        
        if (substream == NULL)
@@ -3341,10 +3339,9 @@ snd_pcm_default_page_ops(struct snd_pcm_substream *substream, unsigned long ofs)
 /*
  * fault callback for mmapping a RAM page
  */
-static int snd_pcm_mmap_data_fault(struct vm_area_struct *area,
-                                               struct vm_fault *vmf)
+static int snd_pcm_mmap_data_fault(struct vm_fault *vmf)
 {
-       struct snd_pcm_substream *substream = area->vm_private_data;
+       struct snd_pcm_substream *substream = vmf->vma->vm_private_data;
        struct snd_pcm_runtime *runtime;
        unsigned long offset;
        struct page * page;
index cf5dc33f4a6d6d582bea62d239f23b4e08bf750a..cf45bf1f7ee0b0a441f5a9258deaf203983f0f84 100644 (file)
@@ -137,13 +137,12 @@ static void usb_stream_hwdep_vm_open(struct vm_area_struct *area)
        snd_printdd(KERN_DEBUG "%i\n", atomic_read(&us122l->mmap_count));
 }
 
-static int usb_stream_hwdep_vm_fault(struct vm_area_struct *area,
-                                    struct vm_fault *vmf)
+static int usb_stream_hwdep_vm_fault(struct vm_fault *vmf)
 {
        unsigned long offset;
        struct page *page;
        void *vaddr;
-       struct us122l *us122l = area->vm_private_data;
+       struct us122l *us122l = vmf->vma->vm_private_data;
        struct usb_stream *s;
 
        mutex_lock(&us122l->mutex);
index 0b34dbc8f3020436d3e740bb61dea9f648a745ab..605e1047c01dfbc2dd025b9033f133aaef5fc5f4 100644 (file)
 #include "usbusx2y.h"
 #include "usX2Yhwdep.h"
 
-static int snd_us428ctls_vm_fault(struct vm_area_struct *area,
-                                 struct vm_fault *vmf)
+static int snd_us428ctls_vm_fault(struct vm_fault *vmf)
 {
        unsigned long offset;
        struct page * page;
        void *vaddr;
 
        snd_printdd("ENTER, start %lXh, pgoff %ld\n",
-                  area->vm_start,
+                  vmf->vma->vm_start,
                   vmf->pgoff);
        
        offset = vmf->pgoff << PAGE_SHIFT;
-       vaddr = (char*)((struct usX2Ydev *)area->vm_private_data)->us428ctls_sharedmem + offset;
+       vaddr = (char *)((struct usX2Ydev *)vmf->vma->vm_private_data)->us428ctls_sharedmem + offset;
        page = virt_to_page(vaddr);
        get_page(page);
        vmf->page = page;
index 90766a92e7fdf471e7f109def88bd21ebb50048f..f95164b91152da9e137594698bb90ca657b0c08f 100644 (file)
@@ -652,14 +652,13 @@ static void snd_usX2Y_hwdep_pcm_vm_close(struct vm_area_struct *area)
 }
 
 
-static int snd_usX2Y_hwdep_pcm_vm_fault(struct vm_area_struct *area,
-                                       struct vm_fault *vmf)
+static int snd_usX2Y_hwdep_pcm_vm_fault(struct vm_fault *vmf)
 {
        unsigned long offset;
        void *vaddr;
 
        offset = vmf->pgoff << PAGE_SHIFT;
-       vaddr = (char*)((struct usX2Ydev *)area->vm_private_data)->hwdep_pcm_shm + offset;
+       vaddr = (char *)((struct usX2Ydev *)vmf->vma->vm_private_data)->hwdep_pcm_shm + offset;
        vmf->page = virt_to_page(vaddr);
        get_page(vmf->page);
        return 0;
index cc4d6e0dd2a2333b260947f54dfadec3f23edcf8..5b0dd4a9b2cbcf413fb6ef5acd6bf8168cd2a944 100644 (file)
@@ -2350,9 +2350,9 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me)
 }
 EXPORT_SYMBOL_GPL(kvm_vcpu_on_spin);
 
-static int kvm_vcpu_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int kvm_vcpu_fault(struct vm_fault *vmf)
 {
-       struct kvm_vcpu *vcpu = vma->vm_file->private_data;
+       struct kvm_vcpu *vcpu = vmf->vma->vm_file->private_data;
        struct page *page;
 
        if (vmf->pgoff == 0)