public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Nigel Cunningham <nigel@suspend2.net>
Cc: Jens Axboe <axboe@suse.de>, "Rafael J. Wysocki" <rjw@sisk.pl>,
	linux-kernel@vger.kernel.org
Subject: Re: [Suspend2][ 0/9] Extents support.
Date: Tue, 27 Jun 2006 00:53:41 -0700	[thread overview]
Message-ID: <20060627075341.GA16347@kroah.com> (raw)
In-Reply-To: <200606271727.39474.nigel@suspend2.net>

On Tue, Jun 27, 2006 at 05:27:30PM +1000, Nigel Cunningham wrote:
> Hi.
> 
> On Tuesday 27 June 2006 17:06, Greg KH wrote:
> > Oh, and as a meta-comment, why /proc?  You know that's not acceptable,
> > right?
> 
> Partly because when I did consider switching to /sys, I found it to be 
> incomprehensible (even with the LWN articles and Documentation/ files). 
> Jonathan's articles and LCA presentation did help me start to get a better 
> grip, but then it just didn't seem to be worth the effort. I have two simple 
> relatively simple routines that handle all my proc entries at the moment, so 
> that adding a new entry is just a matter of adding an element in an array of 
> structs (saying what variable is being read/written, what type, min/max 
> values and side effect routines, eg). It looked to me like changing to sysfs 
> was going to require me to have a separate routine for every sysfs entry, 
> even though they'd all have those some basic features. Maybe I'm just 
> ignorant. Please tell me I am and point me in the right direction.

Well, as your stuff does not have anything to do with "processes",
putting it in /proc is not acceptable.

sysfs is one value per file, and if that matches up to what you need,
then it should be fine to use.

You do need to have some kind of function for every sysfs entry, but you
can group common ones together (as the hwmon drivers do.)

As you will not have a backing "device" to attach your files to, you
will probably need to deal with "raw" kobjects, and the learning curve
for how to create files in sysfs with them is unfortunatly a bit steep.
But there is lots of working examples in the kernel that do this (block
devices, md, driver core, etc.), there's plenty of code to copy from to
get it to work.

And if that doesn't look like fun, you can always just use create a new
filesystem (only 200 lines of code), or use debugfs.

good luck,

greg k-h

  reply	other threads:[~2006-06-27  7:56 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-26 16:54 [Suspend2][ 0/9] Extents support Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 1/9] [Suspend2] Extents header Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 2/9] [Suspend2] Extent allocation routines Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 3/9] [Suspend2] Free a whole extent chain Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 4/9] [Suspend2] Add extent to " Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 5/9] [Suspend2] Serialise extent chains Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 6/9] [Suspend2] Get next extent in an extent state Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 7/9] [Suspend2] Extent state to the start Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 8/9] [Suspend2] Extent state save and restore Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 9/9] [Suspend2] Extent header Nigel Cunningham
2006-06-26 21:20 ` [Suspend2][ 0/9] Extents support Rafael J. Wysocki
2006-06-27  4:28   ` Nigel Cunningham
2006-06-27  5:36     ` Jens Axboe
2006-06-27  5:39       ` Nigel Cunningham
2006-06-27  7:05         ` Jens Axboe
2006-06-27  7:39           ` Nigel Cunningham
2006-06-27  7:59             ` Jens Axboe
2006-06-27  8:12               ` Greg KH
2006-06-27  8:22                 ` Jens Axboe
2006-06-27  8:58                 ` Nigel Cunningham
2006-06-28 21:11                   ` Pavel Machek
2006-06-28 22:25                     ` Nigel Cunningham
2006-06-28 22:44                       ` Pavel Machek
2006-06-28 23:14                         ` Nigel Cunningham
2006-06-30 17:36                           ` Pavel Machek
2006-06-29  3:11                       ` Martin J. Bligh
2006-06-27  9:07               ` Nigel Cunningham
2006-06-27  9:26                 ` Rafael J. Wysocki
2006-06-27  9:35                   ` Nigel Cunningham
2006-06-27 22:19                     ` Rafael J. Wysocki
2006-06-27 23:47                       ` Nigel Cunningham
2006-06-28 22:35                         ` Rafael J. Wysocki
2006-06-28 23:26                           ` Nigel Cunningham
2006-06-29 20:52                             ` Rafael J. Wysocki
2006-06-30 17:58                           ` Pavel Machek
2006-06-28 11:28             ` Rahul Karnik
2006-06-28 12:42               ` Nigel Cunningham
2006-06-28 14:42                 ` Pekka Enberg
2006-06-28 23:37                   ` Nigel Cunningham
2006-06-29  5:19                     ` Pekka Enberg
2006-06-29  5:44                       ` Nigel Cunningham
2006-06-29 21:11                         ` Rafael J. Wysocki
2006-06-30 17:55                     ` suspend2 merge [was Re: [Suspend2][ 0/9] Extents support.] Pavel Machek
2006-07-01  9:31                       ` Dumitru Ciobarcianu
2006-06-28 22:41                 ` [Suspend2][ 0/9] Extents support Rafael J. Wysocki
2006-06-28 14:37               ` Olivier Galibert
2006-06-28 21:05                 ` Pavel Machek
2006-06-27  7:06         ` Greg KH
2006-06-27  7:27           ` Nigel Cunningham
2006-06-27  7:53             ` Greg KH [this message]
2006-06-27  9:08               ` Nigel Cunningham

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=20060627075341.GA16347@kroah.com \
    --to=greg@kroah.com \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nigel@suspend2.net \
    --cc=rjw@sisk.pl \
    /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