Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206440
b: refs/heads/master
c: ac77efb
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Layton authored and J. Bruce Fields committed Jul 23, 2010
1 parent 23abfc8 commit d182242
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 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: 628b368728e23188ac41b3f00411b02be8e697f1
refs/heads/master: ac77efbe2b4d2a1e571a4f1e5b6e47de72a7d737
10 changes: 0 additions & 10 deletions trunk/fs/nfsd/nfsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,15 +949,8 @@ static ssize_t __write_ports_addfd(char *buf)
if (err != 0)
return err;

err = lockd_up();
if (err != 0) {
svc_destroy(nfsd_serv);
return err;
}

err = svc_addsock(nfsd_serv, fd, buf, SIMPLE_TRANSACTION_LIMIT);
if (err < 0) {
lockd_down();
svc_destroy(nfsd_serv);
return err;
}
Expand All @@ -982,9 +975,6 @@ static ssize_t __write_ports_delfd(char *buf)
if (nfsd_serv != NULL)
len = svc_sock_names(nfsd_serv, buf,
SIMPLE_TRANSACTION_LIMIT, toclose);
if (len >= 0)
lockd_down();

kfree(toclose);
return len;
}
Expand Down
25 changes: 14 additions & 11 deletions trunk/fs/nfsd/nfssvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,16 @@ static int nfsd_startup(unsigned short port, int nrservs)
{
int ret;

ret = lockd_up();
if (ret)
return ret;
ret = nfs4_state_start();
if (ret)
goto out_lockd;
nfsd_up = true;
return 0;
out_lockd:
lockd_down();
return ret;
}

Expand All @@ -201,16 +209,14 @@ static void nfsd_shutdown(void)
*/
if (!nfsd_up)
return;
lockd_down();
nfs4_state_shutdown();
nfsd_up = false;
}

static void nfsd_last_thread(struct svc_serv *serv)
{
/* When last nfsd thread exits we need to do some clean-up */
struct svc_xprt *xprt;
list_for_each_entry(xprt, &serv->sv_permsocks, xpt_list)
lockd_down();
nfsd_serv = NULL;
nfsd_racache_shutdown();
nfsd_shutdown();
Expand Down Expand Up @@ -310,19 +316,11 @@ static int nfsd_init_socks(int port)
if (error < 0)
return error;

error = lockd_up();
if (error < 0)
return error;

error = svc_create_xprt(nfsd_serv, "tcp", PF_INET, port,
SVC_SOCK_DEFAULTS);
if (error < 0)
return error;

error = lockd_up();
if (error < 0)
return error;

return 0;
}

Expand Down Expand Up @@ -400,6 +398,11 @@ int nfsd_set_nrthreads(int n, int *nthreads)
return err;
}

/*
* Adjust the number of threads and return the new number of threads.
* This is also the function that starts the server if necessary, if
* this is the first time nrservs is nonzero.
*/
int
nfsd_svc(unsigned short port, int nrservs)
{
Expand Down

0 comments on commit d182242

Please sign in to comment.