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 */
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");
rc = ll_init_inodecache();
sizeof(struct ll_file_data), 0,
SLAB_HWCACHE_ALIGN, NULL, NULL);
if (ll_file_data_slab == NULL) {
- ll_destroy_inodecache();
+ GOTO(out, rc = ENOMEM);
return -ENOMEM;
}
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, rc);
+ cleanup = 1;
+
+ rc = register_filesystem(&lustre_fs_type);
+ if (rc)
+ GOTO(out, rc);
+ cleanup = 2;
+
+ rc = ll_gns_start_thread();
+ if (rc)
+ GOTO(out, rc);
+ 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;
}
unregister_filesystem(&lustre_fs_type);
unregister_filesystem(&lustre_lite_fs_type);
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");
if (proc_lustre_fs_root) {
lprocfs_remove(proc_lustre_fs_root);
proc_lustre_fs_root = NULL;