summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/md/bcache/bcache.h2
-rw-r--r--drivers/md/bcache/debug.c2
-rw-r--r--drivers/md/bcache/super.c15
3 files changed, 10 insertions, 9 deletions
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index 6502315d38bc..3639964e4aa4 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -737,6 +737,6 @@ do { \
/* Forward declarations */
void bch_debug_exit(void);
-int bch_debug_init(struct kobject *);
+int bch_debug_init(void);
#endif /* _BCACHE_H */
diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
index d67fb48fc982..cfea464e336a 100644
--- a/drivers/md/bcache/debug.c
+++ b/drivers/md/bcache/debug.c
@@ -274,7 +274,7 @@ void bch_debug_exit(void)
debugfs_remove_recursive(debug);
}
-int __init bch_debug_init(struct kobject *kobj)
+int __init bch_debug_init(void)
{
int ret = 0;
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index ca961b20b037..b7e9b48616bd 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -46,7 +46,7 @@ static const uuid_le invalid_uuid = {
}
};
-static struct kobject *bcache_kobj;
+static struct kset *bcache_kset;
struct mutex bch_register_lock;
LIST_HEAD(bch_cache_sets);
@@ -865,6 +865,7 @@ static const char *bch_cache_set_alloc(struct cache_sb *sb,
closure_set_stopped(&c->cl);
closure_put(&c->cl);
+ c->kobj.kset = bcache_kset;
kobject_init(&c->kobj, &bch_cache_set_ktype);
kobject_init(&c->internal, &bch_cache_set_internal_ktype);
@@ -958,7 +959,7 @@ static const char *bch_cache_set_alloc(struct cache_sb *sb,
goto err;
err = "error creating kobject";
- if (kobject_add(&c->kobj, bcache_kobj, "%pU", c->sb.user_uuid.b) ||
+ if (kobject_add(&c->kobj, NULL, "%pU", c->sb.user_uuid.b) ||
kobject_add(&c->internal, &c->kobj, "internal") ||
bch_cache_accounting_add_kobjs(&c->accounting, &c->kobj))
goto err;
@@ -2140,8 +2141,8 @@ static void bcache_exit(void)
{
bch_debug_exit();
bch_blockdev_exit();
- if (bcache_kobj)
- kobject_put(bcache_kobj);
+ if (bcache_kset)
+ kset_unregister(bcache_kset);
if (bcache_io_wq)
destroy_workqueue(bcache_io_wq);
unregister_reboot_notifier(&reboot);
@@ -2161,10 +2162,10 @@ static int __init bcache_init(void)
closure_debug_init();
if (!(bcache_io_wq = alloc_workqueue("bcache_io", WQ_MEM_RECLAIM, 0)) ||
- !(bcache_kobj = kobject_create_and_add("bcache", fs_kobj)) ||
- sysfs_create_files(bcache_kobj, files) ||
+ !(bcache_kset = kset_create_and_add("bcache", NULL, fs_kobj)) ||
+ sysfs_create_files(&bcache_kset->kobj, files) ||
bch_blockdev_init() ||
- bch_debug_init(bcache_kobj))
+ bch_debug_init())
goto err;
return 0;