mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Tejun Heo <htejun@gmail.com>
Cc: Greg K-H <greg@kroah.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>
Subject: Re: regarding sysfs/kobject separation
Date: Mon, 10 Sep 2007 13:51:59 +0200	[thread overview]
Message-ID: <20070910135159.133224eb@gondolin.boeblingen.de.ibm.com> (raw)
In-Reply-To: <46DABD6A.2030708@gmail.com>

On Sun, 02 Sep 2007 22:40:58 +0900,
Tejun Heo <htejun@gmail.com> wrote:

> * Suicidal nodes don't need special treatment.  If a file tries to
> commit suicide, sysfs will detect the condition and deactivate and drain
> the node except for the suiciding reference.

Excellent. This is so easy to overlook.

> * Plugged creation and batched error handling.  Sysfs directories can be
> 'plugged' on creation such that it can be made visible atomically after
> all its subtrees are constructed.  Also, the user doesn't have to check
> for failure at every step.  For example, the user can do the following.
> 
> 	dir = sysfs_add_dir(parent, "my_dir", SYSFS_PLUGGED | 0777);
> 	sysfs_add_file(dir, ...);
> 	...
> 	dir2 = sysfs_add_dir(dir, ...);
> 	sysfs_add_link(dir, "link-to-dir2", dir2);
> 	...
> 	if (sysfs_check_batch_error(dir) == 0)
> 		sysfs_unplug(dir);
> 	else
> 		sysfs_remove(dir);
> 
> And all the nodes under and including @dir will show up atomically if
> all operations succeeded or removed without ever bothering userland.

Hm. This sounds like two different things:

- Eliminate the need to check after each operation. Might be a matter
of taste; personally, I prefer checking and unwinding on error.

- Atomic creation/deletion of a bunch of sysfs nodes. This sounds
like something really worthwile to have.

> 
> * Automatic symlink handling.  Symlink names can be formatted with the
> name of its target.  e.g. if the symlink name is specified as
> "link-%1:%0" and points to "devices/mybus0/mydev0", its name becomes
> "link-mybus0-mydev0" && the symlink will be automatically renamed when
> the target node or one of its ancestor is moved or renamed.  The symlink
> is also plugged and removed together with its target.  So, once created,
> the user doesn't have to care about the symlink.  sysfs will take care
> of it.

Really nice. The need to delete/create symlinks on moving/renaming is
currently a headache inducer.

> * Move uevent support over to sysfs and bridging the current users.
> This makes sense because sysfs hierarchy is all that userland can see
> and sysfs users which don't use kobject also needs uevent support.

Makes sense.

> 
> * Convert device model (drivers/base/*) over to the new sysfs_dirent
> based interface and make device/driver <-> sysfs association flexible.
> Automatic sysfs association is a good thing.  In most cases, it makes
> sense and makes drivers simpler but it also needs to be flexible such
> that drivers with special needs can override how the device and driver
> are represented to userland.  I think such flexibility can be achieved
> without too much problem now that sysfs and kobject are separated.

Yes, if we can change internal implementation details without upsetting
userspace a lot is gained. As long as the default behaviour remains
easy to implement.

      parent reply	other threads:[~2007-09-10 11:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-02 13:40 Tejun Heo
2007-09-03  1:06 ` Eric W. Biederman
2007-09-09 14:59 ` Greg KH
2007-09-09 21:49   ` Tejun Heo
2007-09-10 11:51 ` Cornelia Huck [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:
  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=20070910135159.133224eb@gondolin.boeblingen.de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=ebiederm@xmission.com \
    --cc=greg@kroah.com \
    --cc=htejun@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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®