Re: GSoC - Designing a faster index format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 27, 2012 at 10:20 AM, elton sky <eltonsky9404@xxxxxxxxx> wrote:
> On Tue, Mar 27, 2012 at 3:19 AM, Nguyen Thai Ngoc Duy <pclouds@xxxxxxxxx> wrote:
>> The header consists of crc32 and three uint32_t, one points to the
>> root tree, one the first extension block, the last one the free list
>> at the end of the file. The rest of the file contains sizable blocks.
>> There can be free space between them. Free spaces (offset and size)
>> are recorded at the end of the file, pointed in header. The header's
>> crc32 covers the header and free list.
>
> How do you record free spaces at the end of file? Are you gonna have a
> fixed size for the index and reserve space for free spaces offsets.

A list of (offset,size) with (0,0) to terminate. No index can shrink
or expand at will. Free list is always at the end of the index.

>> A block starts with a signature (a tree block, or an extension...). A
>> tree block consists of:
>>
>>  - uint32_t tree object's size
>>  - sha-1 of tree object
>>  - crc32 of the rest of the block except tree object
>>  - maybe reference counter of a block can be refered by many blocks??
>>  - tree object (i.e. something that tree-walk.c can parse)
>
> Do you mean each block contains a tree and all its blobs? So the tree
> object here, effectively a dir, also contains files in the dir ? In
> this way, some blocks can be very big.

No, the tree object contains pathname, mode and SHA-1 of its entries,
one level only (try "git ls-tree HEAD"). If an entry is a directory
and we have not built it yet, we won't have its sha-1, so it will be
zero (similar to invalid cache-tree).

>>  - other index attributes, stored separately in the same order as in
>> tree object above, uint32_t block offset of subdirectories.
>
> There can be many sub dirs some times. But maybe not a prob.
>
> As tree object and  offset of subdirectories are variables, how do you
> make a block resizable?

If there are free space right after it, it can be expanded. Otherwise
we need to move the block elsewhere and update its parent about its
new offset, then mark where the block was as free space.
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]