tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: open() and close() from multithread application



>>> What to investigate to find why d_close handler is not called ?
>> Suppose d_open() gets called on every open while d_close() only gets
>> called on last close.
> I put this question to find how to implement reference counting in
> kernel module.

> Does exist some way how to force calling d_close on every close() ?
> Or does exist way how to retrieve some OS internal reference count
> for kernel module ?

Why do you want reference counting?  Depending on the goal you're
trying to reach with refcounting, could it, maybe, be as simple as just
taking a call to d_close as an indication your conceptual refcount has
dropped to zero?

That is, let the existing kernel machinery do reference counting or
equivalent as part of its logic to decide when to call d_close.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index