aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-04-13 16:15:19 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-05-02 21:57:59 -0400
commit823bccfc4002296ba88c3ad0f049e1abd8108d30 (patch)
tree5338ae0b32409446af4cd00c5107d9405d5bf0b6 /fs
parent2609e7b9bebfd433254c02538ba803dc516ff674 (diff)
remove "struct subsystem" as it is no longer needed
We need to work on cleaning up the relationship between kobjects, ksets and ktypes. The removal of 'struct subsystem' is the first step of this, especially as it is not really needed at all. Thanks to Kay for fixing the bugs in this patch. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/configfs/mount.c2
-rw-r--r--fs/debugfs/inode.c2
-rw-r--r--fs/dlm/lockspace.c2
-rw-r--r--fs/ecryptfs/main.c12
-rw-r--r--fs/fuse/inode.c4
-rw-r--r--fs/gfs2/locking/dlm/sysfs.c2
-rw-r--r--fs/gfs2/sys.c2
-rw-r--r--fs/ocfs2/cluster/masklog.c4
-rw-r--r--fs/ocfs2/cluster/masklog.h2
-rw-r--r--fs/ocfs2/cluster/sys.c7
-rw-r--r--fs/partitions/check.c6
-rw-r--r--fs/sysfs/file.c11
12 files changed, 27 insertions, 29 deletions
diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c
index 6f573004cd7d..b00d962de833 100644
--- a/fs/configfs/mount.c
+++ b/fs/configfs/mount.c
@@ -140,7 +140,7 @@ static int __init configfs_init(void)
140 if (!configfs_dir_cachep) 140 if (!configfs_dir_cachep)
141 goto out; 141 goto out;
142 142
143 kset_set_kset_s(&config_subsys, kernel_subsys); 143 kobj_set_kset_s(&config_subsys, kernel_subsys);
144 err = subsystem_register(&config_subsys); 144 err = subsystem_register(&config_subsys);
145 if (err) { 145 if (err) {
146 kmem_cache_destroy(configfs_dir_cachep); 146 kmem_cache_destroy(configfs_dir_cachep);
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 7b324cfebcb1..ec8896b264de 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -374,7 +374,7 @@ static int __init debugfs_init(void)
374{ 374{
375 int retval; 375 int retval;
376 376
377 kset_set_kset_s(&debug_subsys, kernel_subsys); 377 kobj_set_kset_s(&debug_subsys, kernel_subsys);
378 retval = subsystem_register(&debug_subsys); 378 retval = subsystem_register(&debug_subsys);
379 if (retval) 379 if (retval)
380 return retval; 380 return retval;
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index f40817b53c6f..8e6ad7600236 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -167,7 +167,6 @@ static struct kobj_type dlm_ktype = {
167}; 167};
168 168
169static struct kset dlm_kset = { 169static struct kset dlm_kset = {
170 .subsys = &kernel_subsys,
171 .kobj = {.name = "dlm",}, 170 .kobj = {.name = "dlm",},
172 .ktype = &dlm_ktype, 171 .ktype = &dlm_ktype,
173}; 172};
@@ -218,6 +217,7 @@ int dlm_lockspace_init(void)
218 INIT_LIST_HEAD(&lslist); 217 INIT_LIST_HEAD(&lslist);
219 spin_lock_init(&lslist_lock); 218 spin_lock_init(&lslist_lock);
220 219
220 kobj_set_kset_s(&dlm_kset, kernel_subsys);
221 error = kset_register(&dlm_kset); 221 error = kset_register(&dlm_kset);
222 if (error) 222 if (error)
223 printk("dlm_lockspace_init: cannot register kset %d\n", error); 223 printk("dlm_lockspace_init: cannot register kset %d\n", error);
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index fc4a3a224641..6acc8f4fc588 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -793,7 +793,7 @@ static int do_sysfs_registration(void)
793 "Unable to register ecryptfs sysfs subsystem\n"); 793 "Unable to register ecryptfs sysfs subsystem\n");
794 goto out; 794 goto out;
795 } 795 }
796 rc = sysfs_create_file(&ecryptfs_subsys.kset.kobj, 796 rc = sysfs_create_file(&ecryptfs_subsys.kobj,
797 &sysfs_attr_version.attr); 797 &sysfs_attr_version.attr);
798 if (rc) { 798 if (rc) {
799 printk(KERN_ERR 799 printk(KERN_ERR
@@ -801,12 +801,12 @@ static int do_sysfs_registration(void)
801 subsystem_unregister(&ecryptfs_subsys); 801 subsystem_unregister(&ecryptfs_subsys);
802 goto out; 802 goto out;
803 } 803 }
804 rc = sysfs_create_file(&ecryptfs_subsys.kset.kobj, 804 rc = sysfs_create_file(&ecryptfs_subsys.kobj,
805 &sysfs_attr_version_str.attr); 805 &sysfs_attr_version_str.attr);
806 if (rc) { 806 if (rc) {
807 printk(KERN_ERR 807 printk(KERN_ERR
808 "Unable to create ecryptfs version_str attribute\n"); 808 "Unable to create ecryptfs version_str attribute\n");
809 sysfs_remove_file(&ecryptfs_subsys.kset.kobj, 809 sysfs_remove_file(&ecryptfs_subsys.kobj,
810 &sysfs_attr_version.attr); 810 &sysfs_attr_version.attr);
811 subsystem_unregister(&ecryptfs_subsys); 811 subsystem_unregister(&ecryptfs_subsys);
812 goto out; 812 goto out;
@@ -841,7 +841,7 @@ static int __init ecryptfs_init(void)
841 ecryptfs_free_kmem_caches(); 841 ecryptfs_free_kmem_caches();
842 goto out; 842 goto out;
843 } 843 }
844 kset_set_kset_s(&ecryptfs_subsys, fs_subsys); 844 kobj_set_kset_s(&ecryptfs_subsys, fs_subsys);
845 sysfs_attr_version.attr.owner = THIS_MODULE; 845 sysfs_attr_version.attr.owner = THIS_MODULE;
846 sysfs_attr_version_str.attr.owner = THIS_MODULE; 846 sysfs_attr_version_str.attr.owner = THIS_MODULE;
847 rc = do_sysfs_registration(); 847 rc = do_sysfs_registration();
@@ -862,9 +862,9 @@ out:
862 862
863static void __exit ecryptfs_exit(void) 863static void __exit ecryptfs_exit(void)
864{ 864{
865 sysfs_remove_file(&ecryptfs_subsys.kset.kobj, 865 sysfs_remove_file(&ecryptfs_subsys.kobj,
866 &sysfs_attr_version.attr); 866 &sysfs_attr_version.attr);
867 sysfs_remove_file(&ecryptfs_subsys.kset.kobj, 867 sysfs_remove_file(&ecryptfs_subsys.kobj,
868 &sysfs_attr_version_str.attr); 868 &sysfs_attr_version_str.attr);
869 subsystem_unregister(&ecryptfs_subsys); 869 subsystem_unregister(&ecryptfs_subsys);
870 ecryptfs_release_messaging(ecryptfs_transport); 870 ecryptfs_release_messaging(ecryptfs_transport);
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 608db81219a0..bdffe0cfe09a 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -731,12 +731,12 @@ static int fuse_sysfs_init(void)
731{ 731{
732 int err; 732 int err;
733 733
734 kset_set_kset_s(&fuse_subsys, fs_subsys); 734 kobj_set_kset_s(&fuse_subsys, fs_subsys);
735 err = subsystem_register(&fuse_subsys); 735 err = subsystem_register(&fuse_subsys);
736 if (err) 736 if (err)
737 goto out_err; 737 goto out_err;
738 738
739 kset_set_kset_s(&connections_subsys, fuse_subsys); 739 kobj_set_kset_s(&connections_subsys, fuse_subsys);
740 err = subsystem_register(&connections_subsys); 740 err = subsystem_register(&connections_subsys);
741 if (err) 741 if (err)
742 goto out_fuse_unregister; 742 goto out_fuse_unregister;
diff --git a/fs/gfs2/locking/dlm/sysfs.c b/fs/gfs2/locking/dlm/sysfs.c
index 4746b884662d..d9fe3ca40e18 100644
--- a/fs/gfs2/locking/dlm/sysfs.c
+++ b/fs/gfs2/locking/dlm/sysfs.c
@@ -190,7 +190,6 @@ static struct kobj_type gdlm_ktype = {
190}; 190};
191 191
192static struct kset gdlm_kset = { 192static struct kset gdlm_kset = {
193 .subsys = &kernel_subsys,
194 .kobj = {.name = "lock_dlm",}, 193 .kobj = {.name = "lock_dlm",},
195 .ktype = &gdlm_ktype, 194 .ktype = &gdlm_ktype,
196}; 195};
@@ -225,6 +224,7 @@ int gdlm_sysfs_init(void)
225{ 224{
226 int error; 225 int error;
227 226
227 kobj_set_kset_s(&gdlm_kset, kernel_subsys);
228 error = kset_register(&gdlm_kset); 228 error = kset_register(&gdlm_kset);
229 if (error) 229 if (error)
230 printk("lock_dlm: cannot register kset %d\n", error); 230 printk("lock_dlm: cannot register kset %d\n", error);
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index d01f9f0fda26..c26c21b53c19 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -222,7 +222,6 @@ static struct kobj_type gfs2_ktype = {
222}; 222};
223 223
224static struct kset gfs2_kset = { 224static struct kset gfs2_kset = {
225 .subsys = &fs_subsys,
226 .kobj = {.name = "gfs2"}, 225 .kobj = {.name = "gfs2"},
227 .ktype = &gfs2_ktype, 226 .ktype = &gfs2_ktype,
228}; 227};
@@ -554,6 +553,7 @@ int gfs2_sys_init(void)
554{ 553{
555 gfs2_sys_margs = NULL; 554 gfs2_sys_margs = NULL;
556 spin_lock_init(&gfs2_sys_margs_lock); 555 spin_lock_init(&gfs2_sys_margs_lock);
556 kobj_set_kset_s(&gfs2_kset, fs_subsys);
557 return kset_register(&gfs2_kset); 557 return kset_register(&gfs2_kset);
558} 558}
559 559
diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c
index 636593bf4d17..2e975c0a35e1 100644
--- a/fs/ocfs2/cluster/masklog.c
+++ b/fs/ocfs2/cluster/masklog.c
@@ -147,7 +147,7 @@ static struct kset mlog_kset = {
147 .kobj = {.name = "logmask", .ktype = &mlog_ktype}, 147 .kobj = {.name = "logmask", .ktype = &mlog_ktype},
148}; 148};
149 149
150int mlog_sys_init(struct subsystem *o2cb_subsys) 150int mlog_sys_init(struct kset *o2cb_subsys)
151{ 151{
152 int i = 0; 152 int i = 0;
153 153
@@ -157,7 +157,7 @@ int mlog_sys_init(struct subsystem *o2cb_subsys)
157 } 157 }
158 mlog_attr_ptrs[i] = NULL; 158 mlog_attr_ptrs[i] = NULL;
159 159
160 mlog_kset.subsys = o2cb_subsys; 160 kobj_set_kset_s(&mlog_kset, o2cb_subsys);
161 return kset_register(&mlog_kset); 161 return kset_register(&mlog_kset);
162} 162}
163 163
diff --git a/fs/ocfs2/cluster/masklog.h b/fs/ocfs2/cluster/masklog.h
index a42628ba9ddf..75cd877f6d42 100644
--- a/fs/ocfs2/cluster/masklog.h
+++ b/fs/ocfs2/cluster/masklog.h
@@ -278,7 +278,7 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits;
278 278
279#include <linux/kobject.h> 279#include <linux/kobject.h>
280#include <linux/sysfs.h> 280#include <linux/sysfs.h>
281int mlog_sys_init(struct subsystem *o2cb_subsys); 281int mlog_sys_init(struct kset *o2cb_subsys);
282void mlog_sys_shutdown(void); 282void mlog_sys_shutdown(void);
283 283
284#endif /* O2CLUSTER_MASKLOG_H */ 284#endif /* O2CLUSTER_MASKLOG_H */
diff --git a/fs/ocfs2/cluster/sys.c b/fs/ocfs2/cluster/sys.c
index 1d9f6acafa2e..64f6f378fd09 100644
--- a/fs/ocfs2/cluster/sys.c
+++ b/fs/ocfs2/cluster/sys.c
@@ -42,7 +42,6 @@ struct o2cb_attribute {
42#define O2CB_ATTR(_name, _mode, _show, _store) \ 42#define O2CB_ATTR(_name, _mode, _show, _store) \
43struct o2cb_attribute o2cb_attr_##_name = __ATTR(_name, _mode, _show, _store) 43struct o2cb_attribute o2cb_attr_##_name = __ATTR(_name, _mode, _show, _store)
44 44
45#define to_o2cb_subsys(k) container_of(to_kset(k), struct subsystem, kset)
46#define to_o2cb_attr(_attr) container_of(_attr, struct o2cb_attribute, attr) 45#define to_o2cb_attr(_attr) container_of(_attr, struct o2cb_attribute, attr)
47 46
48static ssize_t o2cb_interface_revision_show(char *buf) 47static ssize_t o2cb_interface_revision_show(char *buf)
@@ -79,7 +78,7 @@ static ssize_t
79o2cb_show(struct kobject * kobj, struct attribute * attr, char * buffer) 78o2cb_show(struct kobject * kobj, struct attribute * attr, char * buffer)
80{ 79{
81 struct o2cb_attribute *o2cb_attr = to_o2cb_attr(attr); 80 struct o2cb_attribute *o2cb_attr = to_o2cb_attr(attr);
82 struct subsystem *sbs = to_o2cb_subsys(kobj); 81 struct kset *sbs = to_kset(kobj);
83 82
84 BUG_ON(sbs != &o2cb_subsys); 83 BUG_ON(sbs != &o2cb_subsys);
85 84
@@ -93,7 +92,7 @@ o2cb_store(struct kobject * kobj, struct attribute * attr,
93 const char * buffer, size_t count) 92 const char * buffer, size_t count)
94{ 93{
95 struct o2cb_attribute *o2cb_attr = to_o2cb_attr(attr); 94 struct o2cb_attribute *o2cb_attr = to_o2cb_attr(attr);
96 struct subsystem *sbs = to_o2cb_subsys(kobj); 95 struct kset *sbs = to_kset(kobj);
97 96
98 BUG_ON(sbs != &o2cb_subsys); 97 BUG_ON(sbs != &o2cb_subsys);
99 98
@@ -112,7 +111,7 @@ int o2cb_sys_init(void)
112{ 111{
113 int ret; 112 int ret;
114 113
115 o2cb_subsys.kset.kobj.ktype = &o2cb_subsys_type; 114 o2cb_subsys.kobj.ktype = &o2cb_subsys_type;
116 ret = subsystem_register(&o2cb_subsys); 115 ret = subsystem_register(&o2cb_subsys);
117 if (ret) 116 if (ret)
118 return ret; 117 return ret;
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 8a7d0035ad7a..f01572fca02f 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -312,7 +312,7 @@ static struct attribute * default_attrs[] = {
312 NULL, 312 NULL,
313}; 313};
314 314
315extern struct subsystem block_subsys; 315extern struct kset block_subsys;
316 316
317static void part_release(struct kobject *kobj) 317static void part_release(struct kobject *kobj)
318{ 318{
@@ -388,7 +388,7 @@ void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len,
388 kobject_add(&p->kobj); 388 kobject_add(&p->kobj);
389 if (!disk->part_uevent_suppress) 389 if (!disk->part_uevent_suppress)
390 kobject_uevent(&p->kobj, KOBJ_ADD); 390 kobject_uevent(&p->kobj, KOBJ_ADD);
391 sysfs_create_link(&p->kobj, &block_subsys.kset.kobj, "subsystem"); 391 sysfs_create_link(&p->kobj, &block_subsys.kobj, "subsystem");
392 if (flags & ADDPART_FLAG_WHOLEDISK) { 392 if (flags & ADDPART_FLAG_WHOLEDISK) {
393 static struct attribute addpartattr = { 393 static struct attribute addpartattr = {
394 .name = "whole_disk", 394 .name = "whole_disk",
@@ -444,7 +444,7 @@ static int disk_sysfs_symlinks(struct gendisk *disk)
444 goto err_out_dev_link; 444 goto err_out_dev_link;
445 } 445 }
446 446
447 err = sysfs_create_link(&disk->kobj, &block_subsys.kset.kobj, 447 err = sysfs_create_link(&disk->kobj, &block_subsys.kobj,
448 "subsystem"); 448 "subsystem");
449 if (err) 449 if (err)
450 goto err_out_disk_name_lnk; 450 goto err_out_disk_name_lnk;
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index db0413a411d6..0e637adc2b87 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -13,8 +13,7 @@
13 13
14#include "sysfs.h" 14#include "sysfs.h"
15 15
16#define to_subsys(k) container_of(k,struct subsystem,kset.kobj) 16#define to_sattr(a) container_of(a,struct subsys_attribute, attr)
17#define to_sattr(a) container_of(a,struct subsys_attribute,attr)
18 17
19/* 18/*
20 * Subsystem file operations. 19 * Subsystem file operations.
@@ -24,12 +23,12 @@
24static ssize_t 23static ssize_t
25subsys_attr_show(struct kobject * kobj, struct attribute * attr, char * page) 24subsys_attr_show(struct kobject * kobj, struct attribute * attr, char * page)
26{ 25{
27 struct subsystem * s = to_subsys(kobj); 26 struct kset *kset = to_kset(kobj);
28 struct subsys_attribute * sattr = to_sattr(attr); 27 struct subsys_attribute * sattr = to_sattr(attr);
29 ssize_t ret = -EIO; 28 ssize_t ret = -EIO;
30 29
31 if (sattr->show) 30 if (sattr->show)
32 ret = sattr->show(s,page); 31 ret = sattr->show(kset, page);
33 return ret; 32 return ret;
34} 33}
35 34
@@ -37,12 +36,12 @@ static ssize_t
37subsys_attr_store(struct kobject * kobj, struct attribute * attr, 36subsys_attr_store(struct kobject * kobj, struct attribute * attr,
38 const char * page, size_t count) 37 const char * page, size_t count)
39{ 38{
40 struct subsystem * s = to_subsys(kobj); 39 struct kset *kset = to_kset(kobj);
41 struct subsys_attribute * sattr = to_sattr(attr); 40 struct subsys_attribute * sattr = to_sattr(attr);
42 ssize_t ret = -EIO; 41 ssize_t ret = -EIO;
43 42
44 if (sattr->store) 43 if (sattr->store)
45 ret = sattr->store(s,page,count); 44 ret = sattr->store(kset, page, count);
46 return ret; 45 return ret;
47} 46}
48 47