Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320401
b: refs/heads/master
c: 19f7e2c
h: refs/heads/master
i:
  320399: fda9831
v: v3
  • Loading branch information
Stanislav Kinsbursky authored and J. Bruce Fields committed Jul 25, 2012
1 parent 66f85bd commit fb13001
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 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: a007c4c3e943ecc054a806c259d95420a188754b
refs/heads/master: 19f7e2ca44dfc3c1b3f499fc46801f98d403500f
8 changes: 2 additions & 6 deletions trunk/fs/nfsd/nfsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,7 @@ static ssize_t __write_ports_addfd(char *buf)

err = svc_addsock(nfsd_serv, fd, buf, SIMPLE_TRANSACTION_LIMIT);
if (err < 0) {
if (nfsd_serv->sv_nrthreads == 1)
svc_shutdown_net(nfsd_serv, net);
svc_destroy(nfsd_serv);
nfsd_destroy(net);
return err;
}

Expand Down Expand Up @@ -744,9 +742,7 @@ static ssize_t __write_ports_addxprt(char *buf)
svc_xprt_put(xprt);
}
out_err:
if (nfsd_serv->sv_nrthreads == 1)
svc_shutdown_net(nfsd_serv, net);
svc_destroy(nfsd_serv);
nfsd_destroy(net);
return err;
}

Expand Down
9 changes: 9 additions & 0 deletions trunk/fs/nfsd/nfsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ int nfsd_set_nrthreads(int n, int *);
int nfsd_pool_stats_open(struct inode *, struct file *);
int nfsd_pool_stats_release(struct inode *, struct file *);

static inline void nfsd_destroy(struct net *net)
{
int destroy = (nfsd_serv->sv_nrthreads == 1);

if (destroy)
svc_shutdown_net(nfsd_serv, net);
svc_destroy(nfsd_serv);
}

#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
#ifdef CONFIG_NFSD_V2_ACL
extern struct svc_version nfsd_acl_version2;
Expand Down
14 changes: 3 additions & 11 deletions trunk/fs/nfsd/nfssvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,7 @@ int nfsd_set_nrthreads(int n, int *nthreads)
if (err)
break;
}

if (nfsd_serv->sv_nrthreads == 1)
svc_shutdown_net(nfsd_serv, net);
svc_destroy(nfsd_serv);

nfsd_destroy(net);
return err;
}

Expand Down Expand Up @@ -478,9 +474,7 @@ nfsd_svc(unsigned short port, int nrservs)
if (error < 0 && !nfsd_up_before)
nfsd_shutdown();
out_destroy:
if (nfsd_serv->sv_nrthreads == 1)
svc_shutdown_net(nfsd_serv, net);
svc_destroy(nfsd_serv); /* Release server */
nfsd_destroy(net); /* Release server */
out:
mutex_unlock(&nfsd_mutex);
return error;
Expand Down Expand Up @@ -682,9 +676,7 @@ int nfsd_pool_stats_release(struct inode *inode, struct file *file)

mutex_lock(&nfsd_mutex);
/* this function really, really should have been called svc_put() */
if (nfsd_serv->sv_nrthreads == 1)
svc_shutdown_net(nfsd_serv, net);
svc_destroy(nfsd_serv);
nfsd_destroy(net);
mutex_unlock(&nfsd_mutex);
return ret;
}

0 comments on commit fb13001

Please sign in to comment.