module.c 804 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) 2015 Oracle. All rights reserved.
  3. */
  4. /* rpcrdma.ko module initialization
  5. */
  6. #include <linux/module.h>
  7. #include <linux/init.h>
  8. #include <linux/sunrpc/svc_rdma.h>
  9. #include "xprt_rdma.h"
  10. #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
  11. # define RPCDBG_FACILITY RPCDBG_TRANS
  12. #endif
  13. MODULE_AUTHOR("Open Grid Computing and Network Appliance, Inc.");
  14. MODULE_DESCRIPTION("RPC/RDMA Transport");
  15. MODULE_LICENSE("Dual BSD/GPL");
  16. MODULE_ALIAS("svcrdma");
  17. MODULE_ALIAS("xprtrdma");
  18. static void __exit rpc_rdma_cleanup(void)
  19. {
  20. xprt_rdma_cleanup();
  21. svc_rdma_cleanup();
  22. }
  23. static int __init rpc_rdma_init(void)
  24. {
  25. int rc;
  26. rc = svc_rdma_init();
  27. if (rc)
  28. goto out;
  29. rc = xprt_rdma_init();
  30. if (rc)
  31. svc_rdma_cleanup();
  32. out:
  33. return rc;
  34. }
  35. module_init(rpc_rdma_init);
  36. module_exit(rpc_rdma_cleanup);