aboutsummaryrefslogtreecommitdiffstats
path: root/fs/configfs
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-05-13 18:35:41 -0400
committerEric W. Biederman <ebiederm@xmission.com>2015-07-01 11:36:47 -0400
commitf9bb48825a6b5d02f4cabcc78967c75db903dcdc (patch)
tree4883ba33a67bb07e6c9611b4b7a818c428c73ec7 /fs/configfs
parent87d2846fcf88113fae2341da1ca9a71f0d916f2c (diff)
sysfs: Create mountpoints with sysfs_create_mount_point
This allows for better documentation in the code and it allows for a simpler and fully correct version of fs_fully_visible to be written. The mount points converted and their filesystems are: /sys/hypervisor/s390/ s390_hypfs /sys/kernel/config/ configfs /sys/kernel/debug/ debugfs /sys/firmware/efi/efivars/ efivarfs /sys/fs/fuse/connections/ fusectl /sys/fs/pstore/ pstore /sys/kernel/tracing/ tracefs /sys/fs/cgroup/ cgroup /sys/kernel/security/ securityfs /sys/fs/selinux/ selinuxfs /sys/fs/smackfs/ smackfs Cc: stable@vger.kernel.org Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/configfs')
-rw-r--r--fs/configfs/mount.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c
index da94e41bdbf6..bca58da65e2b 100644
--- a/fs/configfs/mount.c
+++ b/fs/configfs/mount.c
@@ -129,8 +129,6 @@ void configfs_release_fs(void)
129} 129}
130 130
131 131
132static struct kobject *config_kobj;
133
134static int __init configfs_init(void) 132static int __init configfs_init(void)
135{ 133{
136 int err = -ENOMEM; 134 int err = -ENOMEM;
@@ -141,8 +139,8 @@ static int __init configfs_init(void)
141 if (!configfs_dir_cachep) 139 if (!configfs_dir_cachep)
142 goto out; 140 goto out;
143 141
144 config_kobj = kobject_create_and_add("config", kernel_kobj); 142 err = sysfs_create_mount_point(kernel_kobj, "config");
145 if (!config_kobj) 143 if (err)
146 goto out2; 144 goto out2;
147 145
148 err = register_filesystem(&configfs_fs_type); 146 err = register_filesystem(&configfs_fs_type);
@@ -152,7 +150,7 @@ static int __init configfs_init(void)
152 return 0; 150 return 0;
153out3: 151out3:
154 pr_err("Unable to register filesystem!\n"); 152 pr_err("Unable to register filesystem!\n");
155 kobject_put(config_kobj); 153 sysfs_remove_mount_point(kernel_kobj, "config");
156out2: 154out2:
157 kmem_cache_destroy(configfs_dir_cachep); 155 kmem_cache_destroy(configfs_dir_cachep);
158 configfs_dir_cachep = NULL; 156 configfs_dir_cachep = NULL;
@@ -163,7 +161,7 @@ out:
163static void __exit configfs_exit(void) 161static void __exit configfs_exit(void)
164{ 162{
165 unregister_filesystem(&configfs_fs_type); 163 unregister_filesystem(&configfs_fs_type);
166 kobject_put(config_kobj); 164 sysfs_remove_mount_point(kernel_kobj, "config");
167 kmem_cache_destroy(configfs_dir_cachep); 165 kmem_cache_destroy(configfs_dir_cachep);
168 configfs_dir_cachep = NULL; 166 configfs_dir_cachep = NULL;
169} 167}