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

Function cpuset_shadow

freebsd/kern/kern_cpuset.c:996–1026  ·  view source on GitHub ↗

* Create an anonymous set with the provided mask in the space provided by * 'nset'. If the passed in set is anonymous we use its parent otherwise * the new set is a child of 'set'. */

Source from the content-addressed store, hash-verified

994 * the new set is a child of 'set'.
995 */
996static int
997cpuset_shadow(struct cpuset *set, struct cpuset **nsetp,
998 const cpuset_t *mask, const struct domainset *domain,
999 struct setlist *cpusets, struct domainlist *domains)
1000{
1001 struct cpuset *parent;
1002 struct cpuset *nset;
1003 struct domainset *dset;
1004 struct domainset *d;
1005 int error;
1006
1007 error = cpuset_testshadow(set, mask, domain);
1008 if (error)
1009 return (error);
1010
1011 parent = cpuset_getbase(set);
1012 dset = parent->cs_domain;
1013 if (mask == NULL)
1014 mask = &set->cs_mask;
1015 if (domain != NULL)
1016 d = domainset_shadow(dset, domain, domains);
1017 else
1018 d = set->cs_domain;
1019 nset = LIST_FIRST(cpusets);
1020 error = cpuset_init(nset, parent, mask, d, CPUSET_INVALID);
1021 if (error == 0) {
1022 LIST_REMOVE(nset, cs_link);
1023 *nsetp = nset;
1024 }
1025 return (error);
1026}
1027
1028static struct cpuset *
1029cpuset_update_thread(struct thread *td, struct cpuset *nset)

Callers 3

cpuset_setproc_setthreadFunction · 0.85
_cpuset_setthreadFunction · 0.85

Calls 4

cpuset_testshadowFunction · 0.85
cpuset_getbaseFunction · 0.85
domainset_shadowFunction · 0.85
cpuset_initFunction · 0.85

Tested by

no test coverage detected