mm/mmap: simplify vma link and unlink
authorYajun Deng <yajun.deng@linux.dev>
Wed, 10 Jan 2024 08:46:22 +0000 (16:46 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 Feb 2024 00:00:02 +0000 (16:00 -0800)
commit30afc8c34290184c023fa79136ce5f8813fc73da
tree851d4eb82655ff68eea34e72a0bfa38b354ab686
parent0040f2c5531fe852505b3786992e41a5b40f8db6
mm/mmap: simplify vma link and unlink

The file parameter in the __remove_shared_vm_struct is no longer used,
remove it.

These functions vma_link() and mmap_region() have some of the same code,
introduce vma_link_file() helper function to simplify the code.

Link: https://lkml.kernel.org/r/20240110084622.2425927-1-yajun.deng@linux.dev
Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/mmap.c