public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joel Becker <Joel.Becker@oracle.com>
To: Andrew Morton <akpm@osdl.org>,
	phillips@istop.com, linux-kernel@vger.kernel.org, greg@kroah.com
Subject: Re: [RFC][PATCH 1 of 4] Configfs is really sysfs
Date: Sat, 3 Sep 2005 21:54:45 -0700	[thread overview]
Message-ID: <20050904045444.GS8684@ca-server1.us.oracle.com> (raw)
In-Reply-To: <20050904044136.GR8684@ca-server1.us.oracle.com>

On Sat, Sep 03, 2005 at 09:41:36PM -0700, Joel Becker wrote:
> On Sat, Sep 03, 2005 at 09:12:24PM -0700, Joel Becker wrote:
> > On Tue, Aug 30, 2005 at 04:28:46PM -0700, Andrew Morton wrote:
> > > Sure, but all that copying-and-pasting really sucks.  I'm sure there's some
> > > way of providing the slightly different semantics from the same codebase?
> 

	So, what conclusions can we draw from looking at this again?
	First, merging the kobject/kset structures with the
config_item/config_group structures has one benefit: they have the same
name.  However, that's also the first problem.  As it currently stands,
you know from the name what you are working with.  If they have the same
name, you don't know if you are working with an object in sysfs or
configfs.  We call a pid "pid_t" rather than "unsigned int" for the same
reason, clarity of usage.
	Merging them has a lot of other problems.  Far from removing
code bloat (a configfs object and a sysfs object need different
initialization, etc, so there would be two paths anyway), it adds
significant memory bloat, as configfs objects and sysfs objects are
carrying around members for the other filesystem.  Finally, there are
surprises in store if you try to use some of the API that isn't
appropriate.  With a different name and type, you just _can't_ do that.
	We could perhaps share the attribute structure.  This has the
same name confusion problem above, but that's about it, assuming that
sysfs never wants to do anything smarter with them.  I'm hoping the
sysfs folks comment on this.
	Sharing the attribute file code is much harder.  They operate on
different types, and those types are laid out differently.  I think we'd
have to make the API far more invasive.  Instead of black-boxing the API
and having only show/store to implement, we'd have to provide some sort
of translation from the native structure to a shared type.  Basically,
repeating what the VFS has already done for us.
	Finally, assuming that the sysfs_dirent/configfs_dirent
arrangement is pretty fleshed out, I think that perhaps this backing
store could be joined.  Again, no more magic could be added, and it
would have to handle the sysfs and configfs types in concurrence, but I
think it could be done.  Again, sysfs folks, please comment.

Joel

-- 

"Hell is oneself, hell is alone, the other figures in it, merely projections."
        - T. S. Eliot

Joel Becker
Senior Member of Technical Staff
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

  reply	other threads:[~2005-09-04  4:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-30 22:54 [RFC][PATCH 1 of 4] Configfs is really sysfs Daniel Phillips
2005-08-30 22:57 ` [RFC][PATCH 2 " Daniel Phillips
2005-08-30 22:59   ` [RFC][PATCH 3 " Daniel Phillips
2005-08-30 23:03     ` [RFC][PATCH 4 " Daniel Phillips
2005-08-30 23:30       ` Daniel Phillips
2005-08-30 23:06     ` [RFC][PATCH 3 " Stephen Hemminger
2005-08-30 23:18       ` Daniel Phillips
2005-08-30 23:10     ` Daniel Phillips
2005-08-30 23:22   ` [RFC][PATCH 2 " Daniel Phillips
2005-08-30 23:13 ` [RFC][PATCH 1 " Joel Becker
2005-08-30 23:25   ` Daniel Phillips
2005-08-30 23:35     ` Daniel Phillips
2005-08-30 23:28   ` Andrew Morton
2005-08-30 23:34     ` viro
2005-08-30 23:51       ` Daniel Phillips
2005-08-30 23:37     ` Daniel Phillips
2005-08-31  0:03     ` Joel Becker
2005-09-04  3:53     ` Joel Becker
2005-09-04  4:12       ` Joel Becker
2005-09-04  4:41         ` Joel Becker
2005-09-04  4:54           ` Joel Becker [this message]
2005-09-07 20:31             ` Greg KH

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=20050904045444.GS8684@ca-server1.us.oracle.com \
    --to=joel.becker@oracle.com \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phillips@istop.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