-/**
- * Check if there are committed transaction
- *
- * Check if there are committed transaction in the distribute transaction
- * list, then cancel the update records for those committed transaction.
- * Because the distribute transaction in the list are sorted by batchid,
- * and cancellation will be done by batchid order, so we only check the first
- * the transaction(with lowest batchid) in the list.
- *
- * \param[in] lod lod device where cancel thread is
- *
- * \retval true if it is ready
- * \retval false if it is not ready
- */
-static bool tdtd_ready_for_cancel_log(struct target_distribute_txn_data *tdtd)
-{
- struct top_multiple_thandle *tmt = NULL;
- struct obd_device *obd = tdtd->tdtd_lut->lut_obd;
- bool ready = false;
-
- spin_lock(&tdtd->tdtd_batchid_lock);
- if (!list_empty(&tdtd->tdtd_list)) {
- tmt = list_entry(tdtd->tdtd_list.next,
- struct top_multiple_thandle, tmt_commit_list);
- if (tmt->tmt_committed &&
- (!obd->obd_recovering || (obd->obd_recovering &&
- tmt->tmt_batchid <= tdtd->tdtd_committed_batchid)))
- ready = true;
- }
- spin_unlock(&tdtd->tdtd_batchid_lock);
-
- return ready;
-}
-