sunrpc_syms.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. static int __init
  51. init_sunrpc(void)
  52. {
  53. int err = register_rpc_pipefs();
  54. if (err)
  55. goto out;
  56. err = rpc_init_mempool();
  57. if (err)
  58. goto out2;
  59. err = rpcauth_init_module();
  60. if (err)
  61. goto out3;
  62. cache_initialize();
  63. err = register_pernet_subsys(&sunrpc_net_ops);
  64. if (err)
  65. goto out4;
  66. #ifdef RPC_DEBUG
  67. rpc_register_sysctl();
  68. #endif
  69. cache_register(&unix_gid_cache);
  70. svc_init_xprt_sock(); /* svc sock transport */
  71. init_socket_xprt(); /* clnt sock transport */
  72. return 0;
  73. out4:
  74. rpcauth_remove_module();
  75. out3:
  76. rpc_destroy_mempool();
  77. out2:
  78. unregister_rpc_pipefs();
  79. out:
  80. return err;
  81. }
  82. static void __exit
  83. cleanup_sunrpc(void)
  84. {
  85. rpcauth_remove_module();
  86. cleanup_socket_xprt();
  87. svc_cleanup_xprt_sock();
  88. unregister_rpc_pipefs();
  89. rpc_destroy_mempool();
  90. cache_unregister(&unix_gid_cache);
  91. unregister_pernet_subsys(&sunrpc_net_ops);
  92. #ifdef RPC_DEBUG
  93. rpc_unregister_sysctl();
  94. #endif
  95. rcu_barrier(); /* Wait for completion of call_rcu()'s */
  96. }
  97. MODULE_LICENSE("GPL");
  98. fs_initcall(init_sunrpc); /* Ensure we're initialised before nfs */
  99. module_exit(cleanup_sunrpc);