blob: b9a03a7ff8012efd53fbba9af7114976fa138500 [file] [log] [blame]
David Teigland869d81d2006-01-17 08:47:12 +00001/*
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
Steven Whitehousee9fc2aa2006-09-01 11:05:15 -04007 * of the GNU General Public License version 2.
David Teigland869d81d2006-01-17 08:47:12 +00008 */
David Teigland29b79982006-01-16 16:52:38 +00009
10#include <linux/init.h>
11
12#include "lock_dlm.h"
13
Adrian Bunk08bc2db2006-04-28 10:59:12 -040014static int __init init_lock_dlm(void)
David Teigland29b79982006-01-16 16:52:38 +000015{
16 int error;
17
David Teigland3120ec52006-08-04 13:14:50 -050018 error = gfs2_register_lockproto(&gdlm_ops);
David Teigland29b79982006-01-16 16:52:38 +000019 if (error) {
Steven Whitehousef3828942006-02-27 12:07:05 -050020 printk(KERN_WARNING "lock_dlm: can't register protocol: %d\n",
21 error);
David Teigland29b79982006-01-16 16:52:38 +000022 return error;
23 }
24
25 error = gdlm_sysfs_init();
26 if (error) {
David Teigland3120ec52006-08-04 13:14:50 -050027 gfs2_unregister_lockproto(&gdlm_ops);
David Teigland869d81d2006-01-17 08:47:12 +000028 return error;
29 }
30
Steven Whitehousef3828942006-02-27 12:07:05 -050031 printk(KERN_INFO
32 "Lock_DLM (built %s %s) installed\n", __DATE__, __TIME__);
David Teigland29b79982006-01-16 16:52:38 +000033 return 0;
34}
35
Adrian Bunk08bc2db2006-04-28 10:59:12 -040036static void __exit exit_lock_dlm(void)
David Teigland29b79982006-01-16 16:52:38 +000037{
David Teigland29b79982006-01-16 16:52:38 +000038 gdlm_sysfs_exit();
David Teigland3120ec52006-08-04 13:14:50 -050039 gfs2_unregister_lockproto(&gdlm_ops);
David Teigland29b79982006-01-16 16:52:38 +000040}
41
42module_init(init_lock_dlm);
43module_exit(exit_lock_dlm);
44
45MODULE_DESCRIPTION("GFS DLM Locking Module");
46MODULE_AUTHOR("Red Hat, Inc.");
47MODULE_LICENSE("GPL");
48