main.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /******************************************************************************
  2. *******************************************************************************
  3. **
  4. ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
  5. ** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
  6. **
  7. ** This copyrighted material is made available to anyone wishing to use,
  8. ** modify, copy, or redistribute it subject to the terms and conditions
  9. ** of the GNU General Public License v.2.
  10. **
  11. *******************************************************************************
  12. ******************************************************************************/
  13. #include <linux/init.h>
  14. #include "lock_dlm.h"
  15. extern int gdlm_drop_count;
  16. extern int gdlm_drop_period;
  17. extern struct lm_lockops gdlm_ops;
  18. int __init init_lock_dlm(void)
  19. {
  20. int error;
  21. error = lm_register_proto(&gdlm_ops);
  22. if (error) {
  23. printk("lock_dlm: can't register protocol: %d\n", error);
  24. return error;
  25. }
  26. error = gdlm_sysfs_init();
  27. if (error) {
  28. lm_unregister_proto(&gdlm_ops);
  29. return error;
  30. }
  31. gdlm_drop_count = GDLM_DROP_COUNT;
  32. gdlm_drop_period = GDLM_DROP_PERIOD;
  33. printk("Lock_DLM (built %s %s) installed\n", __DATE__, __TIME__);
  34. return 0;
  35. }
  36. void __exit exit_lock_dlm(void)
  37. {
  38. lm_unregister_proto(&gdlm_ops);
  39. gdlm_sysfs_exit();
  40. }
  41. module_init(init_lock_dlm);
  42. module_exit(exit_lock_dlm);
  43. MODULE_DESCRIPTION("GFS DLM Locking Module");
  44. MODULE_AUTHOR("Red Hat, Inc.");
  45. MODULE_LICENSE("GPL");