mod.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * net/9p/9p.c
  3. *
  4. * 9P entry point
  5. *
  6. * Copyright (C) 2007 by Latchesar Ionkov <lucho@ionkov.net>
  7. * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
  8. * Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2
  12. * as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to:
  21. * Free Software Foundation
  22. * 51 Franklin Street, Fifth Floor
  23. * Boston, MA 02111-1301 USA
  24. *
  25. */
  26. #include <linux/module.h>
  27. #include <linux/moduleparam.h>
  28. #include <net/9p/9p.h>
  29. #ifdef CONFIG_NET_9P_DEBUG
  30. unsigned int p9_debug_level = 0; /* feature-rific global debug level */
  31. EXPORT_SYMBOL(p9_debug_level);
  32. module_param_named(debug, p9_debug_level, uint, 0);
  33. MODULE_PARM_DESC(debug, "9P debugging level");
  34. #endif
  35. extern int p9_mux_global_init(void);
  36. extern void p9_mux_global_exit(void);
  37. extern int p9_sysctl_register(void);
  38. extern void p9_sysctl_unregister(void);
  39. /**
  40. * v9fs_init - Initialize module
  41. *
  42. */
  43. static int __init init_p9(void)
  44. {
  45. int ret;
  46. p9_error_init();
  47. printk(KERN_INFO "Installing 9P2000 support\n");
  48. ret = p9_mux_global_init();
  49. if (ret) {
  50. printk(KERN_WARNING "9p: starting mux failed\n");
  51. return ret;
  52. }
  53. ret = p9_sysctl_register();
  54. if (ret) {
  55. printk(KERN_WARNING "9p: registering sysctl failed\n");
  56. return ret;
  57. }
  58. return ret;
  59. }
  60. /**
  61. * v9fs_init - shutdown module
  62. *
  63. */
  64. static void __exit exit_p9(void)
  65. {
  66. p9_sysctl_unregister();
  67. p9_mux_global_exit();
  68. }
  69. module_init(init_p9)
  70. module_exit(exit_p9)
  71. MODULE_AUTHOR("Latchesar Ionkov <lucho@ionkov.net>");
  72. MODULE_AUTHOR("Eric Van Hensbergen <ericvh@gmail.com>");
  73. MODULE_AUTHOR("Ron Minnich <rminnich@lanl.gov>");
  74. MODULE_LICENSE("GPL");