summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfsctl.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-03-21 14:52:08 +0100
committerJ. Bruce Fields <bfields@redhat.com>2012-03-26 17:49:48 +0200
commit813fd320c16691eac508fe350b4ee7362c6c4a56 (patch)
tree3ec14685fb13b2f5fba6ed1ce78e5e6bdb7c173e /fs/nfsd/nfsctl.c
parentnfsd: add the infrastructure to handle the cld upcall (diff)
downloadlinux-813fd320c16691eac508fe350b4ee7362c6c4a56.tar.xz
linux-813fd320c16691eac508fe350b4ee7362c6c4a56.zip
nfsd: add notifier to handle mount/unmount of rpc_pipefs sb
In the event that rpc_pipefs isn't mounted when nfsd starts, we must register a notifier to handle creating the dentry once it is mounted, and to remove the dentry on unmount. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfsctl.c')
-rw-r--r--fs/nfsd/nfsctl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 141197e04703..dee6c1bb9ba8 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -13,6 +13,7 @@
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/gss_api.h>
#include <linux/sunrpc/gss_krb5_enctypes.h>
+#include <linux/sunrpc/rpc_pipe_fs.h>
#include <linux/module.h>
#include "idmap.h"
@@ -1136,9 +1137,12 @@ static int __init init_nfsd(void)
int retval;
printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n");
+ retval = rpc_pipefs_notifier_register(&nfsd4_cld_block);
+ if (retval)
+ return retval;
retval = register_pernet_subsys(&nfsd_net_ops);
if (retval < 0)
- return retval;
+ goto out_unregister_notifier;
retval = nfsd4_init_slabs();
if (retval)
goto out_unregister_pernet;
@@ -1181,6 +1185,8 @@ out_free_slabs:
nfsd4_free_slabs();
out_unregister_pernet:
unregister_pernet_subsys(&nfsd_net_ops);
+out_unregister_notifier:
+ rpc_pipefs_notifier_unregister(&nfsd4_cld_block);
return retval;
}
@@ -1197,6 +1203,7 @@ static void __exit exit_nfsd(void)
nfsd_fault_inject_cleanup();
unregister_filesystem(&nfsd_fs_type);
unregister_pernet_subsys(&nfsd_net_ops);
+ rpc_pipefs_notifier_unregister(&nfsd4_cld_block);
}
MODULE_AUTHOR("Olaf Kirch <okir@monad.swb.de>");