lkml.org 
[lkml]   [2008]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectstatic kset (and kobject)...
Hi Zack,  FYI:  I just learned that static ksets and kobjects
are bad (see Documentation/kobject.txt for details). The
following commit:

commit 52fd3d6fea441835fe3a35b7280e5e128bdeca9b
Author: Zach Brown <zach.brown@oracle.com>
Date: Thu Dec 15 14:31:23 2005 -0800

[PATCH] OCFS2: The Second Oracle Cluster Filesystem

Very simple printk wrapper which adds the ability to enable various
sets of debug messages at run-time.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>

Introduces:

+static struct kset mlog_kset = {
+ .kobj = {.name = "logmask", .ktype = &mlog_ktype},
+};
+
+int mlog_sys_init(struct subsystem *o2cb_subsys)
+{
+ int i = 0;
+
+ while (mlog_attrs[i].attr.mode) {
+ mlog_attr_ptrs[i] = &mlog_attrs[i].attr;
+ i++;
+ }
+ mlog_attr_ptrs[i] = NULL;
+
+ mlog_kset.subsys = o2cb_subsys;
+ return kset_register(&mlog_kset);
+}
+
+void mlog_sys_shutdown(void)
+{
+ kset_unregister(&mlog_kset);
+}

which I've learned the hard way probably won't
work as expected. I'm surprised that you don't
see some sort of issue w/ this on module reload...

Arthur


\
 
 \ /
  Last update: 2008-06-10 20:01    [W:0.027 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site