Whamcloud - gitweb
LU-8066 obd: collect all resource releasing for obj_type.
[fs/lustre-release.git] / lustre / obdclass / dt_object.c
index faff31f..3bec5f7 100644 (file)
@@ -141,26 +141,6 @@ int dt_txn_hook_stop(const struct lu_env *env, struct thandle *th)
 }
 EXPORT_SYMBOL(dt_txn_hook_stop);
 
-void dt_txn_hook_commit(struct thandle *th)
-{
-       struct dt_txn_callback *cb;
-
-       if (th->th_local)
-               return;
-
-       list_for_each_entry(cb, &th->th_dev->dd_txn_callbacks,
-                           dtc_linkage) {
-               /*
-                * Right now, the bottom device (OSD) will use this hook
-                * commit to notify OSP, so we do not check and replace
-                * the thandle to top thandle now
-                */
-               if (cb->dtc_txn_commit)
-                       cb->dtc_txn_commit(th, cb->dtc_cookie);
-       }
-}
-EXPORT_SYMBOL(dt_txn_hook_commit);
-
 int dt_device_init(struct dt_device *dev, struct lu_device_type *t)
 {
        INIT_LIST_HEAD(&dev->dd_txn_callbacks);
@@ -1255,6 +1235,9 @@ static void dt_sysfs_release(struct kobject *kobj)
        struct dt_device *dt = container_of(kobj, struct dt_device,
                                            dd_kobj);
 
+       debugfs_remove_recursive(dt->dd_debugfs_entry);
+       dt->dd_debugfs_entry = NULL;
+
        complete(&dt->dd_kobj_unregister);
 }
 
@@ -1263,9 +1246,6 @@ int dt_tunables_fini(struct dt_device *dt)
        if (!dt)
                return -EINVAL;
 
-       if (!IS_ERR_OR_NULL(dt->dd_debugfs_entry))
-               ldebugfs_remove(&dt->dd_debugfs_entry);
-
        if (dt->dd_def_attrs)
                sysfs_remove_files(&dt->dd_kobj, dt->dd_def_attrs);
 
@@ -1285,7 +1265,7 @@ int dt_tunables_init(struct dt_device *dt, struct obd_type *type,
        dt->dd_ktype.release = dt_sysfs_release;
 
        init_completion(&dt->dd_kobj_unregister);
-       rc = kobject_init_and_add(&dt->dd_kobj, &dt->dd_ktype, type->typ_kobj,
+       rc = kobject_init_and_add(&dt->dd_kobj, &dt->dd_ktype, &type->typ_kobj,
                                  "%s", name);
        if (rc)
                return rc;