sunrpc_syms.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * linux/net/sunrpc/sunrpc_syms.c
  3. *
  4. * Symbols exported by the sunrpc module.
  5. *
  6. * Copyright (C) 1997 Olaf Kirch <okir@monad.swb.de>
  7. */
  8. #include <linux/module.h>
  9. #include <linux/types.h>
  10. #include <linux/uio.h>
  11. #include <linux/unistd.h>
  12. #include <linux/init.h>
  13. #include <linux/sunrpc/sched.h>
  14. #include <linux/sunrpc/clnt.h>
  15. #include <linux/sunrpc/svc.h>
  16. #include <linux/sunrpc/svcsock.h>
  17. #include <linux/sunrpc/auth.h>
  18. #include <linux/workqueue.h>
  19. #include <linux/sunrpc/rpc_pipe_fs.h>
  20. #include <linux/sunrpc/xprtsock.h>
  21. #include "netns.h"
  22. int sunrpc_net_id;
  23. static __net_init int sunrpc_init_net(struct net *net)
  24. {
  25. return 0;
  26. }
  27. static __net_exit void sunrpc_exit_net(struct net *net)
  28. {
  29. }
  30. static struct pernet_operations sunrpc_net_ops = {
  31. .init = sunrpc_init_net,
  32. .exit = sunrpc_exit_net,
  33. .id = &sunrpc_net_id,
  34. .size = sizeof(struct sunrpc_net),
  35. };
  36. extern struct cache_detail ip_map_cache, unix_gid_cache;
  37. extern void cleanup_rpcb_clnt(void);
  38. static int __init
  39. init_sunrpc(void)
  40. {
  41. int err = register_rpc_pipefs();
  42. if (err)
  43. goto out;
  44. err = rpc_init_mempool();
  45. if (err)
  46. goto out2;
  47. err = rpcauth_init_module();
  48. if (err)
  49. goto out3;
  50. cache_initialize();
  51. err = register_pernet_subsys(&sunrpc_net_ops);
  52. if (err)
  53. goto out4;
  54. #ifdef RPC_DEBUG
  55. rpc_register_sysctl();
  56. #endif
  57. #ifdef CONFIG_PROC_FS
  58. rpc_proc_init();
  59. #endif
  60. cache_register(&ip_map_cache);
  61. cache_register(&unix_gid_cache);
  62. svc_init_xprt_sock(); /* svc sock transport */
  63. init_socket_xprt(); /* clnt sock transport */
  64. return 0;
  65. out4:
  66. rpcauth_remove_module();
  67. out3:
  68. rpc_destroy_mempool();
  69. out2:
  70. unregister_rpc_pipefs();
  71. out:
  72. return err;
  73. }
  74. static void __exit
  75. cleanup_sunrpc(void)
  76. {
  77. cleanup_rpcb_clnt();
  78. rpcauth_remove_module();
  79. cleanup_socket_xprt();
  80. svc_cleanup_xprt_sock();
  81. unregister_rpc_pipefs();
  82. rpc_destroy_mempool();
  83. cache_unregister(&ip_map_cache);
  84. cache_unregister(&unix_gid_cache);
  85. unregister_pernet_subsys(&sunrpc_net_ops);
  86. #ifdef RPC_DEBUG
  87. rpc_unregister_sysctl();
  88. #endif
  89. #ifdef CONFIG_PROC_FS
  90. rpc_proc_exit();
  91. #endif
  92. rcu_barrier(); /* Wait for completion of call_rcu()'s */
  93. }
  94. MODULE_LICENSE("GPL");
  95. fs_initcall(init_sunrpc); /* Ensure we're initialised before nfs */
  96. module_exit(cleanup_sunrpc);