From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 9BD16445320 for ; Fri, 24 Jul 2020 01:10:48 +0300 (MSK) References: <20200723122942.196011-1-gorcunov@gmail.com> <20200723122942.196011-4-gorcunov@gmail.com> From: Vladislav Shpilevoy Message-ID: Date: Fri, 24 Jul 2020 00:10:47 +0200 MIME-Version: 1.0 In-Reply-To: <20200723122942.196011-4-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v2 3/7] journal: add journal_entry_create helper List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov , tml Thanks for the patch! > diff --git a/src/box/journal.h b/src/box/journal.h > index 74a5eb050..fc33fd6f0 100644 > --- a/src/box/journal.h > +++ b/src/box/journal.h > @@ -80,6 +80,27 @@ struct journal_entry { > > struct region; > > +/** > + * Initialize a new journal entry. > + */ > +static inline void > +journal_entry_create(struct journal_entry *entry, size_t n_rows, > + size_t approx_len, > + void (*write_async_cb)(struct journal_entry *entry), > + void *complete_data) > +{ > + /* > + * fifo member is left untouched because > + * it is used by the journal engine internally, > + * no need to waste time here. fifo -> Fifo. Also you can use up to 80 symbols for comments now. No need to keep them tight. Here and in all other new places. > + */ > + entry->write_async_cb = write_async_cb; > + entry->complete_data = complete_data; > + entry->approx_len = approx_len; > + entry->n_rows = n_rows; > + entry->res = -1; > +} > + > /** > * Create a new journal entry. > * >