Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129955
b: refs/heads/master
c: 31ad908
h: refs/heads/master
i:
  129953: 5fb332c
  129951: 02d577e
v: v3
  • Loading branch information
Rusty Russell authored and Ingo Molnar committed Jan 19, 2009
1 parent b972539 commit 5b02744
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: c7f8562a51c2e5dcc1a00a2bdd232b9965ff960d
refs/heads/master: 31ad9081200c06ccc350625d41d1f8b2d1cef29f
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 5b02744

Please sign in to comment.