提交 dbf9b5d7 编写于 作者: S Stanislav Kinsbursky 提交者: J. Bruce Fields

LockD: use existing per-net data function on service creation

This patch also replaces svc_rpcb_setup() with svc_bind().
Signed-off-by: NStanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 4db77695
...@@ -259,9 +259,9 @@ static int lockd_up_net(struct svc_serv *serv, struct net *net) ...@@ -259,9 +259,9 @@ static int lockd_up_net(struct svc_serv *serv, struct net *net)
if (ln->nlmsvc_users++) if (ln->nlmsvc_users++)
return 0; return 0;
error = svc_rpcb_setup(serv, net); error = svc_bind(serv, net);
if (error) if (error)
goto err_rpcb; goto err_bind;
error = make_socks(serv, net); error = make_socks(serv, net);
if (error < 0) if (error < 0)
...@@ -270,7 +270,7 @@ static int lockd_up_net(struct svc_serv *serv, struct net *net) ...@@ -270,7 +270,7 @@ static int lockd_up_net(struct svc_serv *serv, struct net *net)
err_socks: err_socks:
svc_rpcb_cleanup(serv, net); svc_rpcb_cleanup(serv, net);
err_rpcb: err_bind:
ln->nlmsvc_users--; ln->nlmsvc_users--;
return error; return error;
} }
...@@ -298,7 +298,6 @@ int lockd_up(struct net *net) ...@@ -298,7 +298,6 @@ int lockd_up(struct net *net)
{ {
struct svc_serv *serv; struct svc_serv *serv;
int error = 0; int error = 0;
struct lockd_net *ln = net_generic(net, lockd_net_id);
mutex_lock(&nlmsvc_mutex); mutex_lock(&nlmsvc_mutex);
/* /*
...@@ -324,17 +323,9 @@ int lockd_up(struct net *net) ...@@ -324,17 +323,9 @@ int lockd_up(struct net *net)
goto out; goto out;
} }
error = svc_bind(serv, net); error = lockd_up_net(serv, net);
if (error < 0) {
printk(KERN_WARNING "lockd_up: bind service failed\n");
goto destroy_and_out;
}
ln->nlmsvc_users++;
error = make_socks(serv, net);
if (error < 0) if (error < 0)
goto err_start; goto err_net;
/* /*
* Create the kernel thread and wait for it to start. * Create the kernel thread and wait for it to start.
...@@ -367,7 +358,7 @@ int lockd_up(struct net *net) ...@@ -367,7 +358,7 @@ int lockd_up(struct net *net)
* Note: svc_serv structures have an initial use count of 1, * Note: svc_serv structures have an initial use count of 1,
* so we exit through here on both success and failure. * so we exit through here on both success and failure.
*/ */
destroy_and_out: err_net:
svc_destroy(serv); svc_destroy(serv);
out: out:
if (!error) if (!error)
...@@ -377,7 +368,7 @@ int lockd_up(struct net *net) ...@@ -377,7 +368,7 @@ int lockd_up(struct net *net)
err_start: err_start:
lockd_down_net(serv, net); lockd_down_net(serv, net);
goto destroy_and_out; goto err_net;
} }
EXPORT_SYMBOL_GPL(lockd_up); EXPORT_SYMBOL_GPL(lockd_up);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册