From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (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 8C604445325 for ; Fri, 10 Jul 2020 10:57:12 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id h22so5375876lji.9 for ; Fri, 10 Jul 2020 00:57:12 -0700 (PDT) From: Cyrill Gorcunov Date: Fri, 10 Jul 2020 10:56:05 +0300 Message-Id: <20200710075605.217824-6-gorcunov@gmail.com> In-Reply-To: <20200710075605.217824-1-gorcunov@gmail.com> References: <20200710075605.217824-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 5/5] qsync: sanitize txn_limbo_on_rollback List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Cc: Vladislav Shpilevoy - no need to explicit cast from void - shrink changing condition - drop unneed reference to event Signed-off-by: Cyrill Gorcunov --- src/box/txn.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/box/txn.c b/src/box/txn.c index feb9a10c6..6cd2a346e 100644 --- a/src/box/txn.c +++ b/src/box/txn.c @@ -691,13 +691,12 @@ txn_commit_nop(struct txn *txn) static int txn_limbo_on_rollback(struct trigger *trig, void *event) { - (void) event; - struct txn *txn = (struct txn *) event; + struct txn *txn = event; /* Check whether limbo has performed the cleanup. */ - if (txn->signature != TXN_SIGNATURE_ROLLBACK) - return 0; - struct txn_limbo_entry *entry = (struct txn_limbo_entry *) trig->data; - txn_limbo_abort(&txn_limbo, entry); + if (txn->signature == TXN_SIGNATURE_ROLLBACK) { + struct txn_limbo_entry *e = trig->data; + txn_limbo_abort(&txn_limbo, e); + } return 0; } -- 2.26.2