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

Function destroy_dev_sched_cbl

freebsd/kern/kern_conf.c:1461–1480  ·  view source on GitHub ↗

* devmtx shall be locked on entry. devmtx will be unlocked after * function return. */

Source from the content-addressed store, hash-verified

1459 * function return.
1460 */
1461static int
1462destroy_dev_sched_cbl(struct cdev *dev, void (*cb)(void *), void *arg)
1463{
1464 struct cdev_priv *cp;
1465
1466 dev_lock_assert_locked();
1467 cp = cdev2priv(dev);
1468 if (cp->cdp_flags & CDP_SCHED_DTR) {
1469 dev_unlock();
1470 return (0);
1471 }
1472 dev_refl(dev);
1473 cp->cdp_flags |= CDP_SCHED_DTR;
1474 cp->cdp_dtr_cb = cb;
1475 cp->cdp_dtr_cb_arg = arg;
1476 TAILQ_INSERT_TAIL(&dev_ddtr, cp, cdp_dtr_list);
1477 dev_unlock();
1478 taskqueue_enqueue(taskqueue_swi_giant, &dev_dtr_task);
1479 return (1);
1480}
1481
1482int
1483destroy_dev_sched_cb(struct cdev *dev, void (*cb)(void *), void *arg)

Callers 1

destroy_dev_sched_cbFunction · 0.85

Calls 3

dev_unlockFunction · 0.85
dev_reflFunction · 0.85
taskqueue_enqueueFunction · 0.85

Tested by

no test coverage detected