Thread (1 message) 1 message, 1 author, 2004-02-09

[PATCH][RFC] sleep_on fixes for lockd

DORMANTno replies

From: Christoph Hellwig <hch@lst.de>
Date: 2004-02-09 11:38:31
Also in: linux-nfs

Here's another interesting one for you, this time in lockd:

nlmclnt_grace_wait() is completetly unused, removed.

nlmclnt_call() uses sleep_on_interruptible, but doesn't actually check
for signals, I've fixed it to use wait_event_interruptible and check
for signals, but again I'd prefer someone knowledgeable to take look
at what this actually was intended to do..

--- 1.8/fs/lockd/clntproc.c	Fri Feb  7 21:25:20 2003
+++ edited/fs/lockd/clntproc.c	Sat Feb  7 15:58:42 2004
@@ -195,19 +195,6 @@
 }
 
 /*
- * Wait while server is in grace period
- */
-static inline int
-nlmclnt_grace_wait(struct nlm_host *host)
-{
-	if (!host->h_reclaiming)
-		interruptible_sleep_on_timeout(&host->h_gracewait, 10*HZ);
-	else
-		interruptible_sleep_on(&host->h_gracewait);
-	return signalled()? -ERESTARTSYS : 0;
-}
-
-/*
  * Allocate an NLM RPC call struct
  */
 struct nlm_rqst *
@@ -254,8 +241,11 @@
 		msg.rpc_cred = nfs_file_cred(filp);
 
 	do {
-		if (host->h_reclaiming && !argp->reclaim) {
-			interruptible_sleep_on(&host->h_gracewait);
+		status = wait_event_interruptible(host->h_gracewait,
+				(!host->h_reclaiming || argp->reclaim));
+		if (status) {
+			if (signalled())
+				return -EINTR;
 			continue;
 		}
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help