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>
Showing
- fs/init.c 3 additions, 3 deletionsfs/init.c
- fs/notify/fanotify/fanotify_user.c 1 addition, 1 deletionfs/notify/fanotify/fanotify_user.c
- fs/notify/inotify/inotify_user.c 1 addition, 1 deletionfs/notify/inotify/inotify_user.c
- fs/open.c 3 additions, 3 deletionsfs/open.c
- fs/udf/file.c 1 addition, 1 deletionfs/udf/file.c
- fs/verity/enable.c 1 addition, 1 deletionfs/verity/enable.c
- include/linux/fs.h 8 additions, 0 deletionsinclude/linux/fs.h
- kernel/bpf/inode.c 1 addition, 1 deletionkernel/bpf/inode.c
- kernel/sys.c 1 addition, 1 deletionkernel/sys.c
- mm/madvise.c 1 addition, 1 deletionmm/madvise.c
- mm/memcontrol.c 1 addition, 1 deletionmm/memcontrol.c
- mm/mincore.c 1 addition, 1 deletionmm/mincore.c
- net/unix/af_unix.c 1 addition, 1 deletionnet/unix/af_unix.c
Loading
Please register or sign in to comment