Whamcloud - gitweb
b=17508
authorjxiong <jxiong>
Fri, 23 Jan 2009 10:01:55 +0000 (10:01 +0000)
committerjxiong <jxiong>
Fri, 23 Jan 2009 10:01:55 +0000 (10:01 +0000)
r=huanghua,nikita

Fixed a minior issue about mdc device.
Now (mds) mdc device is not really stacked into mdt device family, so
mdc_type_init is not called at all. The hot fix is to call it in cmm_mod_init.

lustre/cmm/cmm_device.c
lustre/obdclass/lu_object.c

index 01f319d..681e2db 100644 (file)
@@ -817,15 +817,29 @@ static void lprocfs_cmm_init_vars(struct lprocfs_static_vars *lvars)
 static int __init cmm_mod_init(void)
 {
         struct lprocfs_static_vars lvars;
+        int rc;
+
+        /* 
+         * Kludge code : it should be moved mdc_device.c if mdc_(mds)_device
+         * is really stacked.
+         */
+        rc = lu_device_type_init(&mdc_device_type);
+        if (rc)
+                return rc;
 
         lprocfs_cmm_init_vars(&lvars);
-        return class_register_type(&cmm_obd_device_ops, NULL, lvars.module_vars,
-                                   LUSTRE_CMM_NAME, &cmm_device_type);
+        rc = class_register_type(&cmm_obd_device_ops, NULL, lvars.module_vars,
+                                 LUSTRE_CMM_NAME, &cmm_device_type);
+        if (rc)
+                lu_device_type_fini(&mdc_device_type);
+
+        return rc;
 }
 
 static void __exit cmm_mod_exit(void)
 {
         class_unregister_type(LUSTRE_CMM_NAME);
+        lu_device_type_fini(&mdc_device_type);
 }
 
 MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
index 5cae3c1..d5f6f5c 100644 (file)
@@ -1193,6 +1193,7 @@ void *lu_context_key_get(const struct lu_context *ctx,
 {
         LINVRNT(ctx->lc_state == LCS_ENTERED);
         LINVRNT(0 <= key->lct_index && key->lct_index < ARRAY_SIZE(lu_keys));
+        LASSERT(lu_keys[key->lct_index] == key);
         return ctx->lc_value[key->lct_index];
 }
 EXPORT_SYMBOL(lu_context_key_get);