diff options
author | bz <bz@FreeBSD.org> | 2008-07-07 20:45:55 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2008-07-07 20:45:55 +0000 |
commit | cf63123d06c300ee1a5cb8cf86aca4dfea8e1109 (patch) | |
tree | fc7a38aad8688b7e98fca41a7d0fe84985153668 /sys/kern/kern_cpuset.c | |
parent | 1c800dbdb5e15c6385c702e7e6e78199ef26b790 (diff) | |
download | FreeBSD-src-cf63123d06c300ee1a5cb8cf86aca4dfea8e1109.zip FreeBSD-src-cf63123d06c300ee1a5cb8cf86aca4dfea8e1109.tar.gz |
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.
Diffstat (limited to 'sys/kern/kern_cpuset.c')
-rw-r--r-- | sys/kern/kern_cpuset.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c index 8c434fd..ee27a0b 100644 --- a/sys/kern/kern_cpuset.c +++ b/sys/kern/kern_cpuset.c @@ -115,6 +115,38 @@ cpuset_ref(struct cpuset *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. */ void @@ -315,38 +347,6 @@ out: } /* - * 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. * * For WHICH_PID and WHICH_TID return a locked proc and valid proc/tid. Also |