Whamcloud - gitweb
LU-9706 dt: remove dt_txn_hook_commit() 74/34274/2
authorAlex Zhuravlev <bzzz@whamcloud.com>
Mon, 18 Feb 2019 13:10:16 +0000 (16:10 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 2 Mar 2019 01:30:31 +0000 (01:30 +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.

Lustre-change: https://review.whamcloud.com/#/c/34212/

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I1744aaa621e28cb3f7e812db5695aa42e8d596cd
Reviewed-on: https://review.whamcloud.com/34274
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Nathaniel Clark <nclark@whamcloud.com>
Reviewed-by: Oleg Drokin <green@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 7d8e702..e872981 100644 (file)
@@ -1919,7 +1919,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;
@@ -1931,7 +1930,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 ed61a2e..b445899 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 a8f144f..a48e7cb 100644 (file)
@@ -136,24 +136,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 9780d24..1b13df9 100644 (file)
@@ -1587,8 +1587,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 713ec9b..5f50144 100644 (file)
@@ -148,8 +148,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 4d39237..12f9fdc 100644 (file)
@@ -218,7 +218,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);