<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/reftable/blocksource.c, branch v2.51.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.51.1</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.51.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-04-07T21:53:10Z</updated>
<entry>
<title>reftable/block: rename `block` to `block_data`</title>
<updated>2025-04-07T21:53:10Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-07T13:16:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2b3362c10d39efe09fe9ef16122df3bed5149032'/>
<id>urn:sha1:2b3362c10d39efe09fe9ef16122df3bed5149032</id>
<content type='text'>
The `reftable_block` structure associates a byte slice with a block
source. As such it only holds the data of a reftable block without
actually encoding any of the details for how to access that data.

Rename the structure to instead be called `reftable_block_data`. Besides
clarifying that this really only holds data, it also allows us to rename
the `reftable_block_reader` to `reftable_block` in the next commit, as
this is the structure that actually encapsulates access to the reftable
blocks.

Rename the `struct reftable_block_reader::block` member accordingly.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable/blocksource: consolidate code into a single file</title>
<updated>2025-04-07T21:53:09Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-07T13:16:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1ac4e5e83d997887dcd051c89861292a45a3db8c'/>
<id>urn:sha1:1ac4e5e83d997887dcd051c89861292a45a3db8c</id>
<content type='text'>
The code that implements block sources is distributed across a couple of
files. Consolidate all of it into "reftable/blocksource.c" and its
accompanying header so that it is easier to locate and more self
contained.

While at it, rename some of the functions to have properly scoped names.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable: fix formatting of the license header</title>
<updated>2025-04-07T21:53:09Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-04-07T13:16:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6dcc05ffc3ead0745d19decd0e8ecd65edc9d414'/>
<id>urn:sha1:6dcc05ffc3ead0745d19decd0e8ecd65edc9d414</id>
<content type='text'>
The license headers used across the reftable library doesn't follow our
typical coding style for multi-line comments. Fix it.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable/basics: introduce `REFTABLE_UNUSED` annotation</title>
<updated>2025-02-18T18:55:38Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-02-18T09:20:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f93b2a04243ee1a95920ae02a9423accbe1c3719'/>
<id>urn:sha1:f93b2a04243ee1a95920ae02a9423accbe1c3719</id>
<content type='text'>
Introduce the `REFTABLE_UNUSED` annotation and replace all existing
users of `UNUSED` in the reftable library to use the new macro instead.

Note that we unconditionally define `MAYBE_UNUSED` in the exact same
way, so doing so unconditionally for `REFTABLE_UNUSED` should be fine,
too.

Suggested-by: Toon Claes &lt;toon@iotcl.com&gt;
Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable/blocksource: stop using `xmmap()`</title>
<updated>2025-02-18T18:55:35Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-02-18T09:20:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=70afa6fa318db517adb0cc7d4cb66260061bb684'/>
<id>urn:sha1:70afa6fa318db517adb0cc7d4cb66260061bb684</id>
<content type='text'>
We use `xmmap()` to map reftables into memory. This function has two
problems:

  - It causes us to die in case the mmap fails.

  - It ties us to the Git codebase.

Refactor the code to use mmap(3p) instead with manual error checking.
Note that this function may not be the system-provided mmap(3p), but may
point to our `git_mmap()` wrapper that emulates the syscall on systems
that do not have mmap(3p) available.

Fix `reftable_block_source_from_file()` to properly bubble up the error
code in case the map(3p) call fails.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable/blocksource: adjust `read_block()` to return `ssize_t`</title>
<updated>2025-01-21T22:20:30Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-01-20T16:17:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7c4c1cbc0b94665d6a94ac7df385459346af5265'/>
<id>urn:sha1:7c4c1cbc0b94665d6a94ac7df385459346af5265</id>
<content type='text'>
The `block_source_read_block()` function and its implementations return
an integer as a result that reflects either the number of bytes read, or
an error. As such its return type, a signed integer, isn't wrong, but it
doesn't give the reader a good hint what it actually returns.

Refactor the function to return an `ssize_t` instead, which is typical
for functions similar to read(3p) and should thus give readers a better
signal what they can expect as a result.

Adjust callers to better handle the returned value to avoid warnings
with -Wsign-compare. One of these callers is `reader_get_block()`, whose
return value is only ever used by its callers to figure out whether or
not the read was successful. So instead of bubbling up the `ssize_t`
there, too, we adapt it to only indicate success or errors.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reftable/blocksource: adapt interface name</title>
<updated>2024-10-17T20:59:56Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-10-17T04:53:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f177d491637a3771f19055cb3873bda9c163c91a'/>
<id>urn:sha1:f177d491637a3771f19055cb3873bda9c163c91a</id>
<content type='text'>
Adapt the name of the `strbuf` block source to no longer relate to this
interface, but instead to the `reftable_buf` interface.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>reftable: convert from `strbuf` to `reftable_buf`</title>
<updated>2024-10-17T20:59:56Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-10-17T04:53:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=be4c070a3c9e7c9d6836c724929ff8a365361e1a'/>
<id>urn:sha1:be4c070a3c9e7c9d6836c724929ff8a365361e1a</id>
<content type='text'>
Convert the reftable library to use the `reftable_buf` interface instead
of the `strbuf` interface. This is mostly a mechanical change via sed(1)
with some manual fixes where functions for `strbuf` and `reftable_buf`
differ. The converted code does not yet handle allocation failures. This
will be handled in subsequent commits.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>reftable/blocksource: handle allocation failures</title>
<updated>2024-10-02T14:53:54Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-10-02T10:56:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cd6a47167e068812735950b841c7174cd7cd321e'/>
<id>urn:sha1:cd6a47167e068812735950b841c7174cd7cd321e</id>
<content type='text'>
Handle allocation failures in the blocksource code.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ps/reftable-concurrent-compaction'</title>
<updated>2024-09-03T16:15:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-09-03T16:15:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=17636cdf3b0bf344a2e3090fd8bf254cf3ec0a2f'/>
<id>urn:sha1:17636cdf3b0bf344a2e3090fd8bf254cf3ec0a2f</id>
<content type='text'>
The code path for compacting reftable files saw some bugfixes
against concurrent operation.

* ps/reftable-concurrent-compaction:
  reftable/stack: fix segfault when reload with reused readers fails
  reftable/stack: reorder swapping in the reloaded stack contents
  reftable/reader: keep readers alive during iteration
  reftable/reader: introduce refcounting
  reftable/stack: fix broken refnames in `write_n_ref_tables()`
  reftable/reader: inline `reader_close()`
  reftable/reader: inline `init_reader()`
  reftable/reader: rename `reftable_new_reader()`
  reftable/stack: inline `stack_compact_range_stats()`
  reftable/blocksource: drop malloc block source
</content>
</entry>
</feed>
