linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: okir@monad.swb.de, matthew@wil.cx
Cc: linux-fsdevel@vger.kernel.org, kernel-janitors@lists.osdl.org
Subject: [PATCH] fs/clntlock: remove sleep_on*() usage
Date: Wed, 26 Jan 2005 11:40:57 -0800	[thread overview]
Message-ID: <20050126194057.GE3593@us.ibm.com> (raw)

Hi,

Please consider applying.

Description: 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 <nacc@us.ibm.com>

--- 2.6.11-rc2-kj-v/fs/lockd/clntlock.c	2005-01-24 09:28:16.000000000 -0800
+++ 2.6.11-rc2-kj/fs/lockd/clntlock.c	2005-01-26 10:45:52.000000000 -0800
@@ -14,6 +14,7 @@
 #include <linux/sunrpc/svc.h>
 #include <linux/lockd/lockd.h>
 #include <linux/smp_lock.h>
+#include <linux/wait.h>
 
 #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) {

                 reply	other threads:[~2005-01-26 19:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050126194057.GE3593@us.ibm.com \
    --to=nacc@us.ibm.com \
    --cc=kernel-janitors@lists.osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=okir@monad.swb.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).