]>
Commit | Line | Data |
---|---|---|
869d81df DT |
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 v.2. | |
8 | */ | |
29b7998d DT |
9 | |
10 | #include <linux/init.h> | |
11 | ||
12 | #include "lock_dlm.h" | |
13 | ||
14 | extern int gdlm_drop_count; | |
15 | extern int gdlm_drop_period; | |
16 | ||
17 | extern struct lm_lockops gdlm_ops; | |
18 | ||
19 | int __init init_lock_dlm(void) | |
20 | { | |
21 | int error; | |
22 | ||
869d81df | 23 | error = gfs_register_lockproto(&gdlm_ops); |
29b7998d | 24 | if (error) { |
d92a8d48 | 25 | printk(KERN_WARNING "lock_dlm: can't register protocol: %d\n", error); |
29b7998d DT |
26 | return error; |
27 | } | |
28 | ||
29 | error = gdlm_sysfs_init(); | |
30 | if (error) { | |
869d81df DT |
31 | gfs_unregister_lockproto(&gdlm_ops); |
32 | return error; | |
33 | } | |
34 | ||
35 | error = gdlm_plock_init(); | |
36 | if (error) { | |
37 | gdlm_sysfs_exit(); | |
38 | gfs_unregister_lockproto(&gdlm_ops); | |
29b7998d DT |
39 | return error; |
40 | } | |
41 | ||
42 | gdlm_drop_count = GDLM_DROP_COUNT; | |
43 | gdlm_drop_period = GDLM_DROP_PERIOD; | |
44 | ||
d92a8d48 | 45 | printk(KERN_INFO "Lock_DLM (built %s %s) installed\n", __DATE__, __TIME__); |
29b7998d DT |
46 | return 0; |
47 | } | |
48 | ||
49 | void __exit exit_lock_dlm(void) | |
50 | { | |
869d81df | 51 | gdlm_plock_exit(); |
29b7998d | 52 | gdlm_sysfs_exit(); |
869d81df | 53 | gfs_unregister_lockproto(&gdlm_ops); |
29b7998d DT |
54 | } |
55 | ||
56 | module_init(init_lock_dlm); | |
57 | module_exit(exit_lock_dlm); | |
58 | ||
59 | MODULE_DESCRIPTION("GFS DLM Locking Module"); | |
60 | MODULE_AUTHOR("Red Hat, Inc."); | |
61 | MODULE_LICENSE("GPL"); | |
62 |