Skip to content

Commit 76e6eee

Browse files
committed
cpumask: tsk_cpumask for accessing the struct task_struct's cpus_allowed.
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>
1 parent 99adcd9 commit 76e6eee

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/linux/sched.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,6 +1419,9 @@ struct task_struct {
14191419
#endif
14201420
};
14211421

1422+
/* Future-safe accessor for struct task_struct's cpus_allowed. */
1423+
#define tsk_cpumask(tsk) (&(tsk)->cpus_allowed)
1424+
14221425
/*
14231426
* Priority of a process goes from 0..MAX_PRIO-1, valid RT
14241427
* priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH

0 commit comments

Comments
 (0)