Re: [PATCH] 2.5 PROPOSAL: Replacement for current /proc of shit.

Tim Jansen
2001-11-01T12:17:22Z

On Thursday 01 November 2001 11:32, Rusty Russell wrote:
> I believe that rewriting /proc (and /proc/sys should simply die) is a
> better solution than extending the interface, or avoiding it
> altogether by using a new filesystem.

I am currently working on something like this, too. It's using Patrick
Mochel's driverfs patch
(http://www.kernel.org/pub/linux/kernel/people/mochel/device/driverfs.diff-1030)
as a base and adds the functionality of the extensions that I did to proc fs
for my device registry patch
(http://www.tjansen.de/devreg/proc_ov-2.4.7.diff).

You can get an idea of the API in the proc_ov patch: every file in the
filesystem is typed and either a string, integer, unsigned long or an enum.
The intention is that you have a single value per file, like in /proc/sys,
and not more. The API does not even allow you to have more complex files (I
plan to add a blob type though).
Unlike comparable APIs it also supports 'dynamic directories'. So you can,
for example, create a directory for each device without registering a
directory for each device. You only need a single dynamic directory with a
couple of callbacks that specify the number of directories, their names and
their contexts. Contexts are void pointers that are given to the callbacks of
the content files, in this example you would probably use the pointer to the
device's struct device as context.

bye...