MCPcopy Create free account
hub / github.com/F-Stack/f-stack / clone_cleanup

Function clone_cleanup

freebsd/kern/kern_conf.c:1395–1424  ·  view source on GitHub ↗

* Kill everything still on the list. The driver should already have * disposed of any softc hung of the struct cdev *'s at this time. */

Source from the content-addressed store, hash-verified

1393 * disposed of any softc hung of the struct cdev *'s at this time.
1394 */
1395void
1396clone_cleanup(struct clonedevs **cdp)
1397{
1398 struct cdev *dev;
1399 struct cdev_priv *cp;
1400 struct clonedevs *cd;
1401
1402 cd = *cdp;
1403 if (cd == NULL)
1404 return;
1405 dev_lock();
1406 while (!LIST_EMPTY(&cd->head)) {
1407 dev = LIST_FIRST(&cd->head);
1408 LIST_REMOVE(dev, si_clone);
1409 KASSERT(dev->si_flags & SI_CLONELIST,
1410 ("Dev %p(%s) should be on clonelist", dev, dev->si_name));
1411 dev->si_flags &= ~SI_CLONELIST;
1412 cp = cdev2priv(dev);
1413 if (!(cp->cdp_flags & CDP_SCHED_DTR)) {
1414 cp->cdp_flags |= CDP_SCHED_DTR;
1415 KASSERT(dev->si_flags & SI_NAMED,
1416 ("Driver has goofed in cloning underways udev %jx unit %x",
1417 (uintmax_t)dev2udev(dev), dev2unit(dev)));
1418 destroy_devl(dev);
1419 }
1420 }
1421 dev_unlock_and_free();
1422 free(cd, M_DEVBUF);
1423 *cdp = NULL;
1424}
1425
1426static TAILQ_HEAD(, cdev_priv) dev_ddtr =
1427 TAILQ_HEAD_INITIALIZER(dev_ddtr);

Callers 1

tun_uninitFunction · 0.85

Calls 4

dev_lockFunction · 0.85
destroy_devlFunction · 0.85
dev_unlock_and_freeFunction · 0.85
freeFunction · 0.70

Tested by

no test coverage detected