aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-07-25 08:57:29 -0400
committerJ. Bruce Fields <bfields@redhat.com>2012-07-27 16:49:22 -0400
commit5630f7fa97e8dfa2b3c6e7370c1702180336e493 (patch)
tree1f802caf82708d926180b5dedfaf41bb0da6d2ae /fs/lockd
parent5ccb0066f2d561549cc4d73d7f56b4ce3ca7a8a1 (diff)
Lockd: move grace period management from lockd() to per-net functions
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/svc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 68271c206bdc..31a63f87b806 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -128,8 +128,6 @@ lockd(void *vrqstp)
128{ 128{
129 int err = 0, preverr = 0; 129 int err = 0, preverr = 0;
130 struct svc_rqst *rqstp = vrqstp; 130 struct svc_rqst *rqstp = vrqstp;
131 struct net *net = &init_net;
132 struct lockd_net *ln = net_generic(net, lockd_net_id);
133 131
134 /* try_to_freeze() is called from svc_recv() */ 132 /* try_to_freeze() is called from svc_recv() */
135 set_freezable(); 133 set_freezable();
@@ -143,8 +141,6 @@ lockd(void *vrqstp)
143 nlm_timeout = LOCKD_DFLT_TIMEO; 141 nlm_timeout = LOCKD_DFLT_TIMEO;
144 nlmsvc_timeout = nlm_timeout * HZ; 142 nlmsvc_timeout = nlm_timeout * HZ;
145 143
146 set_grace_period(net);
147
148 /* 144 /*
149 * The main request loop. We don't terminate until the last 145 * The main request loop. We don't terminate until the last
150 * NFS mount or NFS daemon has gone away. 146 * NFS mount or NFS daemon has gone away.
@@ -190,8 +186,6 @@ lockd(void *vrqstp)
190 svc_process(rqstp); 186 svc_process(rqstp);
191 } 187 }
192 flush_signals(current); 188 flush_signals(current);
193 cancel_delayed_work_sync(&ln->grace_period_end);
194 locks_end_grace(&ln->lockd_manager);
195 if (nlmsvc_ops) 189 if (nlmsvc_ops)
196 nlmsvc_invalidate_all(); 190 nlmsvc_invalidate_all();
197 nlm_shutdown_hosts(); 191 nlm_shutdown_hosts();
@@ -272,6 +266,7 @@ static int lockd_up_net(struct svc_serv *serv, struct net *net)
272 error = make_socks(serv, net); 266 error = make_socks(serv, net);
273 if (error < 0) 267 if (error < 0)
274 goto err_socks; 268 goto err_socks;
269 set_grace_period(net);
275 dprintk("lockd_up_net: per-net data created; net=%p\n", net); 270 dprintk("lockd_up_net: per-net data created; net=%p\n", net);
276 return 0; 271 return 0;
277 272
@@ -289,6 +284,8 @@ static void lockd_down_net(struct svc_serv *serv, struct net *net)
289 if (ln->nlmsvc_users) { 284 if (ln->nlmsvc_users) {
290 if (--ln->nlmsvc_users == 0) { 285 if (--ln->nlmsvc_users == 0) {
291 nlm_shutdown_hosts_net(net); 286 nlm_shutdown_hosts_net(net);
287 cancel_delayed_work_sync(&ln->grace_period_end);
288 locks_end_grace(&ln->lockd_manager);
292 svc_shutdown_net(serv, net); 289 svc_shutdown_net(serv, net);
293 dprintk("lockd_down_net: per-net data destroyed; net=%p\n", net); 290 dprintk("lockd_down_net: per-net data destroyed; net=%p\n", net);
294 } 291 }