From: "Miquel van Smoorenburg" <miquels@cistron.nl>
To: linux-kernel@vger.kernel.org
Subject: Re: the userspace side of driverfs
Date: Wed, 11 Sep 2002 07:00:45 +0000 (UTC) [thread overview]
Message-ID: <almpmt$rmi$1@ncc1701.cistron.net> (raw)
In-Reply-To: Pine.LNX.4.44.0209102122520.1057-100000@cherise.pdx.osdl.net
In article <Pine.LNX.4.44.0209102122520.1057-100000@cherise.pdx.osdl.net>,
Patrick Mochel <mochel@osdl.org> wrote:
>The main ideal that we're shooting for is to have one ASCII value per
>file. The ASCII part is mandatory, but there will definitely be exceptions
>where we will have an array of or multiple values per file. We want to
>minimize those instances, though. Both for the sake of easy parsing, but
>also for easy formatting within the drivers.
If you have multiple values per file, why not make it a directory with
multiple files in it, each with one value per file.
If you care about speed, perhaps you can provide a ".array" virtual
file in such a (or each) directory, that when read returns all files
in the directory in "filename: value" format so that you avoid the
while (readdir()) { open(); close(); } overhead.
This would be much cleaner, think for example of how you would
otherwise _write_ individual entries in such an array.
If you really want to get overboard, provide a sysctl() like function
that can read the entries in driverfs in binary. Like the existing
sysctl() in linux, but with an added TYPE_INT, TYPE_STRING etc flag
for each value for consistency. It too should be able to read an
entire directory as an array.
Then, convert procfs to the same interface ;)
Mike.
next prev parent reply other threads:[~2002-09-11 6:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-11 1:18 the userspace side of driverfs Nicholas Miell
2002-09-11 2:16 ` Greg KH
2002-09-11 4:38 ` Patrick Mochel
2002-09-11 4:52 ` Nicholas Miell
2002-09-11 7:00 ` Miquel van Smoorenburg [this message]
2002-09-11 20:05 ` Nicholas Miell
2002-09-12 1:25 ` jw schultz
2002-09-12 4:13 ` Matt Domsch
2002-09-12 5:11 ` jw schultz
2002-09-12 16:41 ` Patrick Mochel
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='almpmt$rmi$1@ncc1701.cistron.net' \
--to=miquels@cistron.nl \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.