Whamcloud - gitweb
LU-9706 dt: remove dt_txn_hook_commit() 12/34212/3
authorAlex Zhuravlev <bzzz@whamcloud.com>
Thu, 7 Feb 2019 09:33:12 +0000 (12:33 +0300)
committerOleg Drokin <green@whamcloud.com>
Wed, 27 Feb 2019 02:02:56 +0000 (02:02 +0000)
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 <bzzz@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/34212
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
lustre/include/dt_object.h
lustre/mdt/mdt_recovery.c
lustre/obdclass/dt_object.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-zfs/osd_handler.c
lustre/target/tgt_main.c

index 0c82235..aa8a65b 100644 (file)
@@ -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);
 
index 8a67985..6d878d3 100644 (file)
@@ -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);
index faff31f..9cacbe8 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);
index eb36066..f1f50d7 100644 (file)
@@ -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) {
index 1d82e98..b224c59 100644 (file)
@@ -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,
index 448cd2e..b767d1d 100644 (file)
@@ -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);