mm/nommu: don't use VM_MAYSHARE for MAP_PRIVATE mappings
authorDavid Hildenbrand <david@redhat.com>
Mon, 2 Jan 2023 16:08:55 +0000 (17:08 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 19 Jan 2023 01:12:57 +0000 (17:12 -0800)
commitb6b7a8faf05c709cd9f63d3b7d9c66bd91bc3b0d
treee9314f6d0ce7fd59966ee70989134666ed5b477a
parentfc4f4be9b5271e43eeb4c675d190fa9734de9ea3
mm/nommu: don't use VM_MAYSHARE for MAP_PRIVATE mappings

Let's stop using VM_MAYSHARE for MAP_PRIVATE mappings and use
VM_MAYOVERLAY instead.  Rewrite determine_vm_flags() to make the whole
logic easier to digest, and to cleanly separate MAP_PRIVATE vs.
MAP_SHARED.

No functional change intended.

Link: https://lkml.kernel.org/r/20230102160856.500584-3-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Nicolas Pitre <nico@fluxnic.net>
Cc: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mm.h
mm/nommu.c