Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61546
b: refs/heads/master
c: e7cd8a7
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Jul 19, 2007
1 parent 0f7e8b6 commit 6dc6d36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 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: f4a3a7d60c9c9a961e4c970f6eb41dd1c9d3ec21
refs/heads/master: e7cd8a722745a01bcfac4d4a52d53391d177da20
21 changes: 9 additions & 12 deletions trunk/kernel/power/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ static void cancel_freezing(struct task_struct *p)
}
}

static unsigned int try_to_freeze_tasks(int freeze_user_space)
static int try_to_freeze_tasks(int freeze_user_space)
{
struct task_struct *g, *p;
unsigned long end_time;
Expand Down Expand Up @@ -176,28 +176,25 @@ static unsigned int try_to_freeze_tasks(int freeze_user_space)
read_unlock(&tasklist_lock);
}

return todo;
return todo ? -EBUSY : 0;
}

/**
* freeze_processes - tell processes to enter the refrigerator
*
* Returns 0 on success, or the number of processes that didn't freeze,
* although they were told to.
*/
int freeze_processes(void)
{
unsigned int nr_unfrozen;
int error;

printk("Stopping tasks ... ");
nr_unfrozen = try_to_freeze_tasks(FREEZER_USER_SPACE);
if (nr_unfrozen)
return nr_unfrozen;
error = try_to_freeze_tasks(FREEZER_USER_SPACE);
if (error)
return error;

sys_sync();
nr_unfrozen = try_to_freeze_tasks(FREEZER_KERNEL_THREADS);
if (nr_unfrozen)
return nr_unfrozen;
error = try_to_freeze_tasks(FREEZER_KERNEL_THREADS);
if (error)
return error;

printk("done.\n");
BUG_ON(in_atomic());
Expand Down

0 comments on commit 6dc6d36

Please sign in to comment.