mm: introduce vma_set_file function v5
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, 19 Nov 2020 09:36:36 +0000 (10:36 +0100)
commit295992fb815e791d14b18ef7cdbbaf1a76211a31
tree2b72922a11a0abd63cb11969d3fd5cd7d2874e1c
parent1527f926fd04490f648c42f42b45218a04754f87
mm: introduce vma_set_file function v5

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.
v5: move vma_set_file to mm/util.c

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>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://patchwork.freedesktop.org/patch/399360/
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/util.c