Lines Matching refs:dm

318 devfs_rmdir_empty(struct devfs_mount *dm, struct devfs_dirent *de)
322 sx_assert(&dm->dm_lock, SX_XLOCKED);
328 if ((de->de_flags & DE_DOOMED) != 0 || de == dm->dm_rootdir)
345 devfs_delete(dm, de, DEVFS_DEL_NORECURSE);
346 devfs_delete(dm, de_dot, DEVFS_DEL_NORECURSE);
347 devfs_delete(dm, de_dotdot, DEVFS_DEL_NORECURSE);
358 * The caller needs to hold the dm for the duration of the call since
359 * dm->dm_lock may be temporary dropped.
362 devfs_delete(struct devfs_mount *dm, struct devfs_dirent *de, int flags)
377 devfs_dir_unref_de(dm, dd);
388 sx_unlock(&dm->dm_lock);
397 sx_xlock(&dm->dm_lock);
418 devfs_rmdir_empty(dm, dd);
425 * The caller needs to hold the dm for the duration of the call.
429 devfs_purge(struct devfs_mount *dm, struct devfs_dirent *dd)
433 sx_assert(&dm->dm_lock, SX_XLOCKED);
447 devfs_dir_unref_de(dm, dd);
449 devfs_delete(dm, de, DEVFS_DEL_NORECURSE);
451 devfs_purge(dm, de);
453 devfs_delete(dm, de, DEVFS_DEL_NORECURSE);
458 devfs_delete(dm, dd, DEVFS_DEL_NORECURSE);
468 devfs_metoo(struct cdev_priv *cdp, struct devfs_mount *dm)
473 siz = (dm->dm_idx + 1) * sizeof *dep;
476 if (dm->dm_idx <= cdp->cdp_maxdirent) {
490 cdp->cdp_maxdirent = dm->dm_idx;
495 * The caller needs to hold the dm for the duration of the call.
498 devfs_populate_loop(struct devfs_mount *dm, int cleanup)
507 sx_assert(&dm->dm_lock, SX_XLOCKED);
518 dm->dm_idx <= cdp->cdp_maxdirent &&
519 cdp->cdp_dirents[dm->dm_idx] != NULL) {
520 de = cdp->cdp_dirents[dm->dm_idx];
521 cdp->cdp_dirents[dm->dm_idx] = NULL;
531 devfs_delete(dm, de, 0);
555 if (dm->dm_idx <= cdp->cdp_maxdirent &&
556 cdp->cdp_dirents[dm->dm_idx] != NULL) {
557 de = cdp->cdp_dirents[dm->dm_idx];
566 if (dm->dm_idx > cdp->cdp_maxdirent)
567 devfs_metoo(cdp, dm);
569 dd = dm->dm_rootdir;
578 de = devfs_vmkdir(dm, s, q - s, dd, 0);
582 de = devfs_vmkdir(dm, s, q - s, dd, 0);
607 while (dt != dm->dm_rootdir &&
626 mac_devfs_create_device(cdp->cdp_c.si_cred, dm->dm_mount,
631 devfs_rules_apply(dm, de);
634 KASSERT(cdp->cdp_dirents[dm->dm_idx] == NULL,
636 cdp->cdp_dirents[dm->dm_idx] = de;
647 * The caller needs to hold the dm for the duration of the call.
650 devfs_populate(struct devfs_mount *dm)
654 sx_assert(&dm->dm_lock, SX_XLOCKED);
656 if (dm->dm_generation == gen)
658 while (devfs_populate_loop(dm, 0))
660 dm->dm_generation = gen;
664 * The caller needs to hold the dm for the duration of the call.
667 devfs_cleanup(struct devfs_mount *dm)
670 sx_assert(&dm->dm_lock, SX_XLOCKED);
671 while (devfs_populate_loop(dm, 1))
673 devfs_purge(dm, dm->dm_rootdir);