]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
nsfs: add current_in_namespace()
authorChristian Brauner <brauner@kernel.org>
Fri, 12 Sep 2025 11:52:50 +0000 (13:52 +0200)
committerChristian Brauner <brauner@kernel.org>
Fri, 19 Sep 2025 12:26:16 +0000 (14:26 +0200)
commitd2afdb73f8ad77b49eca9d110d0c54bf30d1df0f
tree7de58ed5f11053677f992c8734dadd1cc935d1a9
parentd7afdf889561058068ab46fd8f306c70ef29216a
nsfs: add current_in_namespace()

Add a helper to easily check whether a given namespace is the caller's
current namespace. This is currently open-coded in a lot of places.
Simply switch on the type and compare the results.

Reviewed-by: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/nsfs.h