Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751169AbVLOWoI (ORCPT ); Thu, 15 Dec 2005 17:44:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751165AbVLOWnq (ORCPT ); Thu, 15 Dec 2005 17:43:46 -0500 Received: from anf141.internetdsl.tpnet.pl ([83.17.87.141]:19079 "EHLO anf141.internetdsl.tpnet.pl") by vger.kernel.org with ESMTP id S1751164AbVLOWno (ORCPT ); Thu, 15 Dec 2005 17:43:44 -0500 From: "Rafael J. Wysocki" To: LKML Subject: [RFC][PATCH -mm 2/2] Additional function in swapfile.c (needed for swap suspend) Date: Thu, 15 Dec 2005 23:41:37 +0100 User-Agent: KMail/1.9 Cc: Pavel Machek References: <200512152329.08537.rjw@sisk.pl> In-Reply-To: <200512152329.08537.rjw@sisk.pl> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200512152341.37617.rjw@sisk.pl> Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org This patch contains the modification that can be made to swsusp once the function defined in the previous patch has been introduced. Signed-off-by: Rafael J. Wysocki kernel/power/swsusp.c | 84 +++++++++++--------------------------------------- 1 files changed, 19 insertions(+), 65 deletions(-) Index: linux-2.6.15-rc5-mm3/kernel/power/swsusp.c =================================================================== --- linux-2.6.15-rc5-mm3.orig/kernel/power/swsusp.c 2005-12-15 22:49:49.000000000 +0100 +++ linux-2.6.15-rc5-mm3/kernel/power/swsusp.c 2005-12-15 22:50:01.000000000 +0100 @@ -104,13 +104,7 @@ * Saving part... */ -/* We memorize in swapfile_used what swap devices are used for suspension */ -#define SWAPFILE_UNUSED 0 -#define SWAPFILE_SUSPEND 1 /* This is the suspending device */ -#define SWAPFILE_IGNORED 2 /* Those are other swap devices ignored for suspension */ - -static unsigned short swapfile_used[MAX_SWAPFILES]; -static unsigned short root_swap; +static unsigned short root_swap = 0xffff; static int mark_swapfiles(swp_entry_t prev) { @@ -146,7 +140,7 @@ * devfs, since the resume code can only recognize the form /dev/hda4, * but the suspend code would see the long name.) */ -static int is_resume_device(const struct swap_info_struct *swap_info) +static inline int is_resume_device(const struct swap_info_struct *swap_info) { struct file *file = swap_info->swap_file; struct inode *inode = file->f_dentry->d_inode; @@ -157,54 +151,22 @@ static int swsusp_swap_check(void) /* This is called before saving image */ { - int i, len; - - len=strlen(resume_file); - root_swap = 0xFFFF; - - spin_lock(&swap_lock); - for (i=0; i