Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- removed not used stuff (@lld and gns_mount_finished completion). Last is because
[fs/lustre-release.git]
/
lustre
/
llite
/
super25.c
diff --git
a/lustre/llite/super25.c
b/lustre/llite/super25.c
index
ee340b9
..
c3210ad
100644
(file)
--- a/
lustre/llite/super25.c
+++ b/
lustre/llite/super25.c
@@
-24,6
+24,7
@@
#define DEBUG_SUBSYSTEM S_LLITE
#include <linux/module.h>
#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>
#include <linux/random.h>
#include <linux/version.h>
#include <linux/lustre_lite.h>
@@
-92,60
+93,91
@@
int ll_init_inodecache(void)
void ll_destroy_inodecache(void)
{
void ll_destroy_inodecache(void)
{
- if (kmem_cache_destroy(ll_inode_cachep))
-
CERROR(
"ll_inode_cache: not all structures were freed\n");
+ LASSERTF(kmem_cache_destroy(ll_inode_cachep) == 0,
+
"ll_inode_cache: not all structures were freed\n");
}
/* exported operations */
struct super_operations lustre_super_operations =
{
}
/* exported 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 = {
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_REVAL_DOT|FS_BINARY_MOUNTDATA,
};
struct file_system_type lustre_fs_type = {
};
struct file_system_type lustre_fs_type = {
- .owner = THIS_MODULE,
- .name = "lustre",
- .get_sb = lustre_get_sb,
- .kill_sb = kill_anon_super,
+ .owner = THIS_MODULE,
+ .name = "lustre",
+ .get_sb = lustre_get_sb,
+ .kill_sb = kill_anon_super,
+ .fs_flags = FS_REVAL_DOT|FS_BINARY_MOUNTDATA,
};
static int __init init_lustre_lite(void)
{
};
static int __init init_lustre_lite(void)
{
- int rc;
+ int rc, cleanup = 0;
+
printk(KERN_INFO "Lustre: Lustre Lite Client File System; "
"info@clusterfs.com\n");
printk(KERN_INFO "Lustre: Lustre Lite Client File System; "
"info@clusterfs.com\n");
+
rc = ll_init_inodecache();
if (rc)
return -ENOMEM;
rc = ll_init_inodecache();
if (rc)
return -ENOMEM;
+
ll_file_data_slab = kmem_cache_create("ll_file_data",
sizeof(struct ll_file_data), 0,
SLAB_HWCACHE_ALIGN, NULL, NULL);
if (ll_file_data_slab == NULL) {
ll_file_data_slab = kmem_cache_create("ll_file_data",
sizeof(struct ll_file_data), 0,
SLAB_HWCACHE_ALIGN, NULL, NULL);
if (ll_file_data_slab == NULL) {
+ rc = -ENOMEM;
+ goto out;
+ }
+ ll_intent_slab = kmem_cache_create("lustre_intent_data",
+ sizeof(struct lustre_intent_data),
+ 0, SLAB_HWCACHE_ALIGN, NULL,
+ NULL);
+ if (ll_intent_slab == NULL) {
+ kmem_cache_destroy(ll_file_data_slab);
ll_destroy_inodecache();
return -ENOMEM;
}
ll_destroy_inodecache();
return -ENOMEM;
}
+
proc_lustre_fs_root = proc_lustre_root ?
proc_mkdir("llite", proc_lustre_root) : NULL;
rc = register_filesystem(&lustre_lite_fs_type);
proc_lustre_fs_root = proc_lustre_root ?
proc_mkdir("llite", proc_lustre_root) : NULL;
rc = register_filesystem(&lustre_lite_fs_type);
- if (!rc) {
- rc = register_filesystem(&lustre_fs_type);
- if (rc)
- unregister_filesystem(&lustre_fs_type);
+ if (rc)
+ goto out;
+ cleanup = 1;
+
+ rc = register_filesystem(&lustre_fs_type);
+ if (rc)
+ goto out;
+ cleanup = 2;
+
+ rc = ll_gns_start_thread();
+ if (rc)
+ goto out;
+ return 0;
+out:
+ switch (cleanup) {
+ case 2:
+ unregister_filesystem(&lustre_fs_type);
+ case 1:
+ unregister_filesystem(&lustre_lite_fs_type);
+ case 0:
+ ll_destroy_inodecache();
}
return rc;
}
}
return rc;
}
@@
-154,8
+186,14
@@
static void __exit exit_lustre_lite(void)
{
unregister_filesystem(&lustre_fs_type);
unregister_filesystem(&lustre_lite_fs_type);
{
unregister_filesystem(&lustre_fs_type);
unregister_filesystem(&lustre_lite_fs_type);
+
+ ll_gns_stop_thread();
ll_destroy_inodecache();
ll_destroy_inodecache();
- kmem_cache_destroy(ll_file_data_slab);
+
+ LASSERTF(kmem_cache_destroy(ll_file_data_slab) == 0,
+ "couldn't destroy ll_file_data slab\n");
+ LASSERTF(kmem_cache_destroy(ll_intent_slab) == 0,
+ "couldn't destroy ll_intent_slab slab\n");
if (proc_lustre_fs_root) {
lprocfs_remove(proc_lustre_fs_root);
proc_lustre_fs_root = NULL;
if (proc_lustre_fs_root) {
lprocfs_remove(proc_lustre_fs_root);
proc_lustre_fs_root = NULL;