2006-01-17 16:47:12 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
|
|
|
|
* Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
|
|
|
|
*
|
|
|
|
* This copyrighted material is made available to anyone wishing to use,
|
|
|
|
* modify, copy, or redistribute it subject to the terms and conditions
|
|
|
|
* of the GNU General Public License v.2.
|
|
|
|
*/
|
2006-01-17 00:52:38 +08:00
|
|
|
|
|
|
|
#include <linux/init.h>
|
|
|
|
|
|
|
|
#include "lock_dlm.h"
|
|
|
|
|
|
|
|
extern int gdlm_drop_count;
|
|
|
|
extern int gdlm_drop_period;
|
|
|
|
|
|
|
|
extern struct lm_lockops gdlm_ops;
|
|
|
|
|
|
|
|
int __init init_lock_dlm(void)
|
|
|
|
{
|
|
|
|
int error;
|
|
|
|
|
2006-01-17 16:47:12 +08:00
|
|
|
error = gfs_register_lockproto(&gdlm_ops);
|
2006-01-17 00:52:38 +08:00
|
|
|
if (error) {
|
2006-02-27 23:57:14 +08:00
|
|
|
printk(KERN_WARNING "lock_dlm: can't register protocol: %d\n", error);
|
2006-01-17 00:52:38 +08:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
error = gdlm_sysfs_init();
|
|
|
|
if (error) {
|
2006-01-17 16:47:12 +08:00
|
|
|
gfs_unregister_lockproto(&gdlm_ops);
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
error = gdlm_plock_init();
|
|
|
|
if (error) {
|
|
|
|
gdlm_sysfs_exit();
|
|
|
|
gfs_unregister_lockproto(&gdlm_ops);
|
2006-01-17 00:52:38 +08:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
gdlm_drop_count = GDLM_DROP_COUNT;
|
|
|
|
gdlm_drop_period = GDLM_DROP_PERIOD;
|
|
|
|
|
2006-02-27 23:57:14 +08:00
|
|
|
printk(KERN_INFO "Lock_DLM (built %s %s) installed\n", __DATE__, __TIME__);
|
2006-01-17 00:52:38 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void __exit exit_lock_dlm(void)
|
|
|
|
{
|
2006-01-17 16:47:12 +08:00
|
|
|
gdlm_plock_exit();
|
2006-01-17 00:52:38 +08:00
|
|
|
gdlm_sysfs_exit();
|
2006-01-17 16:47:12 +08:00
|
|
|
gfs_unregister_lockproto(&gdlm_ops);
|
2006-01-17 00:52:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
module_init(init_lock_dlm);
|
|
|
|
module_exit(exit_lock_dlm);
|
|
|
|
|
|
|
|
MODULE_DESCRIPTION("GFS DLM Locking Module");
|
|
|
|
MODULE_AUTHOR("Red Hat, Inc.");
|
|
|
|
MODULE_LICENSE("GPL");
|
|
|
|
|