aboutsummaryrefslogtreecommitdiff
path: root/reftable/table.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-04-07 15:16:18 +0200
committerJunio C Hamano <gitster@pobox.com>2025-04-07 14:53:10 -0700
commit2b3362c10d39efe09fe9ef16122df3bed5149032 (patch)
tree4f1c5cd562d3fdfce1b6dab6f846aa5c0d541014 /reftable/table.c
parentfd888311fbc95b0cbb3c9e580dc6f7277bb7bf7f (diff)
downloadgit-2b3362c10d39efe09fe9ef16122df3bed5149032.tar.xz
reftable/block: rename `block` to `block_data`
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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/table.c')
-rw-r--r--reftable/table.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/reftable/table.c b/reftable/table.c
index 7c0f1c9e6e..c86b1d4c64 100644
--- a/reftable/table.c
+++ b/reftable/table.c
@@ -320,7 +320,7 @@ static int table_iter_seek_linear(struct table_iter *ti,
* as we have more than three blocks we would have an index, so
* we would not do a linear search there anymore.
*/
- memset(&next.br.block, 0, sizeof(next.br.block));
+ memset(&next.br.block_data, 0, sizeof(next.br.block_data));
next.br.zstream = NULL;
next.br.uncompressed_data = NULL;
next.br.uncompressed_cap = 0;
@@ -526,8 +526,8 @@ int reftable_table_init_log_iterator(struct reftable_table *t,
int reftable_table_new(struct reftable_table **out,
struct reftable_block_source *source, char const *name)
{
- struct reftable_block footer = { 0 };
- struct reftable_block header = { 0 };
+ struct reftable_block_data footer = { 0 };
+ struct reftable_block_data header = { 0 };
struct reftable_table *t;
uint64_t file_size = block_source_size(source);
uint32_t read_size;
@@ -550,7 +550,7 @@ int reftable_table_new(struct reftable_table **out,
goto done;
}
- bytes_read = block_source_read_block(source, &header, 0, read_size);
+ bytes_read = block_source_read_data(source, &header, 0, read_size);
if (bytes_read < 0 || (size_t)bytes_read != read_size) {
err = REFTABLE_IO_ERROR;
goto done;
@@ -576,8 +576,8 @@ int reftable_table_new(struct reftable_table **out,
t->hash_id = 0;
t->refcount = 1;
- bytes_read = block_source_read_block(source, &footer, t->size,
- footer_size(t->version));
+ bytes_read = block_source_read_data(source, &footer, t->size,
+ footer_size(t->version));
if (bytes_read < 0 || (size_t)bytes_read != footer_size(t->version)) {
err = REFTABLE_IO_ERROR;
goto done;
@@ -590,8 +590,8 @@ int reftable_table_new(struct reftable_table **out,
*out = t;
done:
- block_source_return_block(&footer);
- block_source_return_block(&header);
+ block_source_release_data(&footer);
+ block_source_release_data(&header);
if (err) {
if (t)
reftable_free(t->name);