]> git.baikalelectronics.ru Git - kernel.git/commit
fs: add file and path permissions helpers
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 21 Jan 2021 13:19:22 +0000 (14:19 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 24 Jan 2021 13:27:16 +0000 (14:27 +0100)
commitccd302c8f21fade3e92d9e35193623ecb824e6a0
tree355710b868f8a26f8fd5ba413938f92f8a24b68a
parentcd92ac8d13c1e01084bce4b35621061163cc17fa
fs: add file and path permissions helpers

Add two simple helpers to check permissions on a file and path
respectively and convert over some callers. It simplifies quite a few
codepaths and also reduces the churn in later patches quite a bit.
Christoph also correctly points out that this makes codepaths (e.g.
ioctls) way easier to follow that would otherwise have to do more
complex argument passing than necessary.

Link: https://lore.kernel.org/r/20210121131959.646623-4-christian.brauner@ubuntu.com
Cc: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Suggested-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
13 files changed:
fs/init.c
fs/notify/fanotify/fanotify_user.c
fs/notify/inotify/inotify_user.c
fs/open.c
fs/udf/file.c
fs/verity/enable.c
include/linux/fs.h
kernel/bpf/inode.c
kernel/sys.c
mm/madvise.c
mm/memcontrol.c
mm/mincore.c
net/unix/af_unix.c