]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sysfs: remove trivial sysfs_get_tree() wrapper
authorChristian Brauner <brauner@kernel.org>
Mon, 27 Apr 2026 08:26:04 +0000 (10:26 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 11 May 2026 21:13:01 +0000 (23:13 +0200)
Now that FS_USERNS_MOUNT_RESTRICTED is a file_system_type flag,
sysfs_get_tree() is a trivial wrapper around kernfs_get_tree() with no
additional logic. Point sysfs_fs_context_ops.get_tree directly at
kernfs_get_tree() and remove the wrapper.

Link: https://patch.msgid.link/e8ac71fc96ad864c8b58fc0a8e5305550c01db25.1777278334.git.legion@kernel.org
Reviewed-by: Aleksa Sarai <aleksa@amutable.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/sysfs/mount.c

index b45ea5d511e77f5e556da76ee7b6a42df7fc56ba..88c10823fcafaacda5966e7636629a0e2d04a82d 100644 (file)
 static struct kernfs_root *sysfs_root;
 struct kernfs_node *sysfs_root_kn;
 
-static int sysfs_get_tree(struct fs_context *fc)
-{
-       struct kernfs_fs_context *kfc = fc->fs_private;
-       int ret;
-
-       ret = kernfs_get_tree(fc);
-       if (ret)
-               return ret;
-
-       return 0;
-}
-
 static void sysfs_fs_context_free(struct fs_context *fc)
 {
        struct kernfs_fs_context *kfc = fc->fs_private;
@@ -47,7 +35,7 @@ static void sysfs_fs_context_free(struct fs_context *fc)
 
 static const struct fs_context_operations sysfs_fs_context_ops = {
        .free           = sysfs_fs_context_free,
-       .get_tree       = sysfs_get_tree,
+       .get_tree       = kernfs_get_tree,
 };
 
 static int sysfs_init_fs_context(struct fs_context *fc)