freebsd-dev/sys/fs/devfs
Konstantin Belousov de10ffa527 Since rev. 1.199 of sys/kern/kern_conf.c, the thread that calls
destroy_dev() from d_close() cdev method would self-deadlock.
devfs_close() bump device thread reference counter, and destroy_dev()
sleeps, waiting for si_threadcount to reach zero for cdev without
d_purge method.

destroy_dev_sched() could be used instead from d_close(), to
schedule execution of destroy_dev() in another context. The
destroy_dev_sched_drain() function can be used to drain the scheduled
calls to destroy_dev_sched(). Similarly, drain_dev_clone_events() drains
the events clone to make sure no lingering devices are left after
dev_clone event handler deregistered.

make_dev_credf(MAKEDEV_REF) function should be used from dev_clone
event handlers instead of make_dev()/make_dev_cred() to ensure that created
device has reference counter bumped before cdev mutex is dropped inside
make_dev().

Reviewed by:	tegge (early versions), njl (programming interface)
Debugging help and testing by:	Peter Holm
Approved by:	re (kensmith)
2007-07-03 17:42:37 +00:00
..
devfs_devs.c Rename mac*devfsdirent*() to mac*devfs*() to synchronize with SEDarwin, 2007-04-23 13:36:54 +00:00
devfs_int.h Since rev. 1.199 of sys/kern/kern_conf.c, the thread that calls 2007-07-03 17:42:37 +00:00
devfs_rule.c Sweep kernel replacing suser(9) calls with priv(9) calls, assigning 2006-11-06 13:42:10 +00:00
devfs_vfsops.c Use mount interlock to protect all changes to mnt_flag and mnt_kern_flag. 2006-09-26 04:12:49 +00:00
devfs_vnops.c Since rev. 1.199 of sys/kern/kern_conf.c, the thread that calls 2007-07-03 17:42:37 +00:00
devfs.h Properly lock the vnode around vgone() calls. 2006-10-18 11:17:14 +00:00