struct thandle *txn, void *cookie);
int (*dtc_txn_stop)(const struct lu_env *env,
struct thandle *txn, void *cookie);
- void (*dtc_txn_commit)(struct thandle *txn, void *cookie);
void *dtc_cookie;
__u32 dtc_tag;
struct list_head dtc_linkage;
int dt_txn_hook_start(const struct lu_env *env,
struct dt_device *dev, struct thandle *txn);
int dt_txn_hook_stop(const struct lu_env *env, struct thandle *txn);
-void dt_txn_hook_commit(struct thandle *txn);
int dt_try_as_dir(const struct lu_env *env, struct dt_object *obj);
/* prepare transactions callbacks */
mdt->mdt_txn_cb.dtc_txn_start = NULL;
mdt->mdt_txn_cb.dtc_txn_stop = mdt_txn_stop_cb;
- mdt->mdt_txn_cb.dtc_txn_commit = NULL;
mdt->mdt_txn_cb.dtc_cookie = NULL;
mdt->mdt_txn_cb.dtc_tag = LCT_MD_THREAD;
INIT_LIST_HEAD(&mdt->mdt_txn_cb.dtc_linkage);
}
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);
if (error)
CERROR("transaction @0x%p commit error: %d\n", th, error);
- dt_txn_hook_commit(th);
-
/* call per-transaction callbacks if any */
list_for_each_entry_safe(dcb, tmp, &oh->ot_commit_dcb_list,
dcb_linkage) {
osd_dt_dev(th->th_dev)->od_svname, th, error);
}
- dt_txn_hook_commit(th);
-
/* call per-transaction callbacks if any */
list_for_each_entry_safe(dcb, tmp, &oh->ot_dcb_list, dcb_linkage) {
LASSERTF(dcb->dcb_magic == TRANS_COMMIT_CB_MAGIC,
/* prepare transactions callbacks */
lut->lut_txn_cb.dtc_txn_start = tgt_txn_start_cb;
lut->lut_txn_cb.dtc_txn_stop = tgt_txn_stop_cb;
- lut->lut_txn_cb.dtc_txn_commit = NULL;
lut->lut_txn_cb.dtc_cookie = lut;
lut->lut_txn_cb.dtc_tag = LCT_DT_THREAD | LCT_MD_THREAD;
INIT_LIST_HEAD(&lut->lut_txn_cb.dtc_linkage);