Re: [PATCH 2/6] mm: introduce vma_set_file function v3

2020-10-12 Thread Christian König
Am 09.10.20 um 17:14 schrieb Jason Gunthorpe: On Fri, Oct 09, 2020 at 05:03:38PM +0200, Christian König wrote: +/* + * Change backing file, only valid to use during initial VMA setup. + */ +void vma_set_file(struct vm_area_struct *vma, struct file *file) +{ + if (file) +

Re: [PATCH 2/6] mm: introduce vma_set_file function v3

2020-10-10 Thread Jason Gunthorpe
On Fri, Oct 09, 2020 at 05:03:38PM +0200, Christian König wrote: > +/* > + * Change backing file, only valid to use during initial VMA setup. > + */ > +void vma_set_file(struct vm_area_struct *vma, struct file *file) > +{ > + if (file) > + get_file(file); > + > +

[PATCH 2/6] mm: introduce vma_set_file function v3

2020-10-09 Thread Christian König
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. Signed-off-by: Christian König Reviewed-by: