Whamcloud - gitweb
b=14340
[fs/lustre-release.git] / lustre / mdd / mdd_device.c
index f7ba9e7..a1a69f5 100644 (file)
@@ -62,6 +62,8 @@ static int mdd_device_init(const struct lu_env *env, struct lu_device *d,
         mdd->mdd_txn_cb.dtc_txn_commit = mdd_txn_commit_cb;
         mdd->mdd_txn_cb.dtc_cookie = mdd;
         INIT_LIST_HEAD(&mdd->mdd_txn_cb.dtc_linkage);
+        mdd->mdd_atime_diff = MAX_ATIME_DIFF;
+
         rc = mdd_procfs_init(mdd, name);
         RETURN(rc);
 }
@@ -315,20 +317,24 @@ static struct lu_device *mdd_device_alloc(const struct lu_env *env,
         return l;
 }
 
-static void mdd_device_free(const struct lu_env *env,
-                            struct lu_device *lu)
+static struct lu_device *mdd_device_free(const struct lu_env *env,
+                                         struct lu_device *lu)
 {
         struct mdd_device *m = lu2mdd_dev(lu);
+        struct lu_device  *next = &m->mdd_child->dd_lu_dev;
+        ENTRY;
 
         LASSERT(atomic_read(&lu->ld_ref) == 0);
         md_device_fini(&m->mdd_md_dev);
         OBD_FREE_PTR(m);
+        RETURN(next);
 }
 
 static struct obd_ops mdd_obd_device_ops = {
         .o_owner = THIS_MODULE
 };
 
+/* context key constructor/destructor: mdd_ucred_key_init, mdd_ucred_key_fini */
 LU_KEY_INIT_FINI(mdd_ucred, struct md_ucred);
 
 static struct lu_context_key mdd_ucred_key = {
@@ -344,6 +350,10 @@ struct md_ucred *md_ucred(const struct lu_env *env)
 }
 EXPORT_SYMBOL(md_ucred);
 
+/*
+ * context key constructor/destructor:
+ * mdd_capainfo_key_init, mdd_capainfo_key_fini
+ */
 LU_KEY_INIT_FINI(mdd_capainfo, struct md_capainfo);
 
 struct lu_context_key mdd_capainfo_key = {
@@ -361,6 +371,7 @@ struct md_capainfo *md_capainfo(const struct lu_env *env)
 }
 EXPORT_SYMBOL(md_capainfo);
 
+/* type constructor/destructor: mdd_type_init, mdd_type_fini */
 LU_TYPE_INIT_FINI(mdd, &mdd_thread_key, &mdd_ucred_key, &mdd_capainfo_key);
 
 struct md_device_operations mdd_ops = {
@@ -389,6 +400,7 @@ static struct lu_device_type mdd_device_type = {
         .ldt_ctx_tags = LCT_MD_THREAD
 };
 
+/* context key constructor: mdd_key_init */
 LU_KEY_INIT(mdd, struct mdd_thread_info);
 
 static void mdd_key_fini(const struct lu_context *ctx,
@@ -402,22 +414,13 @@ static void mdd_key_fini(const struct lu_context *ctx,
         OBD_FREE_PTR(info);
 }
 
+/* context key: mdd_thread_key */
 LU_CONTEXT_KEY_DEFINE(mdd, LCT_MD_THREAD);
 
-struct lprocfs_vars lprocfs_mdd_obd_vars[] = {
-        { 0 }
-};
-
-struct lprocfs_vars lprocfs_mdd_module_vars[] = {
-        { 0 }
-};
-
-LPROCFS_INIT_VARS(mdd, lprocfs_mdd_module_vars, lprocfs_mdd_obd_vars);
-
 static int __init mdd_mod_init(void)
 {
         struct lprocfs_static_vars lvars;
-        lprocfs_init_vars(mdd, &lvars);
+        lprocfs_mdd_init_vars(&lvars);
         return class_register_type(&mdd_obd_device_ops, NULL, lvars.module_vars,
                                    LUSTRE_MDD_NAME, &mdd_device_type);
 }