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