Move cpuset_refroot and cpuset_refbase functions up, grouping the
cpuset_ref* functions together. Will make it easier to read and add code without forward declarations. No functional changes.
This commit is contained in:
parent
d3fc9d46d4
commit
7a8f695a21
@ -114,6 +114,38 @@ cpuset_ref(struct cpuset *set)
|
||||
return (set);
|
||||
}
|
||||
|
||||
/*
|
||||
* Walks up the tree from 'set' to find the root. Returns the root
|
||||
* referenced.
|
||||
*/
|
||||
static struct cpuset *
|
||||
cpuset_refroot(struct cpuset *set)
|
||||
{
|
||||
|
||||
for (; set->cs_parent != NULL; set = set->cs_parent)
|
||||
if (set->cs_flags & CPU_SET_ROOT)
|
||||
break;
|
||||
cpuset_ref(set);
|
||||
|
||||
return (set);
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the first non-anonymous set starting from 'set'. Returns this set
|
||||
* referenced. May return the passed in set with an extra ref if it is
|
||||
* not anonymous.
|
||||
*/
|
||||
static struct cpuset *
|
||||
cpuset_refbase(struct cpuset *set)
|
||||
{
|
||||
|
||||
if (set->cs_id == CPUSET_INVALID)
|
||||
set = set->cs_parent;
|
||||
cpuset_ref(set);
|
||||
|
||||
return (set);
|
||||
}
|
||||
|
||||
/*
|
||||
* Release a reference in a context where it is safe to allocte.
|
||||
*/
|
||||
@ -314,38 +346,6 @@ cpuset_modify(struct cpuset *set, cpuset_t *mask)
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Walks up the tree from 'set' to find the root. Returns the root
|
||||
* referenced.
|
||||
*/
|
||||
static struct cpuset *
|
||||
cpuset_refroot(struct cpuset *set)
|
||||
{
|
||||
|
||||
for (; set->cs_parent != NULL; set = set->cs_parent)
|
||||
if (set->cs_flags & CPU_SET_ROOT)
|
||||
break;
|
||||
cpuset_ref(set);
|
||||
|
||||
return (set);
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the first non-anonymous set starting from 'set'. Returns this set
|
||||
* referenced. May return the passed in set with an extra ref if it is
|
||||
* not anonymous.
|
||||
*/
|
||||
static struct cpuset *
|
||||
cpuset_refbase(struct cpuset *set)
|
||||
{
|
||||
|
||||
if (set->cs_id == CPUSET_INVALID)
|
||||
set = set->cs_parent;
|
||||
cpuset_ref(set);
|
||||
|
||||
return (set);
|
||||
}
|
||||
|
||||
/*
|
||||
* Resolve the 'which' parameter of several cpuset apis.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user