From 56c94c626785001dbb683312725b7d87c6ec6a91 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 25 Oct 2023 16:02:01 +0200 Subject: namespace: extract show_path() helper To be used by the statmount(2) syscall as well. Signed-off-by: Miklos Szeredi Link: https://lore.kernel.org/r/20231025140205.3586473-4-mszeredi@redhat.com Reviewed-by: Ian Kent Signed-off-by: Christian Brauner --- fs/namespace.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'fs/namespace.c') diff --git a/fs/namespace.c b/fs/namespace.c index bbe94096e262..d3665d025acb 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -4674,6 +4674,15 @@ SYSCALL_DEFINE5(mount_setattr, int, dfd, const char __user *, path, return err; } +int show_path(struct seq_file *m, struct dentry *root) +{ + if (root->d_sb->s_op->show_path) + return root->d_sb->s_op->show_path(m, root); + + seq_dentry(m, root, " \t\n\\"); + return 0; +} + static void __init init_mount_tree(void) { struct vfsmount *mnt; -- cgit