fs: add is_idmapped_mnt() helper
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 28 Jun 2022 12:16:09 +0000 (14:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 Jul 2022 14:41:14 +0000 (16:41 +0200)
commitb3679e8b59966cf106d1f24f4467f8d346a4480b
treec9c9b517891196d051497aaf8a1c4b974ae7a379
parentab0b6dc5e16ba6a876d141082912e8ed05e2a491
fs: add is_idmapped_mnt() helper

commit bb49e9e730c2906a958eee273a7819f401543d6c upstream.

Multiple places open-code the same check to determine whether a given
mount is idmapped. Introduce a simple helper function that can be used
instead. This allows us to get rid of the fragile open-coding. We will
later change the check that is used to determine whether a given mount
is idmapped. Introducing a helper allows us to do this in a single
place instead of doing it for multiple places.

Link: https://lore.kernel.org/r/20211123114227.3124056-2-brauner@kernel.org
Link: https://lore.kernel.org/r/20211130121032.3753852-2-brauner@kernel.org
Link: https://lore.kernel.org/r/20211203111707.3901969-2-brauner@kernel.org
Cc: Seth Forshee <sforshee@digitalocean.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
CC: linux-fsdevel@vger.kernel.org
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Seth Forshee <sforshee@digitalocean.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cachefiles/bind.c
fs/ecryptfs/main.c
fs/namespace.c
fs/nfsd/export.c
fs/overlayfs/super.c
fs/proc_namespace.c
include/linux/fs.h