diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-01-14 14:04:29 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2015-01-14 14:04:29 +0000 |
commit | 99b91105134836ab8410881a39784eacdcd8a1c2 (patch) | |
tree | c8cfae0b952598052767f1b3247322249ead54e6 /sys/kern | |
parent | e0e859773e6e787ee1ca89e7705018f8ae353638 (diff) | |
download | FreeBSD-src-99b91105134836ab8410881a39784eacdcd8a1c2.zip FreeBSD-src-99b91105134836ab8410881a39784eacdcd8a1c2.tar.gz |
Add a kernel function to delist our kernel character devices, so that
the device name can be re-used right away in case we are destroying
the character devices in the background.
MFC after: 4 days
Reported by: dchagin@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_conf.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index d15e5da..8b1fdc1 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -1114,6 +1114,23 @@ destroy_devl(struct cdev *dev) } } +static void +delist_dev_locked(struct cdev *dev) +{ + struct cdev *child; + devfs_destroy(dev); + LIST_FOREACH(child, &dev->si_children, si_siblings) + delist_dev_locked(child); +} + +void +delist_dev(struct cdev *dev) +{ + dev_lock(); + delist_dev_locked(dev); + dev_unlock(); +} + void destroy_dev(struct cdev *dev) { |