Whamcloud - gitweb
merge b_devel into HEAD. Includes:
[fs/lustre-release.git] / lustre / ptlbd / main.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (c) 2002 Cluster File Systems, Inc.
5  *
6  *   This file is part of Lustre, http://www.lustre.org.
7  *
8  *   Lustre is free software; you can redistribute it and/or
9  *   modify it under the terms of version 2 of the GNU General Public
10  *   License as published by the Free Software Foundation.
11  *
12  *   Lustre is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with Lustre; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21
22 #include <linux/module.h>
23 #include <linux/major.h>
24 #include <linux/smp.h>
25
26 #define DEBUG_SUBSYSTEM S_PTLBD
27
28 #include <linux/lustre_lite.h>
29 #include <linux/lustre_ha.h>
30 #include <linux/obd_support.h>
31
32 #include <linux/obd_ptlbd.h>
33
34 static int __init ptlbd_init(void)
35 {
36         int ret;
37         ENTRY;
38
39         ret = ptlbd_cl_init();
40         if ( ret < 0 ) 
41                 RETURN(ret);
42
43         ret = ptlbd_sv_init();
44         if ( ret < 0 ) 
45                 GOTO(out_cl, ret);
46
47         ret = ptlbd_blk_init();
48         if ( ret < 0 ) 
49                 GOTO(out_sv, ret);
50
51         RETURN(0);
52
53 out_sv:
54         ptlbd_sv_exit();
55 out_cl:
56         ptlbd_cl_exit();
57         RETURN(ret);
58 }
59
60 static void __exit ptlbd_exit(void)
61 {
62         ENTRY;
63         ptlbd_cl_exit();
64         ptlbd_sv_exit();
65         ptlbd_blk_exit();
66         EXIT;
67 }
68
69 module_init(ptlbd_init);
70 module_exit(ptlbd_exit);
71 MODULE_LICENSE("GPL");