--- zzzz-none-000/linux-3.10.107/fs/configfs/mount.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/fs/configfs/mount.c 2021-02-04 17:41:59.000000000 +0000 @@ -85,7 +85,7 @@ /* directory inodes start off with i_nlink == 2 (for "." entry) */ inc_nlink(inode); } else { - pr_debug("configfs: could not get root inode\n"); + pr_debug("could not get root inode\n"); return -ENOMEM; } @@ -129,8 +129,6 @@ } -static struct kobject *config_kobj; - static int __init configfs_init(void) { int err = -ENOMEM; @@ -141,24 +139,18 @@ if (!configfs_dir_cachep) goto out; - config_kobj = kobject_create_and_add("config", kernel_kobj); - if (!config_kobj) - goto out2; - - err = configfs_inode_init(); + err = sysfs_create_mount_point(kernel_kobj, "config"); if (err) - goto out3; + goto out2; err = register_filesystem(&configfs_fs_type); if (err) - goto out4; + goto out3; return 0; -out4: - printk(KERN_ERR "configfs: Unable to register filesystem!\n"); - configfs_inode_exit(); out3: - kobject_put(config_kobj); + pr_err("Unable to register filesystem!\n"); + sysfs_remove_mount_point(kernel_kobj, "config"); out2: kmem_cache_destroy(configfs_dir_cachep); configfs_dir_cachep = NULL; @@ -169,10 +161,9 @@ static void __exit configfs_exit(void) { unregister_filesystem(&configfs_fs_type); - kobject_put(config_kobj); + sysfs_remove_mount_point(kernel_kobj, "config"); kmem_cache_destroy(configfs_dir_cachep); configfs_dir_cachep = NULL; - configfs_inode_exit(); } MODULE_AUTHOR("Oracle"); @@ -180,5 +171,5 @@ MODULE_VERSION("0.0.2"); MODULE_DESCRIPTION("Simple RAM filesystem for user driven kernel subsystem configuration."); -module_init(configfs_init); +core_initcall(configfs_init); module_exit(configfs_exit);