Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / cmm / cmm_device.c
index 38054f4..886dfbc 100644 (file)
@@ -368,9 +368,12 @@ out_free_cmm:
         return l;
 }
 
-static void cmm_device_free(const struct lu_env *env, struct lu_device *d)
+static struct lu_device *cmm_device_free(const struct lu_env *env,
+                                         struct lu_device *d)
 {
         struct cmm_device *m = lu2cmm_dev(d);
+        struct lu_device  *next = md2lu_dev(m->cmm_child);
+        ENTRY;
 
         LASSERT(m->cmm_tgt_count == 0);
         LASSERT(list_empty(&m->cmm_targets));
@@ -378,8 +381,9 @@ static void cmm_device_free(const struct lu_env *env, struct lu_device *d)
                 OBD_FREE_PTR(m->cmm_fld);
                 m->cmm_fld = NULL;
         }
-       md_device_fini(&m->cmm_md_dev);
+        md_device_fini(&m->cmm_md_dev);
         OBD_FREE_PTR(m);
+        RETURN(next);
 }
 
 /* context key constructor/destructor: cmm_key_init, cmm_key_fini */
@@ -483,13 +487,17 @@ struct lprocfs_vars lprocfs_cmm_module_vars[] = {
         { 0 }
 };
 
-LPROCFS_INIT_VARS(cmm, lprocfs_cmm_module_vars, lprocfs_cmm_obd_vars);
+static void lprocfs_cmm_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars  = lprocfs_cmm_module_vars;
+    lvars->obd_vars     = lprocfs_cmm_obd_vars;
+}
 
 static int __init cmm_mod_init(void)
 {
         struct lprocfs_static_vars lvars;
 
-        lprocfs_init_vars(cmm, &lvars);
+        lprocfs_cmm_init_vars(&lvars);
         return class_register_type(&cmm_obd_device_ops, NULL, lvars.module_vars,
                                    LUSTRE_CMM_NAME, &cmm_device_type);
 }