public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: ebiederm@xmission.com, cornelia.huck@de.ibm.com, greg@kroah.com,
	stern@rowland.harvard.edu, kay.sievers@vrfy.org,
	linux-kernel@vger.kernel.org, htejun@gmail.com
Subject: [PATCHSET 4/4] sysfs: implement new features
Date: Thu, 20 Sep 2007 17:31:37 +0900	[thread overview]
Message-ID: <11902770971822-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: 

Hello, all.

This is the fourth patchset of four sysfs update patchset series[1]
and to be applied on top of the third patchset[2].

This patchset implements the following new features.

* Notify pollers on file deactivation.

* Name-formatting for symlinks.  e.g. symlink pointing to
  /dira/dirb/leaf can be named as "symlink:%1-%0" and it will show up
  as "symlink:dirb-leaf".  This only applies when new interface is
  used.

* Autoremoval of symlinks when target is removed.  This only applies
  when new interface is used.

* Autorenaming of symlinks according to the name format string when
  target or one of its ancestors is renamed or moved.  This only
  applies when new interface is used.

* Plugged operations.  Sysfs users can plug top node and build subtree
  gradually without revealing the process to userland.  When subtree
  is fully constructed, the top node can be unplugged and userland
  will see completely built subtree appearing at once.  If subtree
  creation fails in the process, the whole subtree can be removed by
  simply removing the top node.  There won't be any userland
  noticeable event.  This is to be combined with uevent_suppress
  mechanism of driver model.

* Batch error handling.  A plugged node accumulates any error
  condition occurring below it and can return the first error when
  asked.  Also, all interface functions accepth ERR_PTR() value as
  sysfs_dirent parameter.  This means that constructs like the
  following can be used to replace the current group interface.

  <<-- code -->>
  group = sysfs_add_dir(parent, "group_name", 0777 | SYSFS_PLUGGED, NULL);
  sysfs_add_file(group, "file0", 0777, file0_ops, file0_data);
  sysfs_add_file(group, "file1", 0777, file1_ops, file1_data);
  ...
  sysfs_add_file(group, "fileN", 0777, fileN_ops, fileN_data);
  rc = sysfs_check_batch_error(group);
  if (rc) {
	sysfs_remove(group);
	return rc;
  }
  sysfs_unplug(group);
  return 0;
  <<-- end of code -->>

  The above will create a subdirectory "group_name" which contains N
  files and show them atomically to userland or remove them without
  letting userland notice if any failure happens.  This will simplify
  sysfs users quite a bit (not only for groups, other stuff too).

This patchset contains the following 8 patches.

 0001-sysfs-notify-file-on-deactivation.patch
 0002-sysfs-add-name-formatting-support-for-symlinks.patch
 0003-sysfs-chain-symlinks-to-their-targets.patch
 0004-sysfs-implement-symlink-auto-removal.patch
 0005-sysfs-implement-symlink-auto-rename.patch
 0006-sysfs-implement-plugged-creation-of-sysfs-nodes.patch
 0007-sysfs-implement-batch-error-handling.patch
 0008-sysfs-add-copyrights.patch

0001 implements notification on file deactivation.  0002-0005
implement symlink name formatting, autoremoving and autorenaming.
0006 implements plugged creation.  0007 batch error handling, and 0008
adds copyright notices on top of all sysfs header and source files.

Thanks.

--
tejun

[1] http://thread.gmane.org/gmane.linux.kernel/582105
[2] http://thread.gmane.org/gmane.linux.kernel/582147



             reply	other threads:[~2007-09-20  8:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-20  8:31 Tejun Heo [this message]
2007-09-20  8:31 ` [PATCH 1/8] sysfs: notify file on deactivation Tejun Heo
2007-09-20  8:31 ` [PATCH 2/8] sysfs: add name formatting support for symlinks Tejun Heo
2007-09-20  8:31 ` [PATCH 6/8] sysfs: implement plugged creation of sysfs nodes Tejun Heo
2007-09-20  8:31 ` [PATCH 8/8] sysfs: add copyrights Tejun Heo
2007-09-20  8:31 ` [PATCH 4/8] sysfs: implement symlink auto-removal Tejun Heo
2007-09-20  8:31 ` [PATCH 7/8] sysfs: implement batch error handling Tejun Heo
2007-09-20  8:31 ` [PATCH 5/8] sysfs: implement symlink auto-rename Tejun Heo
2007-09-20  8:31 ` [PATCH 3/8] sysfs: chain symlinks to their targets Tejun Heo
2007-09-25 22:50 ` [PATCHSET 4/4] sysfs: implement new features Greg KH
2007-09-27 12:24   ` Tejun Heo
2007-09-27 22:38   ` Kyle Moffett

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=11902770971822-git-send-email-htejun@gmail.com \
    --to=htejun@gmail.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=ebiederm@xmission.com \
    --cc=greg@kroah.com \
    --cc=kay.sievers@vrfy.org \
    --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