diff options
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r-- | kernel/cpuset.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index fa31cb9f9898..50f5dc463688 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -1818,10 +1818,23 @@ cpumask_t cpuset_cpus_allowed(struct task_struct *tsk) | |||
1818 | cpumask_t mask; | 1818 | cpumask_t mask; |
1819 | 1819 | ||
1820 | mutex_lock(&callback_mutex); | 1820 | mutex_lock(&callback_mutex); |
1821 | mask = cpuset_cpus_allowed_locked(tsk); | ||
1822 | mutex_unlock(&callback_mutex); | ||
1823 | |||
1824 | return mask; | ||
1825 | } | ||
1826 | |||
1827 | /** | ||
1828 | * cpuset_cpus_allowed_locked - return cpus_allowed mask from a tasks cpuset. | ||
1829 | * Must be called with callback_mutex held. | ||
1830 | **/ | ||
1831 | cpumask_t cpuset_cpus_allowed_locked(struct task_struct *tsk) | ||
1832 | { | ||
1833 | cpumask_t mask; | ||
1834 | |||
1821 | task_lock(tsk); | 1835 | task_lock(tsk); |
1822 | guarantee_online_cpus(task_cs(tsk), &mask); | 1836 | guarantee_online_cpus(task_cs(tsk), &mask); |
1823 | task_unlock(tsk); | 1837 | task_unlock(tsk); |
1824 | mutex_unlock(&callback_mutex); | ||
1825 | 1838 | ||
1826 | return mask; | 1839 | return mask; |
1827 | } | 1840 | } |