}
/*
- * write_threads - Start NFSD, or report the current number of running threads
+ * write_threads - Start NFSD, or report the configured number of threads
*
* Input:
* buf: ignored
* size: zero
* Output:
* On success: passed-in buffer filled with '\n'-terminated C
- * string numeric value representing the number of
- * running NFSD threads;
+ * string numeric value representing the configured
+ * number of NFSD threads;
* return code is the size in bytes of the string
* On error: return code is zero
*
* Output:
* On success: NFS service is started;
* passed-in buffer filled with '\n'-terminated C
- * string numeric value representing the number of
- * running NFSD threads;
+ * string numeric value representing the configured
+ * number of NFSD threads;
* return code is the size in bytes of the string
* On error: return code is zero or a negative errno value
*/
}
/*
- * write_pool_threads - Set or report the current number of threads per pool
+ * write_pool_threads - Set or report the configured number of threads per pool
*
* Input:
* buf: ignored
* Output:
* On success: passed-in buffer filled with '\n'-terminated C
* string containing integer values representing the
- * number of NFSD threads in each pool;
+ * configured number of NFSD threads in each pool;
* return code is the size in bytes of the string
* On error: return code is zero or a negative errno value
*/
}
/**
- * nfsd_nl_threads_get_doit - get the number of running threads
+ * nfsd_nl_threads_get_doit - get the maximum number of running threads
* @skb: reply buffer
* @info: netlink metadata and command arguments
*
struct svc_pool *sp = &nn->nfsd_serv->sv_pools[i];
err = nla_put_u32(skb, NFSD_A_SERVER_THREADS,
- sp->sp_nrthreads);
+ sp->sp_nrthrmax);
if (err)
goto err_unlock;
}
int nfsd_nrthreads(struct net *net)
{
- int rv = 0;
+ int i, rv = 0;
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
mutex_lock(&nfsd_mutex);
if (nn->nfsd_serv)
- rv = nn->nfsd_serv->sv_nrthreads;
+ for (i = 0; i < nn->nfsd_serv->sv_nrpools; ++i)
+ rv += nn->nfsd_serv->sv_pools[i].sp_nrthrmax;
mutex_unlock(&nfsd_mutex);
return rv;
}
if (serv)
for (i = 0; i < serv->sv_nrpools && i < n; i++)
- nthreads[i] = serv->sv_pools[i].sp_nrthreads;
+ nthreads[i] = serv->sv_pools[i].sp_nrthrmax;
return 0;
}