Re: [PATCH 13/23] midx: write object id fanout chunk
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Jun 21, 2018, 19:49 UTC
- Message-ID
- <8e7c491c-81d5-abf0-dae6-6d605afb1153@gmail.com>
- In-Reply-To
- <CACsJy8DW8foQ8+KDdjf4g_3UNi5oSqJyHYo5d9j4cth_yBXDCA@mail.gmail.com>
On 6/9/2018 1:28 PM, Duy Nguyen wrote:
Show 16 quoted lines
> On Thu, Jun 7, 2018 at 4:06 PM Derrick Stolee <stolee@gmail.com> wrote:
>> @@ -117,9 +123,13 @@ struct midxed_git *load_midxed_git(const char *object_dir)
>> die("MIDX missing required pack lookup chunk");
>> if (!m->chunk_pack_names)
>> die("MIDX missing required pack-name chunk");
>> + if (!m->chunk_oid_fanout)
>> + die("MIDX missing required OID fanout chunk");
> _()
>
>> @@ -501,9 +540,13 @@ int write_midx_file(const char *object_dir)
>> chunk_offsets[cur_chunk] = chunk_offsets[cur_chunk - 1] + nr_packs * sizeof(uint32_t);
>>
>> cur_chunk++;
>> - chunk_ids[cur_chunk] = MIDX_CHUNKID_OIDLOOKUP;
>> + chunk_ids[cur_chunk] = MIDX_CHUNKID_OIDFANOUT;
> Err.. mistake?Not a mistake, just a side-effect of inserting the fanout before the lookup.
The commits are in this order because we need to construct the list before we build the fanout, but it makes sense to have the smaller fanout chunk before the lookup chunk.
Show 13 quoted lines
> >> chunk_offsets[cur_chunk] = chunk_offsets[cur_chunk - 1] + pack_name_concat_len; >> >> + cur_chunk++; >> + chunk_ids[cur_chunk] = MIDX_CHUNKID_OIDLOOKUP; > Same here. > >> + chunk_offsets[cur_chunk] = chunk_offsets[cur_chunk - 1] + MIDX_CHUNK_FANOUT_SIZE; >> + >> cur_chunk++; >> chunk_ids[cur_chunk] = 0; >> chunk_offsets[cur_chunk] = chunk_offsets[cur_chunk - 1] + nr_entries * MIDX_HASH_LEN; >>