LKML Archive on
help / color / mirror / Atom feed
From: dann frazier <>
Subject: Re: [Ocfs2-devel] [PATCH] [ocfs2] Use a kobject instead of a kset
Date: Sat, 5 Feb 2011 11:45:26 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <20110204175751.GA21472@noexit>

On Fri, Feb 04, 2011 at 09:58:01AM -0800, Joel Becker wrote:
> On Fri, Feb 04, 2011 at 09:40:27AM -0700, wrote:
> > From: dann frazier <>
> > 
> > We currently allocate a kset and add attributes to its internal kobject.
> > However, Documentation/kobject.txt says only the kset code should manipulate
> > this internal object, and we can get the same results by just creating our
> > own kobject and avoiding a kset altogether.
> 	Hmm, is this actually valid?  I thought you had to be a kset to
> have children.  Did this change at some point?

hey Joel,
 Well, I'm by no means an expert on kobjects - hopefully someone who
is will chime in. I came across this while debugging a sysfs teardown
issue and looking through this code to see if it might be related. I
read through kobject.txt & saw that note about a kset's kobj being for
internal-use only, and then saw that samples/kobject/kobject-example.c
seems to achieve the same goal (a sysfs dir w/ attributes) w/o using a

The sysfs entries look the same to me before & after this patch:

$ ls -l /sys/fs/ocfs2
total 0
-r--r--r-- 1 root root 4096 Feb  5 11:40 active_cluster_plugin
-rw-r--r-- 1 root root 4096 Feb  5 11:40 cluster_stack
-r--r--r-- 1 root root 4096 Feb  5 11:40 loaded_cluster_plugins
-r--r--r-- 1 root root 4096 Feb  5 11:40 max_locking_protocol

That said, I haven't been able to demonstate that the current code is
causing any actual problems - this was just a cleanup attempt.

      reply	other threads:[~2011-02-05 18:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-04 16:40 dann.frazier
2011-02-04 17:58 ` [Ocfs2-devel] " Joel Becker
2011-02-05 18:45   ` dann frazier [this message]

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:

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

  git send-email \ \ \ \ \
    --subject='Re: [Ocfs2-devel] [PATCH] [ocfs2] Use a kobject instead of a kset' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).