aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/mon.c
diff options
context:
space:
mode:
authorOlaf Kirch <okir@suse.de>2006-10-04 05:15:51 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 10:55:16 -0400
commit977faf392fc898407554bbe7338d57b29e3660cf (patch)
tree9bd611c100e3e2d1aa336010124cda0155183bb8 /fs/lockd/mon.c
parent7b2b1fee30df7e2165525cd03f7d1d01a3a56794 (diff)
[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)
74 int status; 74 int status;
75 75
76 dprintk("lockd: nsm_monitor(%s)\n", host->h_name); 76 dprintk("lockd: nsm_monitor(%s)\n", host->h_name);
77 if (host->h_monitored)
78 return 0;
77 79
78 status = nsm_mon_unmon(host, SM_MON, &res); 80 status = nsm_mon_unmon(host, SM_MON, &res);
79 81
@@ -91,15 +93,18 @@ int
91nsm_unmonitor(struct nlm_host *host) 93nsm_unmonitor(struct nlm_host *host)
92{ 94{
93 struct nsm_res res; 95 struct nsm_res res;
94 int status; 96 int status = 0;
95 97
96 dprintk("lockd: nsm_unmonitor(%s)\n", host->h_name); 98 dprintk("lockd: nsm_unmonitor(%s)\n", host->h_name);
97 99 if (!host->h_monitored)
98 status = nsm_mon_unmon(host, SM_UNMON, &res); 100 return 0;
99 if (status < 0) 101 host->h_monitored = 0;
100 printk(KERN_NOTICE "lockd: cannot unmonitor %s\n", host->h_name); 102
101 else 103 if (!host->h_killed) {
102 host->h_monitored = 0; 104 status = nsm_mon_unmon(host, SM_UNMON, &res);
105 if (status < 0)
106 printk(KERN_NOTICE "lockd: cannot unmonitor %s\n", host->h_name);
107 }
103 return status; 108 return status;
104} 109}
105 110