From mboxrd@z Thu Jan 1 00:00:00 1970 From: domen@coderock.org Subject: [patch 6/7] fs/clntlock: remove sleep_on*() usage Date: Mon, 20 Jun 2005 23:57:05 +0200 Message-ID: <20050620215704.589109000@nd47.coderock.org> Cc: linux-fsdevel@vger.kernel.org, Nishanth Aravamudan , domen@coderock.org Return-path: Received: from coderock.org ([193.77.147.115]:24219 "EHLO trashy.coderock.org") by vger.kernel.org with ESMTP id S261958AbVFTWFR (ORCPT ); Mon, 20 Jun 2005 18:05:17 -0400 To: viro@parcelfarce.linux.theplanet.co.uk Content-Disposition: inline; filename=sleep_on-fs_lockd_clntlock.patch Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org From: Nishanth Aravamudan Directly use wait-queues instead of the deprecated sleep_on_timeout(). Since the sleep in this function is unconditional, wait_event_timeout() does not appear to be appropriate. Patch is compile-tested. Signed-off-by: Nishanth Aravamudan Signed-off-by: Domen Puncer --- clntlock.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: quilt/fs/lockd/clntlock.c =================================================================== --- quilt.orig/fs/lockd/clntlock.c +++ quilt/fs/lockd/clntlock.c @@ -14,6 +14,7 @@ #include #include #include +#include #define NLMDBG_FACILITY NLMDBG_CLIENT @@ -47,6 +48,7 @@ static struct nlm_wait * nlm_blocked; int nlmclnt_block(struct nlm_host *host, struct file_lock *fl, u32 *statp) { + DEFINE_WAIT(wait); struct nlm_wait block, **head; int err; u32 pstate; @@ -69,7 +71,9 @@ nlmclnt_block(struct nlm_host *host, str * a 1 minute timeout would do. See the comment before * nlmclnt_lock for an explanation. */ - sleep_on_timeout(&block.b_wait, 30*HZ); + prepare_to_wait(&block.b_wait, &wait, TASK_UNINTERRUPTIBLE); + schedule_timeout(30*HZ); + finish_wait(&block.b_wait, &wait); for (head = &nlm_blocked; *head; head = &(*head)->b_next) { if (*head == &block) { --