diff options
author | Jeff Layton <jlayton@kernel.org> | 2024-06-13 14:34:32 -0400 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2024-07-08 14:10:05 -0400 |
commit | 7f5c330b2620aaee668b206b8876300745c98221 (patch) | |
tree | afd0d2a95dc22198d309c086c33b323af604ca4c /fs/nfsd/nfssvc.c | |
parent | b4d8f228915f98f09974ef84ec028cbfe7a84273 (diff) |
nfsd: allow passing in array of thread counts via netlink
Now that nfsd_svc can handle an array of thread counts, fix up the
netlink threads interface to construct one from the netlink call
and pass it through so we can start a pooled server the same way we
would start a normal one.
Note that any unspecified values in the array are considered zeroes,
so it's possible to shut down a pooled server by passing in a short
array that has only zeros, or even an empty array.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfssvc.c')
-rw-r--r-- | fs/nfsd/nfssvc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 9aa23762394b..0bc8eaa5e009 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -769,8 +769,18 @@ int nfsd_set_nrthreads(int n, int *nthreads, struct net *net) &nn->nfsd_serv->sv_pools[i], nthreads[i]); if (err) - break; + goto out; } + + /* Anything undefined in array is considered to be 0 */ + for (i = n; i < nn->nfsd_serv->sv_nrpools; ++i) { + err = svc_set_num_threads(nn->nfsd_serv, + &nn->nfsd_serv->sv_pools[i], + 0); + if (err) + goto out; + } +out: return err; } |