Resolving data_offset and data_len

Daniel Lorch daniel.lorch at epfl.ch
Wed Jun 3 13:23:59 PDT 2009


Hello,

>     Reading the data via the B-Tree is a bit confusing because data_offset 
>     in a B-Tree element is *NOT* the base offset for the data block but
>     instead the ending offset for the data block.  i.e. the offset in
>     the file for the data is actually (cursor.leaf->data_offset -
>     cursor.leaf->data_len).

What does cursor.leaf->data_len represent? Is it the data record's
length in KB? (so it would be either 16K or 64K).

Does (cursor.leaf->data_offset - cursor.leaf->data_len) represents a
*byte offset* from the beginning of the block device? Or is it a
relative value to some other value?

I am trying to figure out how hammer_vop_strategy_read() works. I have
used `xxd' to get a readable representation of my disk and I scrolled
down to the value indicated by `disk_offset', but the data I was looking
for wasn't there.

Daniel





More information about the Hammer mailing list