[Tarantool-patches] [PATCH 4/5] journal: drop unused destroy method

Cyrill Gorcunov gorcunov at gmail.com
Fri Jun 26 17:52:26 MSK 2020


We never use this method so no need to waste space.

In-scope-of #4842

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 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



More information about the Tarantool-patches mailing list