Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347721
b: refs/heads/master
c: bda9cac
h: refs/heads/master
i:
  347719: 10f7b00
v: v3
  • Loading branch information
Stanislav Kinsbursky authored and J. Bruce Fields committed Dec 10, 2012
1 parent 9dc77cc commit 6a419f5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9dd9845f084cda07ce00cca32a5ba8fbcbbfbcaf
refs/heads/master: bda9cac1db8ab044e9edbfe5730283016b67d451
50 changes: 34 additions & 16 deletions trunk/fs/nfsd/nfssvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,37 @@ static int nfsd_init_socks(struct net *net)

static bool nfsd_up = false;

static int nfsd_startup_generic(int nrservs)
{
int ret;

if (nfsd_up)
return 0;

/*
* Readahead param cache - will no-op if it already exists.
* (Note therefore results will be suboptimal if number of
* threads is modified after nfsd start.)
*/
ret = nfsd_racache_init(2*nrservs);
if (ret)
return ret;
ret = nfs4_state_start();
if (ret)
goto out_racache;
return 0;

out_racache:
nfsd_racache_shutdown();
return ret;
}

static void nfsd_shutdown_generic(void)
{
nfs4_state_shutdown();
nfsd_racache_shutdown();
}

static int nfsd_startup_net(struct net *net)
{
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
Expand Down Expand Up @@ -236,19 +267,9 @@ static int nfsd_startup(int nrservs, struct net *net)
{
int ret;

if (nfsd_up)
return 0;
/*
* Readahead param cache - will no-op if it already exists.
* (Note therefore results will be suboptimal if number of
* threads is modified after nfsd start.)
*/
ret = nfsd_racache_init(2*nrservs);
ret = nfsd_startup_generic(nrservs);
if (ret)
return ret;
ret = nfs4_state_start();
if (ret)
goto out_racache;
ret = nfsd_startup_net(net);
if (ret)
goto out_net;
Expand All @@ -257,9 +278,7 @@ static int nfsd_startup(int nrservs, struct net *net)
return 0;

out_net:
nfs4_state_shutdown();
out_racache:
nfsd_racache_shutdown();
nfsd_shutdown_generic();
return ret;
}

Expand All @@ -286,8 +305,7 @@ static void nfsd_shutdown(struct net *net)
if (!nfsd_up)
return;
nfsd_shutdown_net(net);
nfs4_state_shutdown();
nfsd_racache_shutdown();
nfsd_shutdown_generic();
nfsd_up = false;
}

Expand Down

0 comments on commit 6a419f5

Please sign in to comment.