lkml.org 
[lkml]   [2011]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 05/16] freezer: rename thaw_process() to __thaw_task() and simplify the implementation
On Fri, Aug 19, 2011 at 04:16:11PM +0200, Tejun Heo wrote:
> thaw_process() now has only internal users - system and cgroup
> freezers. Remove the unnecessary return value, rename, unexport and
> collapse __thaw_process() into it. This will help further updates to
> the freezer code.

<snip>

> diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
> index e691818..e7fa0ec 100644
> --- a/kernel/cgroup_freezer.c
> +++ b/kernel/cgroup_freezer.c

<snip (Looks fine)>

> diff --git a/kernel/freezer.c b/kernel/freezer.c
> index 656492c..f5db7fd 100644
> --- a/kernel/freezer.c
> +++ b/kernel/freezer.c

<snip>

> @@ -164,15 +154,17 @@ static int __thaw_process(struct task_struct *p)
> * refrigerator() could call frozen_process(), in which case the task would be
> * frozen and no one would thaw it.
> */
> -int thaw_process(struct task_struct *p)
> +void __thaw_task(struct task_struct *p)
> {
> + bool was_frozen;
> +
> task_lock(p);
> - if (__thaw_process(p) == 1) {
> - task_unlock(p);
> - wake_up_process(p);
> - return 1;
> - }
> + if ((was_frozen = frozen(p)))

Style nit: I think this form is preferable:

was_frozen = frozen(p);
if (was_frozen)
...

However I know Rafael already pulled this so I don't
know if it's worth bothering.

Cheers,
-Matt Helsley


\
 
 \ /
  Last update: 2011-08-24 04:31    [W:2.459 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site