aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/filesystems/utils.h
diff options
context:
space:
mode:
authorAmir Goldstein <[email protected]>2025-05-09 13:32:39 +0000
committerChristian Brauner <[email protected]>2025-05-12 09:40:13 +0000
commit8199e6f7402ca2232de6f57b918d2b1fb9c224cb (patch)
tree8805b8274ecfd6379237582d0b18c6f45b67077d /tools/testing/selftests/filesystems/utils.h
parentselftests/filesystems: create get_unique_mnt_id() helper (diff)
downloadkernel-8199e6f7402ca2232de6f57b918d2b1fb9c224cb.tar.gz
kernel-8199e6f7402ca2232de6f57b918d2b1fb9c224cb.zip
selftests/filesystems: create setup_userns() helper
Add helper to utils.c and use it in statmount userns tests. Reviewed-by: John Hubbard <[email protected]> Signed-off-by: Amir Goldstein <[email protected]> Link: https://lore.kernel.org/[email protected] Reviewed-by: Christian Brauner <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'tools/testing/selftests/filesystems/utils.h')
-rw-r--r--tools/testing/selftests/filesystems/utils.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/filesystems/utils.h b/tools/testing/selftests/filesystems/utils.h
index d9cf145b321a..70f7ccc607f4 100644
--- a/tools/testing/selftests/filesystems/utils.h
+++ b/tools/testing/selftests/filesystems/utils.h
@@ -27,6 +27,7 @@ extern int caps_down(void);
extern int cap_down(cap_value_t down);
extern bool switch_ids(uid_t uid, gid_t gid);
+extern int setup_userns(void);
static inline bool switch_userns(int fd, uid_t uid, gid_t gid, bool drop_caps)
{