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

Function cpuset_create_root

freebsd/kern/kern_cpuset.c:1675–1697  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

1673 * In case of no error, returns the set in *setp locked with a reference.
1674 */
1675int
1676cpuset_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
1699int
1700cpuset_setproc_update_set(struct proc *p, struct cpuset *set)

Callers 1

kern_jail_setFunction · 0.85

Calls 1

cpuset_createFunction · 0.85

Tested by

no test coverage detected