From: Alex Zhuravlev Date: Thu, 7 Feb 2019 09:33:12 +0000 (+0300) Subject: LU-9706 dt: remove dt_txn_hook_commit() X-Git-Tag: 2.12.52~34 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=e763467ebe00913e8d03f855dc4b918b95099931;ds=sidebyside LU-9706 dt: remove dt_txn_hook_commit() it's not used and it's not safe as dt_txn_callback_del() and dt_txn_callback_add() can race with commit callbacks. Change-Id: Ib80b0f69be008b4f895586dde35d1a5833a1a861 Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/34212 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Patrick Farrell --- diff --git a/lustre/include/dt_object.h b/lustre/include/dt_object.h index 0c82235..aa8a65b 100644 --- a/lustre/include/dt_object.h +++ b/lustre/include/dt_object.h @@ -1928,7 +1928,6 @@ struct dt_txn_callback { 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; @@ -1940,7 +1939,6 @@ void dt_txn_callback_del(struct dt_device *dev, struct dt_txn_callback *cb); 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); diff --git a/lustre/mdt/mdt_recovery.c b/lustre/mdt/mdt_recovery.c index 8a67985..6d878d3 100644 --- a/lustre/mdt/mdt_recovery.c +++ b/lustre/mdt/mdt_recovery.c @@ -103,7 +103,6 @@ int mdt_fs_setup(const struct lu_env *env, struct mdt_device *mdt, /* 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); diff --git a/lustre/obdclass/dt_object.c b/lustre/obdclass/dt_object.c index faff31f..9cacbe8 100644 --- a/lustre/obdclass/dt_object.c +++ b/lustre/obdclass/dt_object.c @@ -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); diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index eb36066..f1f50d7 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -1707,8 +1707,6 @@ static void osd_trans_commit_cb(struct super_block *sb, 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) { diff --git a/lustre/osd-zfs/osd_handler.c b/lustre/osd-zfs/osd_handler.c index 1d82e98..b224c59 100644 --- a/lustre/osd-zfs/osd_handler.c +++ b/lustre/osd-zfs/osd_handler.c @@ -147,8 +147,6 @@ static void osd_trans_commit_cb(void *cb_data, int error) 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, diff --git a/lustre/target/tgt_main.c b/lustre/target/tgt_main.c index 448cd2e..b767d1d 100644 --- a/lustre/target/tgt_main.c +++ b/lustre/target/tgt_main.c @@ -252,7 +252,6 @@ int tgt_init(const struct lu_env *env, struct lu_target *lut, /* 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);