Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758586Ab0LNJ41 (ORCPT ); Tue, 14 Dec 2010 04:56:27 -0500 Received: from e32.co.us.ibm.com ([32.97.110.150]:52299 "EHLO e32.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758073Ab0LNJ40 (ORCPT ); Tue, 14 Dec 2010 04:56:26 -0500 Date: Tue, 14 Dec 2010 15:24:59 +0530 From: "Suzuki K. Poulose" To: "Suzuki K. Poulose" Cc: linux-kernel@vger.kernel.org, Jeremy Fitzhardinge , Christoph Hellwig , Masami Hiramatsu , Ananth N Mavinakayanahalli , Daisuke HATAYAMA , Andi Kleen , Roland McGrath , Amerigo Wang , Linus Torvalds , KAMEZAWA Hiroyuki , KOSAKI Motohiro , Oleg Nesterov , Andrew Morton Subject: [Patch 1/21] Reuse freezable() predicate Message-ID: <20101214152459.581ec3f0@suzukikp> In-Reply-To: <20101214152259.67896960@suzukikp> References: <20101214152259.67896960@suzukikp> Organization: IBM X-Mailer: Claws Mail 3.7.6 (GTK+ 2.22.0; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1559 Lines: 56 Export the freezable() predicate. Signed-off-by: Suzuki K. Poulose --- include/linux/freezer.h | 12 ++++++++++++ kernel/power/process.c | 9 --------- 2 files changed, 12 insertions(+), 9 deletions(-) Index: linux-2.6.36-rc7/include/linux/freezer.h =================================================================== --- linux-2.6.36-rc7.orig/include/linux/freezer.h +++ linux-2.6.36-rc7/include/linux/freezer.h @@ -8,6 +8,18 @@ #ifdef CONFIG_FREEZER /* + * Check if the task is freezeable ? + */ +static inline int freezeable(struct task_struct * p) +{ + if ((p == current) || + (p->flags & PF_NOFREEZE) || + (p->exit_state != 0)) + return 0; + return 1; +} + +/* * Check if a process has been frozen */ static inline int frozen(struct task_struct *p) Index: linux-2.6.36-rc7/kernel/power/process.c =================================================================== --- linux-2.6.36-rc7.orig/kernel/power/process.c +++ linux-2.6.36-rc7/kernel/power/process.c @@ -22,15 +22,6 @@ */ #define TIMEOUT (20 * HZ) -static inline int freezeable(struct task_struct * p) -{ - if ((p == current) || - (p->flags & PF_NOFREEZE) || - (p->exit_state != 0)) - return 0; - return 1; -} - static int try_to_freeze_tasks(bool sig_only) { struct task_struct *g, *p; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/