From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) (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 0BEF742EF5C for ; Fri, 26 Jun 2020 17:53:21 +0300 (MSK) Received: by mail-lf1-f66.google.com with SMTP id t9so5310350lfl.5 for ; Fri, 26 Jun 2020 07:53:21 -0700 (PDT) From: Cyrill Gorcunov Date: Fri, 26 Jun 2020 17:52:26 +0300 Message-Id: <20200626145227.1507426-5-gorcunov@gmail.com> In-Reply-To: <20200626145227.1507426-1-gorcunov@gmail.com> References: <20200626145227.1507426-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 4/5] journal: drop unused destroy method List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Cc: Vladislav Shpilevoy We never use this method so no need to waste space. In-scope-of #4842 Signed-off-by: Cyrill Gorcunov --- src/box/box.cc | 3 +-- src/box/journal.h | 9 +-------- src/box/wal.c | 3 +-- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/box/box.cc b/src/box/box.cc index dfd7dcb5a..ad76f4f00 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -364,8 +364,7 @@ recovery_journal_create(struct vclock *v) { static struct recovery_journal journal; journal_create(&journal.base, recovery_journal_write_async, - txn_complete_async, - recovery_journal_write, NULL); + txn_complete_async, recovery_journal_write); journal.vclock = v; journal_set(&journal.base); } diff --git a/src/box/journal.h b/src/box/journal.h index a3f3170ed..ebc5cb708 100644 --- a/src/box/journal.h +++ b/src/box/journal.h @@ -102,9 +102,6 @@ struct journal { /** Synchronous write */ int (*write)(struct journal *journal, struct journal_entry *entry); - - /** Journal destroy */ - void (*destroy)(struct journal *journal); }; /** @@ -169,8 +166,6 @@ journal_write_async(struct journal_entry *entry) static inline void journal_set(struct journal *new_journal) { - if (current_journal && current_journal->destroy) - current_journal->destroy(current_journal); current_journal = new_journal; } @@ -180,13 +175,11 @@ journal_create(struct journal *journal, struct journal_entry *entry), void (*write_async_cb)(struct journal_entry *entry), int (*write)(struct journal *journal, - struct journal_entry *entry), - void (*destroy)(struct journal *journal)) + struct journal_entry *entry)) { journal->write_async = write_async; journal->write_async_cb = write_async_cb; journal->write = write; - journal->destroy = destroy; } /** diff --git a/src/box/wal.c b/src/box/wal.c index b979244e3..74cc74684 100644 --- a/src/box/wal.c +++ b/src/box/wal.c @@ -417,8 +417,7 @@ wal_writer_create(struct wal_writer *writer, enum wal_mode wal_mode, wal_write_none_async : wal_write_async, wall_async_cb, wal_mode == WAL_NONE ? - wal_write_none : wal_write, - NULL); + wal_write_none : wal_write); struct xlog_opts opts = xlog_opts_default; opts.sync_is_async = true; -- 2.26.2