-
-/* Update last_rcvd records with the latest transaction data */
-int ofd_txn_stop_cb(const struct lu_env *env, struct thandle *txn,
- void *cookie)
-{
- struct ofd_device *ofd = cookie;
- struct ofd_thread_info *info = ofd_info(env);
- struct dt_object *obj;
- struct tgt_session_info *tsi;
- bool echo_client;
- int rc;
-
- ENTRY;
-
- if (env->le_ses == NULL || info->fti_exp == NULL)
- RETURN(0);
-
- tsi = tgt_ses_info(env);
-
- echo_client = (tgt_ses_req(tsi) == NULL);
-
- if (info->fti_has_trans && !echo_client) {
- if (info->fti_mult_trans == 0) {
- CERROR("More than one transaction "LPU64"\n",
- info->fti_transno);
- RETURN(0);
- }
- /* we need another transno to be assigned */
- info->fti_transno = 0;
- } else if (txn->th_result == 0) {
- info->fti_has_trans = 1;
- }
-
- /** VBR: set new versions */
- if (info->fti_obj != NULL)
- obj = ofd_object_child(info->fti_obj);
- else
- obj = NULL;
-
- if (unlikely(echo_client)) /* echo client special case */
- rc = tgt_last_rcvd_update_echo(env, &ofd->ofd_lut, obj, txn,
- tsi->tsi_exp);
- else
- rc = tgt_last_rcvd_update(env, &ofd->ofd_lut, obj, 0, txn,
- tgt_ses_req(tsi));
- RETURN(rc);
-}
-