cpumask: tsk_cpumask for accessing the struct task_struct's cpus_allowed.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 12 Mar 2009 20:35:43 +0000 (14:35 -0600)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 12 Mar 2009 04:05:44 +0000 (14:35 +1030)
This allows us to change the representation (to a dangling bitmap or
cpumask_var_t) without breaking all the callers: they can use
tsk_cpumask() now and won't see a difference as the changes roll into
linux-next.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
include/linux/sched.h

index 8c216e057c94230ea01c110b0f5bc2c28e8f9ee3..011db2f4c94c056595625d19b452adf7c6f65625 100644 (file)
@@ -1419,6 +1419,9 @@ struct task_struct {
 #endif
 };
 
+/* Future-safe accessor for struct task_struct's cpus_allowed. */
+#define tsk_cpumask(tsk) (&(tsk)->cpus_allowed)
+
 /*
  * Priority of a process goes from 0..MAX_PRIO-1, valid RT
  * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH