Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266578AbUIXCJ7 (ORCPT ); Thu, 23 Sep 2004 22:09:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266705AbUIWUlA (ORCPT ); Thu, 23 Sep 2004 16:41:00 -0400 Received: from baikonur.stro.at ([213.239.196.228]:59578 "EHLO baikonur.stro.at") by vger.kernel.org with ESMTP id S266689AbUIWUZL (ORCPT ); Thu, 23 Sep 2004 16:25:11 -0400 Subject: [patch 06/26] char/ftape-io: replace schedule_timeout() with msleep_interruptible() To: akpm@digeo.com Cc: linux-kernel@vger.kernel.org, janitor@sternwelten.at, nacc@us.ibm.com From: janitor@sternwelten.at Date: Thu, 23 Sep 2004 22:25:10 +0200 Message-ID: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1935 Lines: 59 Any comments would be appreciated. Description: Use msleep_interruptible() instead of schedule_timeout() to guarantee the task delays as expected. In this case, this allowed for the removal of the entire do-while. Signed-off-by: Nishanth Aravamudan --- linux-2.6.9-rc2-bk7-max/drivers/char/ftape/lowlevel/ftape-io.c | 20 +++------- 1 files changed, 7 insertions(+), 13 deletions(-) diff -puN drivers/char/ftape/lowlevel/ftape-io.c~msleep_interruptible-drivers_char_ftape-io drivers/char/ftape/lowlevel/ftape-io.c --- linux-2.6.9-rc2-bk7/drivers/char/ftape/lowlevel/ftape-io.c~msleep_interruptible-drivers_char_ftape-io 2004-09-21 22:49:10.000000000 +0200 +++ linux-2.6.9-rc2-bk7-max/drivers/char/ftape/lowlevel/ftape-io.c 2004-09-21 22:49:48.000000000 +0200 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -96,19 +97,12 @@ void ftape_sleep(unsigned int time) timeout = ticks; save_flags(flags); sti(); - set_current_state(TASK_INTERRUPTIBLE); - do { - /* Mmm. Isn't current->blocked == 0xffffffff ? - */ - if (signal_pending(current)) { - TRACE(ft_t_err, - "awoken by non-blocked signal :-("); - break; /* exit on signal */ - } - while (current->state != TASK_RUNNING) { - timeout = schedule_timeout(timeout); - } - } while (timeout); + msleep_interruptible(jiffies_to_msecs(timeout)); + /* Mmm. Isn't current->blocked == 0xffffffff ? + */ + if (signal_pending(current)) { + TRACE(ft_t_err, "awoken by non-blocked signal :-("); + } restore_flags(flags); } TRACE_EXIT; _ - 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/