Lines Matching refs:dm
101 static devfs_rid devfs_rid_input(devfs_rid rid, struct devfs_mount *dm);
104 struct devfs_mount *dm, struct devfs_dirent *de);
105 static void devfs_rule_applydm(struct devfs_krule *dk, struct devfs_mount *dm);
110 static int devfs_rule_input(struct devfs_rule *dr, struct devfs_mount *dm);
112 static int devfs_rule_match(struct devfs_krule *dk, struct devfs_mount *dm,
114 static int devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_mount *dm,
116 static void devfs_rule_run(struct devfs_krule *dk, struct devfs_mount *dm,
120 struct devfs_mount *dm, struct devfs_dirent *de,
123 struct devfs_mount *dm);
127 static int devfs_ruleset_use(devfs_rsnum rsnum, struct devfs_mount *dm);
141 devfs_rules_apply(struct devfs_mount *dm, struct devfs_dirent *de) in devfs_rules_apply() argument
145 sx_assert(&dm->dm_lock, SX_XLOCKED); in devfs_rules_apply()
147 if (dm->dm_ruleset == 0) in devfs_rules_apply()
150 ds = devfs_ruleset_bynum(dm->dm_ruleset); in devfs_rules_apply()
152 devfs_ruleset_applyde(ds, dm, de, devfs_rule_depth); in devfs_rules_apply()
160 devfs_rules_ioctl(struct devfs_mount *dm, u_long cmd, caddr_t data, struct thread *td) in devfs_rules_ioctl() argument
170 sx_assert(&dm->dm_lock, SX_XLOCKED); in devfs_rules_ioctl()
187 error = devfs_rule_input(dr, dm); in devfs_rules_ioctl()
203 error = devfs_rule_input(dr, dm); in devfs_rules_ioctl()
228 devfs_rule_applydm(dk, dm); in devfs_rules_ioctl()
233 rid = devfs_rid_input(rid, dm); in devfs_rules_ioctl()
239 devfs_rule_applydm(dk, dm); in devfs_rules_ioctl()
243 rid = devfs_rid_input(rid, dm); in devfs_rules_ioctl()
254 error = devfs_rule_input(dr, dm); in devfs_rules_ioctl()
283 error = devfs_ruleset_use(rsnum, dm); in devfs_rules_ioctl()
287 rsnum = rid2rsn(devfs_rid_input(mkrid(rsnum, 0), dm)); in devfs_rules_ioctl()
293 devfs_ruleset_applydm(ds, dm); in devfs_rules_ioctl()
325 devfs_rid_input(devfs_rid rid, struct devfs_mount *dm) in devfs_rid_input() argument
329 return (mkrid(dm->dm_ruleset, rid2rn(rid))); in devfs_rid_input()
343 devfs_rule_applyde_recursive(struct devfs_krule *dk, struct devfs_mount *dm, in devfs_rule_applyde_recursive() argument
349 devfs_rule_applyde_recursive(dk, dm, de2); in devfs_rule_applyde_recursive()
350 devfs_rule_run(dk, dm, de, devfs_rule_depth); in devfs_rule_applyde_recursive()
357 devfs_rule_applydm(struct devfs_krule *dk, struct devfs_mount *dm) in devfs_rule_applydm() argument
360 devfs_rule_applyde_recursive(dk, dm, dm->dm_rootdir); in devfs_rule_applydm()
457 devfs_rule_input(struct devfs_rule *dr, struct devfs_mount *dm) in devfs_rule_input() argument
462 dr->dr_id = devfs_rid_input(dr->dr_id, dm); in devfs_rule_input()
532 devfs_rule_match(struct devfs_krule *dk, struct devfs_mount *dm, in devfs_rule_match() argument
566 if (!devfs_rule_matchpath(dk, dm, de)) in devfs_rule_match()
576 devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_mount *dm, in devfs_rule_matchpath() argument
589 (de->de_dirent->d_type == DT_DIR && de != dm->dm_rootdir && in devfs_rule_matchpath()
592 pname = devfs_fqpn(specname, dm, de, NULL); in devfs_rule_matchpath()
606 devfs_rule_run(struct devfs_krule *dk, struct devfs_mount *dm, in devfs_rule_run() argument
612 if (!devfs_rule_match(dk, dm, de)) in devfs_rule_run()
639 devfs_ruleset_applyde(ds, dm, de, depth - 1); in devfs_rule_run()
648 devfs_ruleset_applyde(struct devfs_ruleset *ds, struct devfs_mount *dm, in devfs_ruleset_applyde() argument
654 devfs_rule_run(dk, dm, de, depth); in devfs_ruleset_applyde()
661 devfs_ruleset_applydm(struct devfs_ruleset *ds, struct devfs_mount *dm) in devfs_ruleset_applydm() argument
682 devfs_rule_applydm(dk, dm); in devfs_ruleset_applydm()
751 devfs_ruleset_use(devfs_rsnum rsnum, struct devfs_mount *dm) in devfs_ruleset_use() argument
755 if (dm->dm_ruleset != 0) { in devfs_ruleset_use()
756 cds = devfs_ruleset_bynum(dm->dm_ruleset); in devfs_ruleset_use()
762 dm->dm_ruleset = 0; in devfs_ruleset_use()
771 dm->dm_ruleset = rsnum; in devfs_ruleset_use()
777 devfs_rules_cleanup(struct devfs_mount *dm) in devfs_rules_cleanup() argument
781 sx_assert(&dm->dm_lock, SX_XLOCKED); in devfs_rules_cleanup()
782 if (dm->dm_ruleset != 0) { in devfs_rules_cleanup()
783 ds = devfs_ruleset_bynum(dm->dm_ruleset); in devfs_rules_cleanup()
793 devfs_ruleset_set(devfs_rsnum rsnum, struct devfs_mount *dm) in devfs_ruleset_set() argument
796 sx_assert(&dm->dm_lock, SX_XLOCKED); in devfs_ruleset_set()
799 devfs_ruleset_use(rsnum, dm); in devfs_ruleset_set()
807 devfs_ruleset_apply(struct devfs_mount *dm) in devfs_ruleset_apply() argument
811 sx_assert(&dm->dm_lock, SX_XLOCKED); in devfs_ruleset_apply()
814 if (dm->dm_ruleset == 0) { in devfs_ruleset_apply()
818 ds = devfs_ruleset_bynum(dm->dm_ruleset); in devfs_ruleset_apply()
820 devfs_ruleset_applydm(ds, dm); in devfs_ruleset_apply()