fs: introduce fsuidgid_has_mapping() helper
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 20 Mar 2021 12:26:23 +0000 (13:26 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 23 Mar 2021 10:15:24 +0000 (11:15 +0100)
commit8e5389132ab429604c1a2459b52f0c849a71cc61
tree07ed2f940b4e014d3812c7442be01db10fd655c0
parenta65e58e791a1690da8de731c8391816a22f5555c
fs: introduce fsuidgid_has_mapping() helper

Don't open-code the checks and instead move them into a clean little
helper we can call. This also reduces the risk that if we ever change
something we forget to change all locations.

Link: https://lore.kernel.org/r/20210320122623.599086-4-christian.brauner@ubuntu.com
Inspired-by: Vivek Goyal <vgoyal@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
fs/namei.c
include/linux/fs.h