SUNRPC: new svc_bind() routine introduced
[pandora-kernel.git] / fs / lockd / svc.c
index f49b9af..b7e92ed 100644 (file)
@@ -295,11 +295,10 @@ static void lockd_down_net(struct net *net)
 /*
  * Bring up the lockd process if it's not already up.
  */
-int lockd_up(void)
+int lockd_up(struct net *net)
 {
        struct svc_serv *serv;
        int             error = 0;
-       struct net *net = current->nsproxy->net_ns;
 
        mutex_lock(&nlmsvc_mutex);
        /*
@@ -325,6 +324,12 @@ int lockd_up(void)
                goto out;
        }
 
+       error = svc_bind(serv, net);
+       if (error < 0) {
+               printk(KERN_WARNING "lockd_up: bind service failed\n");
+               goto destroy_and_out;
+       }
+
        error = make_socks(serv, net);
        if (error < 0)
                goto destroy_and_out;
@@ -378,12 +383,12 @@ EXPORT_SYMBOL_GPL(lockd_up);
  * Decrement the user count and bring down lockd if we're the last.
  */
 void
-lockd_down(void)
+lockd_down(struct net *net)
 {
        mutex_lock(&nlmsvc_mutex);
        if (nlmsvc_users) {
                if (--nlmsvc_users) {
-                       lockd_down_net(current->nsproxy->net_ns);
+                       lockd_down_net(net);
                        goto out;
                }
        } else {