Whamcloud - gitweb
Small fix on the description of some lctl commands.
[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  *  Copyright (C) 2004 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
23 #define DEBUG_SUBSYSTEM S_SM
24
25 #ifndef EXPORT_SYMTAB
26 #define EXPORT_SYMTAB
27 #endif
28
29 #include <linux/module.h>
30 #include <linux/kernel.h>
31 #include <linux/string.h>
32 #include <linux/slab.h>
33 #include <linux/stat.h>
34 #include <linux/unistd.h>
35 #include <linux/miscdevice.h>
36 #include <linux/obd_class.h>
37 #include <linux/obd_support.h>
38 #include <linux/lustre_lib.h>
39 #include <linux/lustre_idl.h>
40 #include <linux/lustre_smfs.h>
41
42 #include "smfs_internal.h"
43
44 int sm_stack = 0;
45 long sm_kmemory = 0;
46
47 MODULE_AUTHOR("Peter J. Braam <braam@cs.cmu.edu>");
48 MODULE_DESCRIPTION("Smfs file system filters v0.01");
49 MODULE_LICENSE("GPL");
50
51 extern int init_smfs(void);
52 extern int cleanup_smfs(void);
53
54 static int __init smfs_init(void)
55 {
56         int err;
57
58         if ( (err = init_smfs_psdev()) ) {
59                 printk("Error initializing smfs_psdev, %d\n", err);
60                 return -EINVAL;
61         }
62
63         if ( (err = init_smfs()) ) {
64                 printk("Error initializing smfs, %d\n", err);
65                 return -EINVAL;
66         }
67
68         if ( (err = init_smfs_proc_sys()) ) {
69                 printk("Error initializing smfs proc sys, %d\n", err);
70                 return -EINVAL;
71         }
72
73         return 0;
74 }
75
76 static void __exit smfs_cleanup(void)
77 {
78         cleanup_smfs();
79         smfs_cleanup_psdev();
80 }
81 module_init(smfs_init);
82 module_exit(smfs_cleanup);