netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: domen@coderock.org
To: davem@redhat.com
Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com
Subject: [patch 5/5] net/clnt: remove sleep_on*() usage
Date: Sun, 06 Mar 2005 23:21:21 +0100	[thread overview]
Message-ID: <20050306222121.7D8791EFA4@trashy.coderock.org> (raw)



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>
Signed-off-by: Domen Puncer <domen@coderock.org>
---


 kj-domen/net/sunrpc/clnt.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -puN net/sunrpc/clnt.c~sleep_on-net_sunrpc_clnt net/sunrpc/clnt.c
--- kj/net/sunrpc/clnt.c~sleep_on-net_sunrpc_clnt	2005-03-05 16:13:14.000000000 +0100
+++ kj-domen/net/sunrpc/clnt.c	2005-03-05 16:13:14.000000000 +0100
@@ -28,6 +28,7 @@
 #include <linux/slab.h>
 #include <linux/in.h>
 #include <linux/utsname.h>
+#include <linux/wait.h>
 
 #include <linux/sunrpc/clnt.h>
 #include <linux/workqueue.h>
@@ -222,6 +223,7 @@ out_no_clnt:
 int
 rpc_shutdown_client(struct rpc_clnt *clnt)
 {
+	DEFINE_WAIT(wait);
 	dprintk("RPC: shutting down %s client for %s, tasks=%d\n",
 			clnt->cl_protname, clnt->cl_server,
 			atomic_read(&clnt->cl_users));
@@ -231,7 +233,9 @@ rpc_shutdown_client(struct rpc_clnt *cln
 		clnt->cl_oneshot = 0;
 		clnt->cl_dead = 0;
 		rpc_killall_tasks(clnt);
-		sleep_on_timeout(&destroy_wait, 1*HZ);
+		prepare_to_wait(&destroy_wait, &wait, TASK_UNINTERRUPTIBLE);
+		schedule_timeout(HZ);
+		finish_wait(&destroy_wait, &wait);
 	}
 
 	if (atomic_read(&clnt->cl_users) < 0) {
_

                 reply	other threads:[~2005-03-06 22:21 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=20050306222121.7D8791EFA4@trashy.coderock.org \
    --to=domen@coderock.org \
    --cc=davem@redhat.com \
    --cc=nacc@us.ibm.com \
    --cc=netdev@oss.sgi.com \
    /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).