aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfssvc.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-12-06 06:23:14 -0500
committerJ. Bruce Fields <bfields@redhat.com>2012-12-10 16:25:37 -0500
commit2c2fe2909e124c32a34dbbb3ac129112524fc540 (patch)
treec96ad5c6af2e42654be6cd69380c34401356edb8 /fs/nfsd/nfssvc.c
parent6ff50b3dea9a242b50642a703b513986bffb8ce9 (diff)
nfsd: per-net NFSd up flag introduced
This patch introduces introduces per-net "nfsd_net_up" boolean flag, which has the same purpose as general "nfsd_up" flag - skip init or shutdown of per-net resources in case of they are inited on shutted down respectively. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfssvc.c')
-rw-r--r--fs/nfsd/nfssvc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 038348bc1a09..6e17efdd8afe 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -21,6 +21,7 @@
21#include "nfsd.h" 21#include "nfsd.h"
22#include "cache.h" 22#include "cache.h"
23#include "vfs.h" 23#include "vfs.h"
24#include "netns.h"
24 25
25#define NFSDDBG_FACILITY NFSDDBG_SVC 26#define NFSDDBG_FACILITY NFSDDBG_SVC
26 27
@@ -205,8 +206,12 @@ static bool nfsd_up = false;
205 206
206static int nfsd_startup_net(struct net *net) 207static int nfsd_startup_net(struct net *net)
207{ 208{
209 struct nfsd_net *nn = net_generic(net, nfsd_net_id);
208 int ret; 210 int ret;
209 211
212 if (nn->nfsd_net_up)
213 return 0;
214
210 ret = nfsd_init_socks(net); 215 ret = nfsd_init_socks(net);
211 if (ret) 216 if (ret)
212 return ret; 217 return ret;
@@ -217,6 +222,7 @@ static int nfsd_startup_net(struct net *net)
217 if (ret) 222 if (ret)
218 goto out_lockd; 223 goto out_lockd;
219 224
225 nn->nfsd_net_up = true;
220 return 0; 226 return 0;
221 227
222out_lockd: 228out_lockd:
@@ -257,8 +263,14 @@ out_racache:
257 263
258static void nfsd_shutdown_net(struct net *net) 264static void nfsd_shutdown_net(struct net *net)
259{ 265{
266 struct nfsd_net *nn = net_generic(net, nfsd_net_id);
267
268 if (!nn->nfsd_net_up)
269 return;
270
260 nfs4_state_shutdown_net(net); 271 nfs4_state_shutdown_net(net);
261 lockd_down(net); 272 lockd_down(net);
273 nn->nfsd_net_up = false;
262} 274}
263 275
264static void nfsd_shutdown(struct net *net) 276static void nfsd_shutdown(struct net *net)