mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arthur Jones <ajones@riverbed.com>
To: Zach Brown <zach.brown@oracle.com>
Cc: Mark Fasheh <mark.fasheh@oracle.com>,
	Kurt Hackel <kurt.hackel@oracle.com>,
	linux-kernel@vger.kernel.org
Subject: static kset (and kobject)...
Date: Tue, 10 Jun 2008 10:57:24 -0700	[thread overview]
Message-ID: <20080610175723.GT26334@ajones-laptop.nbttech.com> (raw)

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

             reply	other threads:[~2008-06-10 17:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-10 17:57 Arthur Jones [this message]
2008-06-10 18:46 ` Zach Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080610175723.GT26334@ajones-laptop.nbttech.com \
    --to=ajones@riverbed.com \
    --cc=kurt.hackel@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.fasheh@oracle.com \
    --cc=zach.brown@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®