提交 9a24ab57 编写于 作者: G Greg Banks 提交者: Linus Torvalds

[PATCH] knfsd: add svc_get

add svc_get() for those occasions when we need to temporarily bump up
svc_serv->sv_nrthreads as a pseudo refcount.
Signed-off-by: NGreg Banks <gnb@melbourne.sgi.com>
Signed-off-by: NNeil Brown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 3262c816
......@@ -200,7 +200,7 @@ int nfsd_create_serv(void)
int err = 0;
lock_kernel();
if (nfsd_serv) {
nfsd_serv->sv_nrthreads++;
svc_get(nfsd_serv);
unlock_kernel();
return 0;
}
......
......@@ -70,6 +70,17 @@ struct svc_serv {
*/
};
/*
* We use sv_nrthreads as a reference count. svc_destroy() drops
* this refcount, so we need to bump it up around operations that
* change the number of threads. Horrible, but there it is.
* Should be called with the BKL held.
*/
static inline void svc_get(struct svc_serv *serv)
{
serv->sv_nrthreads++;
}
/*
* Maximum payload size supported by a kernel RPC server.
* This is use to determine the max number of pages nfsd is
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册