Whamcloud - gitweb
land b_ost_amd onto HEAD.
[fs/lustre-release.git] / lustre / llite / super25.c
index 5ab03ff..1f5425e 100644 (file)
@@ -24,6 +24,7 @@
 #define DEBUG_SUBSYSTEM S_LLITE
 
 #include <linux/module.h>
+#include <linux/types.h>
 #include <linux/random.h>
 #include <linux/version.h>
 #include <linux/lustre_lite.h>
@@ -34,8 +35,6 @@
 #include <linux/lprocfs_status.h>
 #include "llite_internal.h"
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
-
 struct super_block * ll_get_sb(struct file_system_type *fs_type,
                                int flags, const char *devname, void * data)
 {
@@ -43,6 +42,13 @@ struct super_block * ll_get_sb(struct file_system_type *fs_type,
         return get_sb_nodev(fs_type, flags, data, ll_fill_super);
 }
 
+struct super_block * lustre_get_sb(struct file_system_type *fs_type,
+                               int flags, const char *devname, void * data)
+{
+        /* calls back in fill super */
+        return get_sb_nodev(fs_type, flags, data, lustre_fill_super);
+}
+
 static kmem_cache_t *ll_inode_cachep;
 
 static struct inode *ll_alloc_inode(struct super_block *sb)
@@ -92,28 +98,37 @@ void ll_destroy_inodecache(void)
 }
 
 /* exported operations */
-struct super_operations ll_super_operations =
+struct super_operations lustre_super_operations =
 {
-        alloc_inode: ll_alloc_inode,
-        destroy_inode: ll_destroy_inode,
-        clear_inode: ll_clear_inode,
-        put_super: ll_put_super,
-        statfs: ll_statfs,
-        umount_begin: ll_umount_begin
+        .alloc_inode   = ll_alloc_inode,
+        .destroy_inode = ll_destroy_inode,
+        .clear_inode   = ll_clear_inode,
+        .put_super     = lustre_put_super,
+        .statfs        = ll_statfs,
+        .umount_begin  = ll_umount_begin
 };
 
 
 struct file_system_type lustre_lite_fs_type = {
-        .owner  = THIS_MODULE,
-        .name =   "lustre_lite",
-        .get_sb = ll_get_sb,
-        .kill_sb = kill_anon_super,
+        .owner        = THIS_MODULE,
+        .name         = "lustre_lite",
+        .get_sb       = ll_get_sb,
+        .kill_sb      = kill_anon_super,
+        .fs_flags     = FS_BINARY_MOUNTDATA,
+};
+
+struct file_system_type lustre_fs_type = {
+        .owner        = THIS_MODULE,
+        .name         = "lustre",
+        .get_sb       = lustre_get_sb,
+        .kill_sb      = kill_anon_super,
+        .fs_flags     = FS_BINARY_MOUNTDATA,
 };
 
 static int __init init_lustre_lite(void)
 {
         int rc;
-        printk(KERN_INFO "Lustre Lite Client File System; "
+        printk(KERN_INFO "Lustre: Lustre Lite Client File System; "
                "info@clusterfs.com\n");
         rc = ll_init_inodecache();
         if (rc)
@@ -129,11 +144,18 @@ static int __init init_lustre_lite(void)
         proc_lustre_fs_root = proc_lustre_root ?
                               proc_mkdir("llite", proc_lustre_root) : NULL;
 
-        return register_filesystem(&lustre_lite_fs_type);
+        rc = register_filesystem(&lustre_lite_fs_type);
+        if (!rc) {
+                rc = register_filesystem(&lustre_fs_type);
+                if (rc)
+                        unregister_filesystem(&lustre_fs_type);
+        }
+        return rc;
 }
 
 static void __exit exit_lustre_lite(void)
 {
+        unregister_filesystem(&lustre_fs_type);
         unregister_filesystem(&lustre_lite_fs_type);
         ll_destroy_inodecache();
         kmem_cache_destroy(ll_file_data_slab);
@@ -149,4 +171,3 @@ MODULE_LICENSE("GPL");
 
 module_init(init_lustre_lite);
 module_exit(exit_lustre_lite);
-#endif