Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 136475
b: refs/heads/master
c: 68564a4
h: refs/heads/master
i:
  136473: bdc94b0
  136471: 569f52f
v: v3
  • Loading branch information
Rusty Russell authored and Mike Travis committed Jan 16, 2009
1 parent 7aeb8ec commit 1fbcb25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c99dbbe9f8f6b3e9383e64710217e873431d1c31
refs/heads/master: 68564a46976017496c2227660930d81240f82355
14 changes: 4 additions & 10 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -991,8 +991,8 @@ static void do_work_for_cpu(struct work_struct *w)
* @fn: the function to run
* @arg: the function arg
*
* This will return -EINVAL in the cpu is not online, or the return value
* of @fn otherwise.
* This will return the value @fn returns.
* It is up to the caller to ensure that the cpu doesn't go offline.
*/
long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg)
{
Expand All @@ -1001,14 +1001,8 @@ long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg)
INIT_WORK(&wfc.work, do_work_for_cpu);
wfc.fn = fn;
wfc.arg = arg;
get_online_cpus();
if (unlikely(!cpu_online(cpu)))
wfc.ret = -EINVAL;
else {
schedule_work_on(cpu, &wfc.work);
flush_work(&wfc.work);
}
put_online_cpus();
schedule_work_on(cpu, &wfc.work);
flush_work(&wfc.work);

return wfc.ret;
}
Expand Down

0 comments on commit 1fbcb25

Please sign in to comment.