+ * Update session information
+ *
+ * Update session information so tgt_txn_stop_cb()->tgt_last_rcvd_update()
+ * can be called correctly during update replay.
+ *
+ * \param[in] env execution environment.
+ * \param[in] tdtd distribute data structure of the recovering tgt.
+ * \param[in] th thandle of this update replay.
+ * \param[in] master_th master sub thandle.
+ * \param[in] ta_arg the tx arg structure to hold the update for updating
+ * reply data.
+ */
+static void update_recovery_update_ses(struct lu_env *env,
+ struct target_distribute_txn_data *tdtd,
+ struct thandle *th,
+ struct thandle *master_th,
+ struct distribute_txn_replay_req *dtrq,
+ struct tx_arg *ta_arg)
+{
+ struct tgt_session_info *tsi;
+ struct lu_target *lut = tdtd->tdtd_lut;
+ struct obd_export *export;
+ struct cfs_hash *hash;
+ struct top_thandle *top_th;
+ struct lsd_reply_data *lrd;
+ size_t size;
+
+ tsi = tgt_ses_info(env);
+ if (tsi->tsi_exp != NULL)
+ return;
+
+ size = ta_arg->u.write.buf.lb_len;
+ lrd = ta_arg->u.write.buf.lb_buf;
+ if (size != sizeof(*lrd) || lrd == NULL)
+ return;
+
+ lrd->lrd_transno = le64_to_cpu(lrd->lrd_transno);
+ lrd->lrd_xid = le64_to_cpu(lrd->lrd_xid);
+ lrd->lrd_data = le64_to_cpu(lrd->lrd_data);
+ lrd->lrd_result = le32_to_cpu(lrd->lrd_result);
+ lrd->lrd_client_gen = le32_to_cpu(lrd->lrd_client_gen);
+
+ if (lrd->lrd_transno != tgt_th_info(env)->tti_transno)
+ return;
+
+ hash = cfs_hash_getref(lut->lut_obd->obd_gen_hash);
+ if (hash == NULL)
+ return;
+
+ export = cfs_hash_lookup(hash, &lrd->lrd_client_gen);
+ if (export == NULL) {
+ cfs_hash_putref(hash);
+ return;
+ }
+
+ tsi->tsi_exp = export;
+ tsi->tsi_xid = lrd->lrd_xid;
+ tsi->tsi_opdata = lrd->lrd_data;
+ tsi->tsi_result = lrd->lrd_result;
+ tsi->tsi_client_gen = lrd->lrd_client_gen;
+ dtrq->dtrq_xid = lrd->lrd_xid;
+ top_th = container_of(th, struct top_thandle, tt_super);
+ top_th->tt_master_sub_thandle = master_th;
+ cfs_hash_putref(hash);
+}
+
+/**