sunrpc_syms.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. int err;
  26. err = rpc_proc_init(net);
  27. if (err)
  28. goto err_proc;
  29. err = ip_map_cache_create(net);
  30. if (err)
  31. goto err_ipmap;
  32. return 0;
  33. err_ipmap:
  34. rpc_proc_exit(net);
  35. err_proc:
  36. return err;
  37. }
  38. static __net_exit void sunrpc_exit_net(struct net *net)
  39. {
  40. ip_map_cache_destroy(net);
  41. rpc_proc_exit(net);
  42. }
  43. static struct pernet_operations sunrpc_net_ops = {
  44. .init = sunrpc_init_net,
  45. .exit = sunrpc_exit_net,
  46. .id = &sunrpc_net_id,
  47. .size = sizeof(struct sunrpc_net),
  48. };
  49. extern struct cache_detail unix_gid_cache;
  50. extern void cleanup_rpcb_clnt(void);
  51. static int __init
  52. init_sunrpc(void)
  53. {
  54. int err = register_rpc_pipefs();
  55. if (err)
  56. goto out;
  57. err = rpc_init_mempool();
  58. if (err)
  59. goto out2;
  60. err = rpcauth_init_module();
  61. if (err)
  62. goto out3;
  63. cache_initialize();
  64. err = register_pernet_subsys(&sunrpc_net_ops);
  65. if (err)
  66. goto out4;
  67. #ifdef RPC_DEBUG
  68. rpc_register_sysctl();
  69. #endif
  70. cache_register(&unix_gid_cache);
  71. svc_init_xprt_sock(); /* svc sock transport */
  72. init_socket_xprt(); /* clnt sock transport */
  73. return 0;
  74. out4:
  75. rpcauth_remove_module();
  76. out3:
  77. rpc_destroy_mempool();
  78. out2:
  79. unregister_rpc_pipefs();
  80. out:
  81. return err;
  82. }
  83. static void __exit
  84. cleanup_sunrpc(void)
  85. {
  86. cleanup_rpcb_clnt();
  87. rpcauth_remove_module();
  88. cleanup_socket_xprt();
  89. svc_cleanup_xprt_sock();
  90. unregister_rpc_pipefs();
  91. rpc_destroy_mempool();
  92. cache_unregister(&unix_gid_cache);
  93. unregister_pernet_subsys(&sunrpc_net_ops);
  94. #ifdef RPC_DEBUG
  95. rpc_unregister_sysctl();
  96. #endif
  97. rcu_barrier(); /* Wait for completion of call_rcu()'s */
  98. }
  99. MODULE_LICENSE("GPL");
  100. fs_initcall(init_sunrpc); /* Ensure we're initialised before nfs */
  101. module_exit(cleanup_sunrpc);