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

Function destroy_dev_tq

freebsd/kern/kern_conf.c:1430–1455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1428static struct task dev_dtr_task = TASK_INITIALIZER(0, destroy_dev_tq, NULL);
1429
1430static void
1431destroy_dev_tq(void *ctx, int pending)
1432{
1433 struct cdev_priv *cp;
1434 struct cdev *dev;
1435 void (*cb)(void *);
1436 void *cb_arg;
1437
1438 dev_lock();
1439 while (!TAILQ_EMPTY(&dev_ddtr)) {
1440 cp = TAILQ_FIRST(&dev_ddtr);
1441 dev = &cp->cdp_c;
1442 KASSERT(cp->cdp_flags & CDP_SCHED_DTR,
1443 ("cdev %p in dev_destroy_tq without CDP_SCHED_DTR", cp));
1444 TAILQ_REMOVE(&dev_ddtr, cp, cdp_dtr_list);
1445 cb = cp->cdp_dtr_cb;
1446 cb_arg = cp->cdp_dtr_cb_arg;
1447 destroy_devl(dev);
1448 dev_unlock_and_free();
1449 dev_rel(dev);
1450 if (cb != NULL)
1451 cb(cb_arg);
1452 dev_lock();
1453 }
1454 dev_unlock();
1455}
1456
1457/*
1458 * devmtx shall be locked on entry. devmtx will be unlocked after

Callers

nothing calls this directly

Calls 5

dev_lockFunction · 0.85
destroy_devlFunction · 0.85
dev_unlock_and_freeFunction · 0.85
dev_relFunction · 0.85
dev_unlockFunction · 0.85

Tested by

no test coverage detected