mdd->mdd_txn_cb.dtc_txn_stop = mdd_txn_stop_cb;
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);
+ CFS_INIT_LIST_HEAD(&mdd->mdd_txn_cb.dtc_linkage);
+ mdd->mdd_atime_diff = MAX_ATIME_DIFF;
+
rc = mdd_procfs_init(mdd, name);
RETURN(rc);
}
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 = {
}
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 = {
}
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 = {
.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,
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);
}