* Create a cpuset, which would be cpuset_create() but * mark the new 'set' as root. * * We are not going to reparent the td to it. Use cpuset_setproc_update_set() * for that. * * In case of no error, returns the set in *setp locked with a reference. */
| 1673 | * In case of no error, returns the set in *setp locked with a reference. |
| 1674 | */ |
| 1675 | int |
| 1676 | cpuset_create_root(struct prison *pr, struct cpuset **setp) |
| 1677 | { |
| 1678 | struct cpuset *set; |
| 1679 | int error; |
| 1680 | |
| 1681 | KASSERT(pr != NULL, ("[%s:%d] invalid pr", __func__, __LINE__)); |
| 1682 | KASSERT(setp != NULL, ("[%s:%d] invalid setp", __func__, __LINE__)); |
| 1683 | |
| 1684 | set = NULL; |
| 1685 | error = cpuset_create(&set, pr->pr_cpuset, &pr->pr_cpuset->cs_mask); |
| 1686 | if (error) |
| 1687 | return (error); |
| 1688 | |
| 1689 | KASSERT(set != NULL, ("[%s:%d] cpuset_create returned invalid data", |
| 1690 | __func__, __LINE__)); |
| 1691 | |
| 1692 | /* Mark the set as root. */ |
| 1693 | set->cs_flags |= CPU_SET_ROOT; |
| 1694 | *setp = set; |
| 1695 | |
| 1696 | return (0); |
| 1697 | } |
| 1698 | |
| 1699 | int |
| 1700 | cpuset_setproc_update_set(struct proc *p, struct cpuset *set) |
no test coverage detected