diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-11-24 11:05:14 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-24 11:52:42 -0500 |
commit | 96f874e26428ab5d2db681c100210c254775e154 (patch) | |
tree | e18a6f0629ef17f2344f3691c8df4692ccb875fa /include | |
parent | 0e3900e6d3b04c44737ebc505604dcd8ed30e354 (diff) |
sched: convert remaining old-style cpumask operators
Impact: Trivial API conversion
NR_CPUS -> nr_cpu_ids
cpumask_t -> struct cpumask
sizeof(cpumask_t) -> cpumask_size()
cpumask_a = cpumask_b -> cpumask_copy(&cpumask_a, &cpumask_b)
cpu_set() -> cpumask_set_cpu()
first_cpu() -> cpumask_first()
cpumask_of_cpu() -> cpumask_of()
cpus_* -> cpumask_*
There are some FIXMEs where we all archs to complete infrastructure
(patches have been sent):
cpu_coregroup_map -> cpu_coregroup_mask
node_to_cpumask* -> cpumask_of_node
There is also one FIXME where we pass an array of cpumasks to
partition_sched_domains(): this implies knowing the definition of
'struct cpumask' and the size of a cpumask. This will be fixed in a
future patch.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sched.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 1e33e2cb7f8c..4b7b0187374c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -879,7 +879,7 @@ static inline struct cpumask *sched_domain_span(struct sched_domain *sd) | |||
879 | return to_cpumask(sd->span); | 879 | return to_cpumask(sd->span); |
880 | } | 880 | } |
881 | 881 | ||
882 | extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | 882 | extern void partition_sched_domains(int ndoms_new, struct cpumask *doms_new, |
883 | struct sched_domain_attr *dattr_new); | 883 | struct sched_domain_attr *dattr_new); |
884 | extern int arch_reinit_sched_domains(void); | 884 | extern int arch_reinit_sched_domains(void); |
885 | 885 | ||
@@ -888,7 +888,7 @@ extern int arch_reinit_sched_domains(void); | |||
888 | struct sched_domain_attr; | 888 | struct sched_domain_attr; |
889 | 889 | ||
890 | static inline void | 890 | static inline void |
891 | partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | 891 | partition_sched_domains(int ndoms_new, struct cpumask *doms_new, |
892 | struct sched_domain_attr *dattr_new) | 892 | struct sched_domain_attr *dattr_new) |
893 | { | 893 | { |
894 | } | 894 | } |
@@ -970,7 +970,7 @@ struct sched_class { | |||
970 | void (*task_wake_up) (struct rq *this_rq, struct task_struct *task); | 970 | void (*task_wake_up) (struct rq *this_rq, struct task_struct *task); |
971 | 971 | ||
972 | void (*set_cpus_allowed)(struct task_struct *p, | 972 | void (*set_cpus_allowed)(struct task_struct *p, |
973 | const cpumask_t *newmask); | 973 | const struct cpumask *newmask); |
974 | 974 | ||
975 | void (*rq_online)(struct rq *rq); | 975 | void (*rq_online)(struct rq *rq); |
976 | void (*rq_offline)(struct rq *rq); | 976 | void (*rq_offline)(struct rq *rq); |
@@ -1612,12 +1612,12 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
1612 | 1612 | ||
1613 | #ifdef CONFIG_SMP | 1613 | #ifdef CONFIG_SMP |
1614 | extern int set_cpus_allowed_ptr(struct task_struct *p, | 1614 | extern int set_cpus_allowed_ptr(struct task_struct *p, |
1615 | const cpumask_t *new_mask); | 1615 | const struct cpumask *new_mask); |
1616 | #else | 1616 | #else |
1617 | static inline int set_cpus_allowed_ptr(struct task_struct *p, | 1617 | static inline int set_cpus_allowed_ptr(struct task_struct *p, |
1618 | const cpumask_t *new_mask) | 1618 | const struct cpumask *new_mask) |
1619 | { | 1619 | { |
1620 | if (!cpu_isset(0, *new_mask)) | 1620 | if (!cpumask_test_cpu(0, new_mask)) |
1621 | return -EINVAL; | 1621 | return -EINVAL; |
1622 | return 0; | 1622 | return 0; |
1623 | } | 1623 | } |
@@ -2230,8 +2230,8 @@ __trace_special(void *__tr, void *__data, | |||
2230 | } | 2230 | } |
2231 | #endif | 2231 | #endif |
2232 | 2232 | ||
2233 | extern long sched_setaffinity(pid_t pid, const cpumask_t *new_mask); | 2233 | extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask); |
2234 | extern long sched_getaffinity(pid_t pid, cpumask_t *mask); | 2234 | extern long sched_getaffinity(pid_t pid, struct cpumask *mask); |
2235 | 2235 | ||
2236 | extern int sched_mc_power_savings, sched_smt_power_savings; | 2236 | extern int sched_mc_power_savings, sched_smt_power_savings; |
2237 | 2237 | ||