Re: [RFC] sysfs kobject that doesn't trigger hotplug events

John Zielinski
2004-05-22T01:44:37Z

Greg KH wrote:

> So why are you creating a kobject, and not just attributes?
>

So I could reuse the kobjects reference counting code so that my data
would get freed once other kernel code no longer referenced it. It
would also let me have a more elaborate directory tree instead of just a
single subdirectory deep as with attribute groups, kind of like what
Stephen Hemminger wanted to do with his bridge device directory layout.

> What exactly are you wanting to do? How about we start there.
>

This is for an embedded project I'm working on but the code may be
useful once the fbdev guys start expanding their sysfs support.
Basically I want to expose the fbdev's modedb structures to user space
and have an interface for manipulating this information. I'm expanding
that modedb to also include supported color bit formats, etc. Trying to
encode the relationships in the attribute filenames would quickly get
unmanageable. That's why I want to have a nice directory layout
presenting that info.

Now there was a big Holy War (tm) in the fbdev mailing list about
whether that should be done in kernel space or user space, but for my
project for simplicity I want in in kernel space and I _believe_ the
last truce in the fbdev list has it in the kernel as well. :)

John