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

Function cpuset_testupdate_domain

freebsd/kern/kern_cpuset.c:740–767  ·  view source on GitHub ↗

* Recursively check for errors that would occur from applying mask to * the tree of sets starting at 'set'. Checks for sets that would become * empty as well as RDONLY flags. */

Source from the content-addressed store, hash-verified

738 * empty as well as RDONLY flags.
739 */
740static int
741cpuset_testupdate_domain(struct cpuset *set, struct domainset *dset,
742 struct domainset *orig, int *count, int augment_mask __unused)
743{
744 struct cpuset *nset;
745 struct domainset *domain;
746 struct domainset newset;
747 int error;
748
749 mtx_assert(&cpuset_lock, MA_OWNED);
750 if (set->cs_flags & CPU_SET_RDONLY)
751 return (EPERM);
752 domain = set->cs_domain;
753 domainset_copy(domain, &newset);
754 if (!domainset_equal(domain, orig)) {
755 if (!domainset_restrict(domain, dset))
756 return (EDEADLK);
757 DOMAINSET_AND(&newset.ds_mask, &dset->ds_mask);
758 /* Count the number of domains that are changing. */
759 (*count)++;
760 }
761 error = 0;
762 LIST_FOREACH(nset, &set->cs_children, cs_siblings)
763 if ((error = cpuset_testupdate_domain(nset, &newset, domain,
764 count, 1)) != 0)
765 break;
766 return (error);
767}
768
769/*
770 * Applies the mask 'mask' without checking for empty sets or permissions.

Callers 1

cpuset_modify_domainFunction · 0.85

Calls 4

mtx_assertFunction · 0.85
domainset_copyFunction · 0.85
domainset_equalFunction · 0.85
domainset_restrictFunction · 0.85

Tested by

no test coverage detected