Lines Matching refs:dm

334 devfs_rmdir_empty(struct devfs_mount *dm, struct devfs_dirent *de)
338 sx_assert(&dm->dm_lock, SX_XLOCKED);
344 if ((de->de_flags & DE_DOOMED) != 0 || de == dm->dm_rootdir)
361 devfs_delete(dm, de, DEVFS_DEL_NORECURSE);
362 devfs_delete(dm, de_dot, DEVFS_DEL_NORECURSE);
363 devfs_delete(dm, de_dotdot, DEVFS_DEL_NORECURSE);
374 * The caller needs to hold the dm for the duration of the call since
375 * dm->dm_lock may be temporary dropped.
378 devfs_delete(struct devfs_mount *dm, struct devfs_dirent *de, int flags)
393 devfs_dir_unref_de(dm, dd);
403 sx_unlock(&dm->dm_lock);
408 sx_xlock(&dm->dm_lock);
429 devfs_rmdir_empty(dm, dd);
436 * The caller needs to hold the dm for the duration of the call.
440 devfs_purge(struct devfs_mount *dm, struct devfs_dirent *dd)
444 sx_assert(&dm->dm_lock, SX_XLOCKED);
458 devfs_dir_unref_de(dm, dd);
460 devfs_delete(dm, de, DEVFS_DEL_NORECURSE);
462 devfs_purge(dm, de);
464 devfs_delete(dm, de, DEVFS_DEL_NORECURSE);
469 devfs_delete(dm, dd, DEVFS_DEL_NORECURSE);
479 devfs_metoo(struct cdev_priv *cdp, struct devfs_mount *dm)
484 siz = (dm->dm_idx + 1) * sizeof *dep;
487 if (dm->dm_idx <= cdp->cdp_maxdirent) {
500 cdp->cdp_maxdirent = dm->dm_idx;
506 * The caller needs to hold the dm for the duration of the call.
509 devfs_populate_loop(struct devfs_mount *dm, int cleanup)
518 sx_assert(&dm->dm_lock, SX_XLOCKED);
531 dm->dm_idx <= cdp->cdp_maxdirent &&
532 cdp->cdp_dirents[dm->dm_idx] != NULL) {
533 de = cdp->cdp_dirents[dm->dm_idx];
534 cdp->cdp_dirents[dm->dm_idx] = NULL;
544 devfs_delete(dm, de, 0);
569 if (dm->dm_idx <= cdp->cdp_maxdirent &&
570 cdp->cdp_dirents[dm->dm_idx] != NULL) {
571 de = cdp->cdp_dirents[dm->dm_idx];
579 if (dm->dm_idx > cdp->cdp_maxdirent)
580 devfs_metoo(cdp, dm);
582 dd = dm->dm_rootdir;
591 de = devfs_vmkdir(dm, s, q - s, dd, 0);
595 de = devfs_vmkdir(dm, s, q - s, dd, 0);
619 while (dt != dm->dm_rootdir &&
638 mac_devfs_create_device(cdp->cdp_c.si_cred, dm->dm_mount,
643 devfs_rules_apply(dm, de);
646 KASSERT(cdp->cdp_dirents[dm->dm_idx] == NULL,
648 cdp->cdp_dirents[dm->dm_idx] = de;
659 devfs_populate_needed(struct devfs_mount *dm)
662 return (dm->dm_generation != devfs_generation);
666 * The caller needs to hold the dm for the duration of the call.
669 devfs_populate(struct devfs_mount *dm)
673 sx_assert(&dm->dm_lock, SX_XLOCKED);
674 if (!devfs_populate_needed(dm))
677 while (devfs_populate_loop(dm, 0))
679 dm->dm_generation = gen;
683 * The caller needs to hold the dm for the duration of the call.
686 devfs_cleanup(struct devfs_mount *dm)
689 sx_assert(&dm->dm_lock, SX_XLOCKED);
690 while (devfs_populate_loop(dm, 1))
692 devfs_purge(dm, dm->dm_rootdir);