Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /******************************************************************************
0003 *******************************************************************************
0004 **
0005 **  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
0006 **  Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
0007 **
0008 **
0009 *******************************************************************************
0010 ******************************************************************************/
0011 
0012 #include <linux/module.h>
0013 
0014 #include "dlm_internal.h"
0015 #include "lockspace.h"
0016 #include "lock.h"
0017 #include "user.h"
0018 #include "memory.h"
0019 #include "config.h"
0020 #include "lowcomms.h"
0021 
0022 #define CREATE_TRACE_POINTS
0023 #include <trace/events/dlm.h>
0024 
0025 static int __init init_dlm(void)
0026 {
0027     int error;
0028 
0029     error = dlm_memory_init();
0030     if (error)
0031         goto out;
0032 
0033     error = dlm_lockspace_init();
0034     if (error)
0035         goto out_mem;
0036 
0037     error = dlm_config_init();
0038     if (error)
0039         goto out_lockspace;
0040 
0041     dlm_register_debugfs();
0042 
0043     error = dlm_user_init();
0044     if (error)
0045         goto out_debug;
0046 
0047     error = dlm_netlink_init();
0048     if (error)
0049         goto out_user;
0050 
0051     error = dlm_plock_init();
0052     if (error)
0053         goto out_netlink;
0054 
0055     printk("DLM installed\n");
0056 
0057     return 0;
0058 
0059  out_netlink:
0060     dlm_netlink_exit();
0061  out_user:
0062     dlm_user_exit();
0063  out_debug:
0064     dlm_unregister_debugfs();
0065     dlm_config_exit();
0066  out_lockspace:
0067     dlm_lockspace_exit();
0068  out_mem:
0069     dlm_memory_exit();
0070  out:
0071     return error;
0072 }
0073 
0074 static void __exit exit_dlm(void)
0075 {
0076     dlm_plock_exit();
0077     dlm_netlink_exit();
0078     dlm_user_exit();
0079     dlm_config_exit();
0080     dlm_memory_exit();
0081     dlm_lockspace_exit();
0082     dlm_lowcomms_exit();
0083     dlm_unregister_debugfs();
0084 }
0085 
0086 module_init(init_dlm);
0087 module_exit(exit_dlm);
0088 
0089 MODULE_DESCRIPTION("Distributed Lock Manager");
0090 MODULE_AUTHOR("Red Hat, Inc.");
0091 MODULE_LICENSE("GPL");
0092 
0093 EXPORT_SYMBOL_GPL(dlm_new_lockspace);
0094 EXPORT_SYMBOL_GPL(dlm_release_lockspace);
0095 EXPORT_SYMBOL_GPL(dlm_lock);
0096 EXPORT_SYMBOL_GPL(dlm_unlock);
0097