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

Function cpuset_testupdate

freebsd/kern/kern_cpuset.c:635–658  ·  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

633 * empty as well as RDONLY flags.
634 */
635static int
636cpuset_testupdate(struct cpuset *set, cpuset_t *mask, int augment_mask)
637{
638 struct cpuset *nset;
639 cpuset_t newmask;
640 int error;
641
642 mtx_assert(&cpuset_lock, MA_OWNED);
643 if (set->cs_flags & CPU_SET_RDONLY)
644 return (EPERM);
645 if (augment_mask) {
646 CPU_COPY(&set->cs_mask, &newmask);
647 CPU_AND(&newmask, mask);
648 } else
649 CPU_COPY(mask, &newmask);
650
651 if (CPU_EMPTY(&newmask))
652 return (EDEADLK);
653 error = 0;
654 LIST_FOREACH(nset, &set->cs_children, cs_siblings)
655 if ((error = cpuset_testupdate(nset, &newmask, 1)) != 0)
656 break;
657 return (error);
658}
659
660/*
661 * Applies the mask 'mask' without checking for empty sets or permissions.

Callers 1

cpuset_modifyFunction · 0.85

Calls 1

mtx_assertFunction · 0.85

Tested by

no test coverage detected