Merge tag 'libnvdimm-for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm...
[deliverable/linux.git] / fs / orangefs / orangefs-mod.c
index 91a4293d1cd7b7cc33bbea8c45e53c92f1adbab1..6f072a8c0de1732f6c7823fd5b37f81f64156bc4 100644 (file)
@@ -144,21 +144,12 @@ static int __init orangefs_init(void)
        if (ret < 0)
                goto cleanup_op;
 
-       /* Initialize the orangefsdev subsystem. */
-       ret = orangefs_dev_init();
-       if (ret < 0) {
-               gossip_err("%s: could not initialize device subsystem %d!\n",
-                          __func__,
-                          ret);
-               goto cleanup_inode;
-       }
-
        htable_ops_in_progress =
            kcalloc(hash_table_size, sizeof(struct list_head), GFP_KERNEL);
        if (!htable_ops_in_progress) {
                gossip_err("Failed to initialize op hashtable");
                ret = -ENOMEM;
-               goto cleanup_device;
+               goto cleanup_inode;
        }
 
        /* initialize a doubly linked at each hash table index */
@@ -181,32 +172,57 @@ static int __init orangefs_init(void)
         * and passes along the needed info. The argument signifies
         * which time orangefs_prepare_debugfs_help_string is being
         * called.
-        *
         */
        ret = orangefs_prepare_debugfs_help_string(1);
        if (ret)
-               goto out;
+               goto cleanup_key_table;
+
+       ret = orangefs_debugfs_init();
+       if (ret)
+               goto debugfs_init_failed;
 
-       orangefs_debugfs_init();
-       orangefs_kernel_debug_init();
-       orangefs_sysfs_init();
+       ret = orangefs_kernel_debug_init();
+       if (ret)
+               goto kernel_debug_init_failed;
+
+       ret = orangefs_sysfs_init();
+       if (ret)
+               goto sysfs_init_failed;
+
+       /* Initialize the orangefsdev subsystem. */
+       ret = orangefs_dev_init();
+       if (ret < 0) {
+               gossip_err("%s: could not initialize device subsystem %d!\n",
+                          __func__,
+                          ret);
+               goto cleanup_device;
+       }
 
        ret = register_filesystem(&orangefs_fs_type);
        if (ret == 0) {
                pr_info("orangefs: module version %s loaded\n", ORANGEFS_VERSION);
-               return 0;
+               ret = 0;
+               goto out;
        }
 
-       orangefs_debugfs_cleanup();
        orangefs_sysfs_exit();
+
+cleanup_device:
+       orangefs_dev_cleanup();
+
+sysfs_init_failed:
+
+kernel_debug_init_failed:
+
+debugfs_init_failed:
+       orangefs_debugfs_cleanup();
+
+cleanup_key_table:
        fsid_key_table_finalize();
 
 cleanup_progress_table:
        kfree(htable_ops_in_progress);
 
-cleanup_device:
-       orangefs_dev_cleanup();
-
 cleanup_inode:
        orangefs_inode_cache_finalize();
 
This page took 0.025871 seconds and 5 git commands to generate.