Re: [PATCH 05/16] freezer: rename thaw_process() to __thaw_task()and simplify the implementation

From: Matt Helsley
Date: Tue Aug 23 2011 - 22:28:42 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/