main.c 1.0 KB

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