Re: [Bug? Report] kref problem

Artem B. Bityutskiy
2006-03-16T17:45:16Z

Greg KH wrote:
> Don't statically create kobjects, it's not nice. But the real problem
> is below...

Well, that was just an example...

But in real life I do use a static kobject in one case, so I'm very
interested what should I do instead. I have a subsystem, and I want it
to put all its stuff in a /sys/A directory. So I just define a static
kobject for A and assign a dummy release function to it. Why is this bad?

And what should I do instead? kmalloc(sizeof(struct kobject),
GFP_KERNEL) ? I do not have a dynamic structure corresponding to my
module. I have many data structures corresponding to entities my object
handles and I have one static array which refers them. All is simple. I
do not want to introduce a dynamic data structure corresponding to the
subsystem as a whole just in order to not use static kobjects.

Comments?

--
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.