[PATCH 2/2] mm: introduce vma_set_file function v4

Jason Gunthorpe jgg at ziepe.ca
Fri Oct 16 16:13:21 UTC 2020


On Mon, Oct 12, 2020 at 10:52:03AM +0200, Christian König wrote:
> Add the new vma_set_file() function to allow changing
> vma->vm_file with the necessary refcount dance.
> 
> v2: add more users of this.
> v3: add missing EXPORT_SYMBOL, rebase on mmap cleanup,
>     add comments why we drop the reference on two occasions.
> v4: make it clear that changing an anonymous vma is illegal.
> 
> Signed-off-by: Christian König <christian.koenig at amd.com>
> Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch> (v2)
> ---
>  drivers/dma-buf/dma-buf.c                  |  3 +--
>  drivers/gpu/drm/etnaviv/etnaviv_gem.c      |  4 +---
>  drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c |  3 +--
>  drivers/gpu/drm/i915/gem/i915_gem_mman.c   |  5 +++--
>  drivers/gpu/drm/msm/msm_gem.c              |  4 +---
>  drivers/gpu/drm/omapdrm/omap_gem.c         |  3 +--
>  drivers/gpu/drm/vgem/vgem_drv.c            |  3 +--
>  drivers/staging/android/ashmem.c           |  6 +++---
>  include/linux/mm.h                         |  2 ++
>  mm/mmap.c                                  | 12 ++++++++++++
>  10 files changed, 26 insertions(+), 19 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg at nvidia.com>

Jason


More information about the dri-devel mailing list