diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-03-21 09:52:08 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-03-26 11:49:48 -0400 |
commit | 813fd320c16691eac508fe350b4ee7362c6c4a56 (patch) | |
tree | 3ec14685fb13b2f5fba6ed1ce78e5e6bdb7c173e /fs/nfsd/nfsctl.c | |
parent | f3f8014862d813cca81a597c83bd1dbf0fb2b8f6 (diff) |
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.c | 9 |
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 @@ | |||
13 | #include <linux/sunrpc/clnt.h> | 13 | #include <linux/sunrpc/clnt.h> |
14 | #include <linux/sunrpc/gss_api.h> | 14 | #include <linux/sunrpc/gss_api.h> |
15 | #include <linux/sunrpc/gss_krb5_enctypes.h> | 15 | #include <linux/sunrpc/gss_krb5_enctypes.h> |
16 | #include <linux/sunrpc/rpc_pipe_fs.h> | ||
16 | #include <linux/module.h> | 17 | #include <linux/module.h> |
17 | 18 | ||
18 | #include "idmap.h" | 19 | #include "idmap.h" |
@@ -1136,9 +1137,12 @@ static int __init init_nfsd(void) | |||
1136 | int retval; | 1137 | int retval; |
1137 | printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n"); | 1138 | printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n"); |
1138 | 1139 | ||
1140 | retval = rpc_pipefs_notifier_register(&nfsd4_cld_block); | ||
1141 | if (retval) | ||
1142 | return retval; | ||
1139 | retval = register_pernet_subsys(&nfsd_net_ops); | 1143 | retval = register_pernet_subsys(&nfsd_net_ops); |
1140 | if (retval < 0) | 1144 | if (retval < 0) |
1141 | return retval; | 1145 | goto out_unregister_notifier; |
1142 | retval = nfsd4_init_slabs(); | 1146 | retval = nfsd4_init_slabs(); |
1143 | if (retval) | 1147 | if (retval) |
1144 | goto out_unregister_pernet; | 1148 | goto out_unregister_pernet; |
@@ -1181,6 +1185,8 @@ out_free_slabs: | |||
1181 | nfsd4_free_slabs(); | 1185 | nfsd4_free_slabs(); |
1182 | out_unregister_pernet: | 1186 | out_unregister_pernet: |
1183 | unregister_pernet_subsys(&nfsd_net_ops); | 1187 | unregister_pernet_subsys(&nfsd_net_ops); |
1188 | out_unregister_notifier: | ||
1189 | rpc_pipefs_notifier_unregister(&nfsd4_cld_block); | ||
1184 | return retval; | 1190 | return retval; |
1185 | } | 1191 | } |
1186 | 1192 | ||
@@ -1197,6 +1203,7 @@ static void __exit exit_nfsd(void) | |||
1197 | nfsd_fault_inject_cleanup(); | 1203 | nfsd_fault_inject_cleanup(); |
1198 | unregister_filesystem(&nfsd_fs_type); | 1204 | unregister_filesystem(&nfsd_fs_type); |
1199 | unregister_pernet_subsys(&nfsd_net_ops); | 1205 | unregister_pernet_subsys(&nfsd_net_ops); |
1206 | rpc_pipefs_notifier_unregister(&nfsd4_cld_block); | ||
1200 | } | 1207 | } |
1201 | 1208 | ||
1202 | MODULE_AUTHOR("Olaf Kirch <okir@monad.swb.de>"); | 1209 | MODULE_AUTHOR("Olaf Kirch <okir@monad.swb.de>"); |