[Tarantool-patches] [PATCH v2 3/7] journal: add journal_entry_create helper

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Jul 24 01:10:47 MSK 2020


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.
>   *
> 


More information about the Tarantool-patches mailing list