summaryrefslogtreecommitdiffstats
path: root/fs/lockd/mon.c
diff options
context:
space:
mode:
authorOlaf Kirch2006-10-04 11:15:51 +0200
committerLinus Torvalds2006-10-04 16:55:16 +0200
commit977faf392fc898407554bbe7338d57b29e3660cf (patch)
tree9bd611c100e3e2d1aa336010124cda0155183bb8 /fs/lockd/mon.c
parent[PATCH] knfsd: knfsd: cache ipmap per TCP socket (diff)
downloadkernel-qcow2-linux-977faf392fc898407554bbe7338d57b29e3660cf.tar.gz
kernel-qcow2-linux-977faf392fc898407554bbe7338d57b29e3660cf.tar.xz
kernel-qcow2-linux-977faf392fc898407554bbe7338d57b29e3660cf.zip
[PATCH] knfsd: hide use of lockd's h_monitored flag
This patch moves all checks of the h_monitored flag into the nsm_monitor/unmonitor functions. A subsequent patch will replace the mechanism by which we mark a host as being monitored. There is still one occurence of h_monitored outside of mon.c and that is in clntlock.c where we respond to a reboot. The subsequent patch will modify this too. Signed-off-by: Olaf Kirch <okir@suse.de> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/lockd/mon.c')
-rw-r--r--fs/lockd/mon.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index a816b920d431..e02a1a4dfced 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -74,6 +74,8 @@ nsm_monitor(struct nlm_host *host)
int status;
dprintk("lockd: nsm_monitor(%s)\n", host->h_name);
+ if (host->h_monitored)
+ return 0;
status = nsm_mon_unmon(host, SM_MON, &res);
@@ -91,15 +93,18 @@ int
nsm_unmonitor(struct nlm_host *host)
{
struct nsm_res res;
- int status;
+ int status = 0;
dprintk("lockd: nsm_unmonitor(%s)\n", host->h_name);
-
- status = nsm_mon_unmon(host, SM_UNMON, &res);
- if (status < 0)
- printk(KERN_NOTICE "lockd: cannot unmonitor %s\n", host->h_name);
- else
- host->h_monitored = 0;
+ if (!host->h_monitored)
+ return 0;
+ host->h_monitored = 0;
+
+ if (!host->h_killed) {
+ status = nsm_mon_unmon(host, SM_UNMON, &res);
+ if (status < 0)
+ printk(KERN_NOTICE "lockd: cannot unmonitor %s\n", host->h_name);
+ }
return status;
}