1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Lustre Light Super operations
6 * Copyright (c) 2002, 2003 Cluster File Systems, Inc.
8 * This file is part of Lustre, http://www.lustre.org.
10 * Lustre is free software; you can redistribute it and/or
11 * modify it under the terms of version 2 of the GNU General Public
12 * License as published by the Free Software Foundation.
14 * Lustre is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with Lustre; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #define DEBUG_SUBSYSTEM S_LLITE
26 #include <linux/module.h>
27 #include <linux/types.h>
28 #include <linux/random.h>
29 #include <linux/version.h>
30 #include <linux/lustre_lite.h>
31 #include <linux/lustre_ha.h>
32 #include <linux/lustre_dlm.h>
33 #include <linux/init.h>
35 #include <linux/lprocfs_status.h>
36 #include "llite_internal.h"
38 extern struct address_space_operations ll_aops;
39 extern struct address_space_operations ll_dir_aops;
41 static struct super_block *ll_read_super(struct super_block *sb,
42 void *data, int silent)
46 err = ll_fill_super(sb, data, silent);
52 static struct super_block *lustre_read_super(struct super_block *sb,
53 void *data, int silent)
57 err = lustre_fill_super(sb, data, silent);
63 static void ll_umount_lustre(struct super_block *sb)
65 struct ll_sb_info *sbi = ll_s2sbi(sb);
67 ll_gns_umount_all(sbi, 0);
70 static struct file_system_type lustre_lite_fs_type = {
72 .name = "lustre_lite",
73 .fs_flags = FS_NFSEXP_FSID,
74 .read_super = ll_read_super,
77 /* exported operations */
78 struct super_operations lustre_super_operations =
80 .read_inode2 = ll_read_inode2,
81 .clear_inode = ll_clear_inode,
83 /* should be fixed first */
84 .delete_inode = ll_delete_inode,
86 .put_super = lustre_put_super,
88 .umount_begin = ll_umount_begin,
89 .umount_lustre = ll_umount_lustre,
90 .fh_to_dentry = ll_fh_to_dentry,
91 .dentry_to_fh = ll_dentry_to_fh
94 static struct file_system_type lustre_fs_type = {
97 .fs_flags = FS_NFSEXP_FSID,
98 .read_super = lustre_read_super,
101 static int __init init_lustre_lite(void)
105 printk(KERN_INFO "Lustre: Lustre Lite Client File System; "
106 "info@clusterfs.com\n");
107 ll_file_data_slab = kmem_cache_create("ll_file_data",
108 sizeof(struct ll_file_data), 0,
109 SLAB_HWCACHE_ALIGN, NULL, NULL);
110 if (ll_file_data_slab == NULL)
113 proc_lustre_fs_root = proc_lustre_root ? proc_mkdir("llite", proc_lustre_root) : NULL;
115 rc = register_filesystem(&lustre_lite_fs_type);
120 rc = register_filesystem(&lustre_fs_type);
125 rc = ll_gns_start_thread();
133 unregister_filesystem(&lustre_fs_type);
135 unregister_filesystem(&lustre_lite_fs_type);
137 kmem_cache_destroy(ll_file_data_slab);
142 static void __exit exit_lustre_lite(void)
144 unregister_filesystem(&lustre_lite_fs_type);
145 unregister_filesystem(&lustre_fs_type);
147 ll_gns_stop_thread();
149 kmem_cache_destroy(ll_file_data_slab);
151 if (proc_lustre_fs_root) {
152 lprocfs_remove(proc_lustre_fs_root);
153 proc_lustre_fs_root = NULL;
157 MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
158 MODULE_DESCRIPTION("Lustre Lite Client File System");
159 MODULE_LICENSE("GPL");
161 module_init(init_lustre_lite);
162 module_exit(exit_lustre_lite);