Is there some implicit locking of device methods?

Bartosz Fabianowski freebsd at chillt.de
Wed Apr 27 15:35:27 UTC 2011


> The global kind of last close is communicated to cdev by calling cdevsw
> close method. It is known to be not quite reliable, and esp. hard in
> relation to the forced unmounts of devfs mount points.
>
> The close of file (when no other file descriptors referencing the file are
> left) ends in cdevpriv destructor call.

Thanks. That confirms my understanding of the mechanism after John's 
clarification. I will move my code to the cdevpriv destructor and do 
away with the d_close method entirely.

- Bartosz


More information about the freebsd-hackers mailing list