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

John Zielinski
2004-05-19T04:43:50Z

Greg KH wrote:

>Your patch is not needed at all. Please read the first comment in the
>kobject_hotplug() function to see how to prevent kobjects from creating
>hotplug events.
>
>

You mean this one?

/* If this kobj does not belong to a kset, try to find a parent that does */

The problem I saw with that is even though my kobject won't have a kset,
my kobject's parent (or grandparent) may and I'll trigger that one. I'm
not creating a new device driver, just extending one so I won't have
control over that kobject's lineage.

The other way is to create a subsystem using subsytem_init but not to
add it to the sysfs tree and then add my kobject to that kset and use
the kset's hotplug filter to stop the hotplug events. This would
require extra code and a little bit more memory usage for that kset, but
I believe that would work. Any drawbacks to this method?

Or am I missing something?

John