git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Toon Claes <toon@iotcl.com>,
	Kristoffer Haugsbakk <code@khaugsbakk.name>
Subject: [PATCH v2 0/5] reftable: fix writing multi-level indices
Date: Thu, 1 Feb 2024 08:51:52 +0100	[thread overview]
Message-ID: <cover.1706773842.git.ps@pks.im> (raw)
In-Reply-To: <cover.1706263918.git.ps@pks.im>

[-- Attachment #1: Type: text/plain, Size: 2874 bytes --]

Hi,

this is the second version of my patch series that fixes writing of
multi-level indices. There are two minor changes compared to v1:

  - Slightly rephrased a commit message.

  - Dropped an added newline that resulted in a new hunk.

The patch series continues to build on top of jc/reftable-core-fsync.

Thanks!

Patrick

Patrick Steinhardt (5):
  reftable/reader: be more careful about errors in indexed seeks
  reftable/writer: use correct type to iterate through index entries
  reftable/writer: simplify writing index records
  reftable/writer: fix writing multi-level indices
  reftable: document reading and writing indices

 reftable/reader.c         | 30 +++++++++++++++++++
 reftable/readwrite_test.c | 56 ++++++++++++++++++++++++++++++++++
 reftable/writer.c         | 63 ++++++++++++++++++++++-----------------
 3 files changed, 122 insertions(+), 27 deletions(-)

Range-diff against v1:
1:  ecf834a299 = 1:  ecf834a299 reftable/reader: be more careful about errors in indexed seeks
2:  88541d03be = 2:  88541d03be reftable/writer: use correct type to iterate through index entries
3:  b0982baacf ! 3:  b3de0b7f3b reftable/writer: simplify writing index records
    @@ Metadata
      ## Commit message ##
         reftable/writer: simplify writing index records
     
    -    When finishing the current section we may end up writing index records
    -    for the section to the table. The logic to do so essentially copies what
    -    we already have in `writer_add_record()`, making this more complicated
    -    than it really has to be.
    +    When finishing the current section some index records might be written
    +    for the section to the table. The logic that adds these records to the
    +    writer duplicates what we already have in `writer_add_record()`, making
    +    this more complicated than it really has to be.
     
    -    Simplify the code by using `writer_add_record()` instead.
    +    Simplify the code by using `writer_add_record()` instead. While at it,
    +    drop the unneeded braces around a loop to make the code conform to our
    +    code style better.
     
         Signed-off-by: Patrick Steinhardt <ps@pks.im>
     
      ## reftable/writer.c ##
    -@@ reftable/writer.c: static int writer_finish_section(struct reftable_writer *w)
    - 		w->index = NULL;
    - 		w->index_len = 0;
    - 		w->index_cap = 0;
    -+
    - 		for (i = 0; i < idx_len; i++) {
    - 			struct reftable_record rec = {
    - 				.type = BLOCK_TYPE_INDEX,
     @@ reftable/writer.c: static int writer_finish_section(struct reftable_writer *w)
      					.idx = idx[i],
      				},
4:  9c6622c409 = 4:  89a88cf83e reftable/writer: fix writing multi-level indices
5:  7850e65878 = 5:  c3492bbd42 reftable: document reading and writing indices
-- 
2.43.GIT


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2024-02-01  7:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26 10:31 [PATCH 0/5] reftable: fix writing multi-level indices Patrick Steinhardt
2024-01-26 10:31 ` [PATCH 1/5] reftable/reader: be more careful about errors in indexed seeks Patrick Steinhardt
2024-01-26 10:31 ` [PATCH 2/5] reftable/writer: use correct type to iterate through index entries Patrick Steinhardt
2024-01-26 10:31 ` [PATCH 3/5] reftable/writer: simplify writing index records Patrick Steinhardt
2024-01-31 13:44   ` Toon Claes
2024-02-01  8:39     ` Patrick Steinhardt
2024-01-31 15:55   ` Kristoffer Haugsbakk
2024-02-01  8:39     ` Patrick Steinhardt
2024-01-26 10:31 ` [PATCH 4/5] reftable/writer: fix writing multi-level indices Patrick Steinhardt
2024-01-26 10:31 ` [PATCH 5/5] reftable: document reading and writing indices Patrick Steinhardt
2024-01-26 16:26 ` [PATCH 0/5] reftable: fix writing multi-level indices Junio C Hamano
2024-02-01  7:51 ` Patrick Steinhardt [this message]
2024-02-01  7:51   ` [PATCH v2 1/5] reftable/reader: be more careful about errors in indexed seeks Patrick Steinhardt
2024-02-01  7:52   ` [PATCH v2 2/5] reftable/writer: use correct type to iterate through index entries Patrick Steinhardt
2024-02-01  7:52   ` [PATCH v2 3/5] reftable/writer: simplify writing index records Patrick Steinhardt
2024-02-01  7:52   ` [PATCH v2 4/5] reftable/writer: fix writing multi-level indices Patrick Steinhardt
2024-02-05 23:56     ` jltobler
2024-02-06  7:01       ` Patrick Steinhardt
2024-02-01  7:52   ` [PATCH v2 5/5] reftable: document reading and writing indices Patrick Steinhardt
2024-02-06  1:43     ` jltobler
2024-02-06  7:04       ` Patrick Steinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1706773842.git.ps@pks.im \
    --to=ps@pks.im \
    --cc=code@khaugsbakk.name \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=toon@iotcl.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).