mm: introduce vma_set_file function v4
authorChristian König <christian.koenig@amd.com>
Mon, 14 Sep 2020 13:09:33 +0000 (15:09 +0200)
committerChristian König <christian.koenig@amd.com>
Thu, 5 Nov 2020 12:03:52 +0000 (13:03 +0100)
commit2b5b95b1ff3d70a95013a45e3b5b90f1daf42348
tree0d0d804862b63c20500e6e947931d18f440dbb45
parent0227da01f2559626396af5f6c7453360db86c1f6
mm: introduce vma_set_file function v4

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@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v2)
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/394773/
drivers/dma-buf/dma-buf.c
drivers/gpu/drm/etnaviv/etnaviv_gem.c
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
drivers/gpu/drm/i915/gem/i915_gem_mman.c
drivers/gpu/drm/msm/msm_gem.c
drivers/gpu/drm/omapdrm/omap_gem.c
drivers/gpu/drm/vgem/vgem_drv.c
drivers/staging/android/ashmem.c
include/linux/mm.h
mm/mmap.c