Re: [RFC] subclasses in sysfs to solve world peace

From: Dmitry Torokhov
Date: Fri Sep 16 2005 - 10:44:57 EST


On 9/16/05, Vojtech Pavlik <vojtech@xxxxxxx> wrote:
> On Thu, Sep 15, 2005 at 08:23:43PM -0500, Dmitry Torokhov wrote:
> > On Thursday 15 September 2005 20:04, Kay Sievers wrote:
> > > I like that the child devices are actually below the parent device
> > > and represent the logical structure. I prefer that compared to the
> > > symlink-representation between the classes at the same directory
> > > level which the input patches propose.
> >
> > Why don't we take it a step further and abandon classes altogether?
> > This way everything will grow from their respective hardware devices.
>
> That'd seem like a quite a good idea to me. ;)
>

You just saying that ;)

Look at I2C/sensors people. They are moving from having every sensor
crampled into I2C bus to hwmon class so all the sensors can be easily
located (by some program or what's not).

> > Class represent a set of objects with similar characteristics. In
> > this regard event0 is no "lesser" than input0.
>
> Well, input0 itself can't be accessed from userspace, so it's different.
>

Why is this a factor? We are not talking about /dev here. We have a
lot of things in sysfs that are not directly accessible from
userspace.

> > Although they are
> > linked they are objects of the same importance. I do want to see
> > all input interfaces without scanning bunch of directories.
>
> A directory with symlinks to all the interfaces of the class might make
> sense.
>

I'll try fix the patch I posted last night (that implements the above,
or at least what Kay described with sub-devices residing under their
parent devices and symlinked into their classes), I believe it could
also be used for block, so it will be like:

.../block/
|-- devices
| |-- sda
| | |-- device -> ../../../../
| | |-- sda1
| | | |-- dev
| | | `-- device -> ../../../../../block/partitions/sda1
| | |-- sda2
| | | |-- dev
| | | `-- device -> ../../../../../block/partitions/sda2
...
`-- partitions
|-- sda1 -> ../../../class/block/devices/sda/sda1
|-- sda2 -> ../../../class/block/devices/sda/sda2

--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/