fs: add two type safe mapping helpers
authorChristian Brauner <brauner@kernel.org>
Tue, 21 Jun 2022 14:14:48 +0000 (16:14 +0200)
committerChristian Brauner (Microsoft) <brauner@kernel.org>
Sun, 26 Jun 2022 16:18:54 +0000 (18:18 +0200)
commit234a3113f28d02973ecf501f83d796ea89db295f
tree63ff7384146f30d8366a8936f2dd516d5f5c974f
parent1e5267cd0895183e09c5bb76da85c674014285d0
fs: add two type safe mapping helpers

Introduce i_{g,u}id_into_vfs{g,u}id(). They return vfs{g,u}id_t. This
makes it way harder to confused idmapped mount {g,u}ids with filesystem
{g,u}ids.

The two helpers will eventually replace the old non type safe
i_{g,u}id_into_mnt() helpers once we finished converting all places. Add
a comment noting that they will be removed in the future.

All new helpers are nops on non-idmapped mounts.

Link: https://lore.kernel.org/r/20220621141454.2914719-3-brauner@kernel.org
Cc: Seth Forshee <sforshee@digitalocean.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Aleksa Sarai <cyphar@cyphar.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
CC: linux-fsdevel@vger.kernel.org
Reviewed-by: Seth Forshee <sforshee@digitalocean.com>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
include/linux/fs.h