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

Function domainset_create

freebsd/kern/kern_cpuset.c:555–576  ·  view source on GitHub ↗

* Create or lookup a domainset based on the key held in 'domain'. */

Source from the content-addressed store, hash-verified

553 * Create or lookup a domainset based on the key held in 'domain'.
554 */
555struct domainset *
556domainset_create(const struct domainset *domain)
557{
558 struct domainset *ndomain;
559
560 /*
561 * Validate the policy. It must specify a useable policy number with
562 * only valid domains. Preferred must include the preferred domain
563 * in the mask.
564 */
565 if (domain->ds_policy <= DOMAINSET_POLICY_INVALID ||
566 domain->ds_policy > DOMAINSET_POLICY_MAX)
567 return (NULL);
568 if (domain->ds_policy == DOMAINSET_POLICY_PREFER &&
569 !DOMAINSET_ISSET(domain->ds_prefer, &domain->ds_mask))
570 return (NULL);
571 if (!DOMAINSET_SUBSET(&domainset0.ds_mask, &domain->ds_mask))
572 return (NULL);
573 ndomain = uma_zalloc(domainset_zone, M_WAITOK | M_ZERO);
574 domainset_copy(domain, ndomain);
575 return _domainset_create(ndomain, NULL);
576}
577
578/*
579 * Update thread domainset pointers.

Callers 2

cpuset_modify_domainFunction · 0.85
sysctl_handle_domainsetFunction · 0.85

Calls 3

domainset_copyFunction · 0.85
_domainset_createFunction · 0.85
uma_zallocFunction · 0.50

Tested by

no test coverage detected