From 84d90ac96e9b78868e7db955d292584a1f3caa1f Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 10 Jul 2015 16:04:27 +0000 Subject: [PATCH] scst.h: Backport more cpumask.h functions git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6413 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scst/include/scst.h b/scst/include/scst.h index c95b6e143..6322aa5da 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -165,6 +165,20 @@ typedef cpumask_t cpumask_var_t[1]; #define nr_cpumask_bits NR_CPUS #endif +#ifdef CONFIG_CPUMASK_OFFSTACK +bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags); +void free_cpumask_var(cpumask_var_t mask); +#else +static inline void free_cpumask_var(cpumask_var_t mask) +{ +} + +static inline bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags) +{ + return true; +} +#endif + /* verify cpu argument to cpumask_* operators */ static inline unsigned int cpumask_check(unsigned int cpu) { @@ -201,6 +215,16 @@ static inline unsigned int cpumask_next(int n, const cpumask_t *srcp) (cpu) = cpumask_next((cpu), (mask)), \ (cpu) < nr_cpu_ids;) +/** + * cpumask_set_cpu - set a cpu in a cpumask + * @cpu: cpu number (< nr_cpu_ids) + * @dstp: the cpumask pointer + */ +static inline void cpumask_set_cpu(unsigned int cpu, cpumask_t *dstp) +{ + set_bit(cpu, cpumask_bits(dstp)); +} + /** * cpumask_copy - *dstp = *srcp * @dstp: the result