I noticed some duplicate code in init_nfsd() that could be removed with
the following patch built against linux-2.6.12-rc6. This then also adds
a call to nfsd_idmap_shutdown() for when init_nfsd() fails (I think CITI
may have already provided a patch that does likewise).
Signed-off-by: Bruce Allan <[email protected]>
--- linux-2.6.12-rc6-vanilla/fs/nfsd/nfsctl.c 2005-06-06 08:22:29.000000000 -0700
+++ linux-2.6.12-rc6/fs/nfsd/nfsctl.c 2005-06-13 21:09:50.102015288 -0700
@@ -388,6 +388,21 @@ static struct file_system_type nfsd_fs_t
.kill_sb = kill_litter_super,
};
+static void __exit exit_nfsd(void)
+{
+ nfsd_export_shutdown();
+ nfsd_cache_shutdown();
+ remove_proc_entry("fs/nfs/exports", NULL);
+ remove_proc_entry("fs/nfs", NULL);
+ nfsd_stat_shutdown();
+ nfsd_lockd_shutdown();
+#ifdef CONFIG_NFSD_V4
+ nfsd_idmap_shutdown();
+#endif /* CONFIG_NFSD_V4 */
+ if ((&nfsd_fs_type)->next != NULL)
+ unregister_filesystem(&nfsd_fs_type);
+}
+
static int __init init_nfsd(void)
{
int retval;
@@ -407,31 +422,11 @@ static int __init init_nfsd(void)
entry->proc_fops = &exports_operations;
}
retval = register_filesystem(&nfsd_fs_type);
- if (retval) {
- nfsd_export_shutdown();
- nfsd_cache_shutdown();
- remove_proc_entry("fs/nfs/exports", NULL);
- remove_proc_entry("fs/nfs", NULL);
- nfsd_stat_shutdown();
- nfsd_lockd_shutdown();
- }
+ if (retval)
+ exit_nfsd();
return retval;
}
-static void __exit exit_nfsd(void)
-{
- nfsd_export_shutdown();
- nfsd_cache_shutdown();
- remove_proc_entry("fs/nfs/exports", NULL);
- remove_proc_entry("fs/nfs", NULL);
- nfsd_stat_shutdown();
- nfsd_lockd_shutdown();
-#ifdef CONFIG_NFSD_V4
- nfsd_idmap_shutdown();
-#endif /* CONFIG_NFSD_V4 */
- unregister_filesystem(&nfsd_fs_type);
-}
-
MODULE_AUTHOR("Olaf Kirch <[email protected]>");
MODULE_LICENSE("GPL");
module_init(init_nfsd)
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs