Whamcloud - gitweb
b=4223
[fs/lustre-release.git] / lustre / smfs / sm_fs.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  lustre/smfs/sm_fs.c
5  *  Lustre filesystem abstraction routines
6  *
7  *  Copyright (C) 2004 Cluster File Systems, Inc.
8  *
9  *   This file is part of Lustre, http://www.lustre.org.
10  *
11  *   Lustre is free software; you can redistribute it and/or
12  *   modify it under the terms of version 2 of the GNU General Public
13  *   License as published by the Free Software Foundation.
14  *
15  *   Lustre is distributed in the hope that it will be useful,
16  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *   GNU General Public License for more details.
19  *
20  *   You should have received a copy of the GNU General Public License
21  *   along with Lustre; if not, write to the Free Software
22  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  */
24
25 #define DEBUG_SUBSYSTEM S_SM
26
27 #ifndef EXPORT_SYMTAB
28 #define EXPORT_SYMTAB
29 #endif
30
31 #include <linux/module.h>
32 #include <linux/kernel.h>
33 #include <linux/string.h>
34 #include <linux/slab.h>
35 #include <linux/stat.h>
36 #include <linux/unistd.h>
37 #include <linux/miscdevice.h>
38 #include <linux/obd_class.h>
39 #include <linux/obd_support.h>
40 #include <linux/lustre_lib.h>
41 #include <linux/lustre_idl.h>
42 #include <linux/lustre_fsfilt.h>
43 #include <linux/lustre_smfs.h>
44
45 #include "smfs_internal.h"
46
47 int sm_stack = 0;
48 long sm_kmemory = 0;
49
50 MODULE_AUTHOR("Peter J. Braam <braam@cs.cmu.edu>");
51 MODULE_DESCRIPTION("Smfs file system filters v0.01");
52 MODULE_LICENSE("GPL");
53
54 extern int init_smfs(void);
55 extern int cleanup_smfs(void);
56
57 static int __init smfs_init(void)
58 {
59         int err;
60
61         if ( (err = init_smfs_psdev()) ) {
62                 printk("Error initializing smfs_psdev, %d\n", err);
63                 return -EINVAL;
64         }
65
66         if ( (err = init_smfs()) ) {
67                 printk("Error initializing smfs, %d\n", err);
68                 return -EINVAL;
69         }
70
71         if ( (err = init_smfs_proc_sys()) ) {
72                 printk("Error initializing smfs proc sys, %d\n", err);
73                 return -EINVAL;
74         }
75
76         return 0;
77 }
78
79 static void __exit smfs_cleanup(void)
80 {
81         cleanup_smfs();
82         smfs_cleanup_psdev();
83 }
84 module_init(smfs_init);
85 module_exit(smfs_cleanup);