From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id EF71A441859 for ; Fri, 20 Mar 2020 11:21:19 +0300 (MSK) Received: by mail-lj1-f193.google.com with SMTP id y17so5419436ljk.12 for ; Fri, 20 Mar 2020 01:21:19 -0700 (PDT) From: Cyrill Gorcunov Date: Fri, 20 Mar 2020 11:19:52 +0300 Message-Id: <20200320081956.30650-8-gorcunov@gmail.com> In-Reply-To: <20200320081956.30650-1-gorcunov@gmail.com> References: <20200320081956.30650-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v15 07/11] box/txn: rename txn_entry_complete_cb to txn_complete_async List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml We will use this function inside wal engine right after journal redesign is complete. Signed-off-by: Cyrill Gorcunov --- src/box/txn.c | 8 ++++---- src/box/txn.h | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/box/txn.c b/src/box/txn.c index 7a2a4877e..60da5b564 100644 --- a/src/box/txn.c +++ b/src/box/txn.c @@ -462,10 +462,10 @@ txn_complete(struct txn *txn) } } -static void -txn_entry_complete_cb(struct journal_entry *entry, void *data) +void +txn_complete_async(struct journal_entry *entry, void *complete_data) { - struct txn *txn = data; + struct txn *txn = complete_data; txn->signature = entry->res; /* * Some commit/rollback triggers require for in_txn fiber @@ -487,7 +487,7 @@ txn_write_to_wal(struct txn *txn) struct journal_entry *req = journal_entry_new(txn->n_new_rows + txn->n_applier_rows, &txn->region, - txn_entry_complete_cb, + txn_complete_async, txn); if (req == NULL) { txn_rollback(txn); diff --git a/src/box/txn.h b/src/box/txn.h index b950e2e18..572c76d84 100644 --- a/src/box/txn.h +++ b/src/box/txn.h @@ -44,6 +44,7 @@ extern "C" { /** box statistics */ extern struct rmean *rmean_box; +struct journal_entry; struct engine; struct space; struct tuple; @@ -287,6 +288,12 @@ txn_commit(struct txn *txn); void txn_rollback(struct txn *txn); +/** + * Complete asynchronous transaction. + */ +void +txn_complete_async(struct journal_entry *entry, void *complete_data); + /** * Submit a transaction to the journal. * @pre txn == in_txn() -- 2.20.1