Re: [PATCHSET 3/4] sysfs: divorce sysfs from kobject and driver model

Cornelia Huck
2007-10-10T09:11:38Z

On Tue, 9 Oct 2007 16:28:04 -0700,
Greg KH <greg@kroah.com> wrote:

> On Tue, Oct 09, 2007 at 04:20:39PM -0700, Roland Dreier wrote:
> > > > - relaying implementation details to userspace so that they cannot be
> > > > easily changed. We would need to allow kobjects not showing up in sysfs
> > > > and making symlinks a sysfs facility not relying on kobjects to help
> > > > there.
> > >
> > > Huh? Why would you want a kobject to not show up in sysfs?
> >
> > I think the text you replied to explained it perfectly: becase you
> > don't want internal implementation details to be exposed the userspace
> > and become an unchangeable part of the kernel/userspace interface.
>
> But a kobject represents "something" in the kernel. If it's there, then
> it shows up in sysfs. But if it isn't, or it changes somehow, then it
> no longer is in sysfs, which is fine, and your userspace tools have to
> be able to handle that by virtue of the rules of how to use sysfs from
> userspace.

The rules for using sysfs information are currently only laid out for
the driver model. We would need similar rules for every other user of
kobjects.

This only works if we make the following the general rules:

- You may not rely on any information in sysfs to be present.
- Exceptions to that rule are documented for that special user of sysfs.