Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153700
b: refs/heads/master
c: 82e12fe
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and J. Bruce Fields committed Jun 18, 2009
1 parent 9eb486e commit 84c237c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 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: 5d77ddfbcb062f2617ea79d7a371b4bc78f28417
refs/heads/master: 82e12fe9244ff653f703722a8937b595e10e71f4
14 changes: 9 additions & 5 deletions trunk/fs/nfsd/nfsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,14 @@ static struct file_operations pool_stats_operations = {
static ssize_t write_svc(struct file *file, char *buf, size_t size)
{
struct nfsctl_svc *data;
int err;
if (size < sizeof(*data))
return -EINVAL;
data = (struct nfsctl_svc*) buf;
return nfsd_svc(data->svc_port, data->svc_nthreads);
err = nfsd_svc(data->svc_port, data->svc_nthreads);
if (err < 0)
return err;
return 0;
}

/**
Expand Down Expand Up @@ -692,12 +696,12 @@ static ssize_t write_threads(struct file *file, char *buf, size_t size)
if (newthreads < 0)
return -EINVAL;
rv = nfsd_svc(NFS_PORT, newthreads);
if (rv)
if (rv < 0)
return rv;
}
} else
rv = nfsd_nrthreads();

return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%d\n",
nfsd_nrthreads());
return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%d\n", rv);
}

/**
Expand Down
6 changes: 6 additions & 0 deletions trunk/fs/nfsd/nfssvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,12 @@ nfsd_svc(unsigned short port, int nrservs)
goto failure;

error = svc_set_num_threads(nfsd_serv, NULL, nrservs);
if (error == 0)
/* We are holding a reference to nfsd_serv which
* we don't want to count in the return value,
* so subtract 1
*/
error = nfsd_serv->sv_nrthreads - 1;
failure:
svc_destroy(nfsd_serv); /* Release server */
out:
Expand Down

0 comments on commit 84c237c

Please sign in to comment.