From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) (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 76221430D48 for ; Thu, 19 Mar 2020 12:07:01 +0300 (MSK) Received: by mail-lf1-f68.google.com with SMTP id j17so959781lfe.7 for ; Thu, 19 Mar 2020 02:07:01 -0700 (PDT) From: Cyrill Gorcunov Date: Thu, 19 Mar 2020 12:05:33 +0300 Message-Id: <20200319090537.5613-8-gorcunov@gmail.com> In-Reply-To: <20200319090537.5613-1-gorcunov@gmail.com> References: <20200319090537.5613-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v13 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