SUNRPC: new svc_bind() routine introduced
[pandora-kernel.git] / fs / nfsd / nfssvc.c
index 28dfad3..0762f3c 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/module.h>
 #include <linux/fs_struct.h>
 #include <linux/swap.h>
+#include <linux/nsproxy.h>
 
 #include <linux/sunrpc/stats.h>
 #include <linux/sunrpc/svcsock.h>
@@ -220,7 +221,7 @@ static int nfsd_startup(unsigned short port, int nrservs)
        ret = nfsd_init_socks(port);
        if (ret)
                goto out_racache;
-       ret = lockd_up();
+       ret = lockd_up(&init_net);
        if (ret)
                goto out_racache;
        ret = nfs4_state_start();
@@ -229,7 +230,7 @@ static int nfsd_startup(unsigned short port, int nrservs)
        nfsd_up = true;
        return 0;
 out_lockd:
-       lockd_down();
+       lockd_down(&init_net);
 out_racache:
        nfsd_racache_shutdown();
        return ret;
@@ -246,7 +247,7 @@ static void nfsd_shutdown(void)
        if (!nfsd_up)
                return;
        nfs4_state_shutdown();
-       lockd_down();
+       lockd_down(&init_net);
        nfsd_racache_shutdown();
        nfsd_up = false;
 }
@@ -261,7 +262,7 @@ static void nfsd_last_thread(struct svc_serv *serv, struct net *net)
 
        printk(KERN_WARNING "nfsd: last server has exited, flushing export "
                            "cache\n");
-       nfsd_export_flush();
+       nfsd_export_flush(net);
 }
 
 void nfsd_reset_versions(void)
@@ -330,6 +331,8 @@ static int nfsd_get_default_max_blksize(void)
 
 int nfsd_create_serv(void)
 {
+       int error;
+
        WARN_ON(!mutex_is_locked(&nfsd_mutex));
        if (nfsd_serv) {
                svc_get(nfsd_serv);
@@ -343,6 +346,12 @@ int nfsd_create_serv(void)
        if (nfsd_serv == NULL)
                return -ENOMEM;
 
+       error = svc_bind(nfsd_serv, current->nsproxy->net_ns);
+       if (error < 0) {
+               svc_destroy(nfsd_serv);
+               return error;
+       }
+
        set_max_drc();
        do_gettimeofday(&nfssvc_boot);          /* record boot time */
        return 0;