Explaining it won't make it pretty, but at least I can tell you what the code
does.
This is all part of the btrfs code that supports tree block sizes larger than
a page. The extent_buffer code (extent_io.c) provides a read/write api into
an extent_buffer based on offsets from the start of the multi-page buffer.
That's where the relative unsigned long comes from.
The part where I cast it to pointers is me trying to maintain type checking
throughout the code. The pointers themselves are useless, they need to be
matched with an extent_buffer to actually get to the bytes.
There are a few parts where the SETGET funcs are open coded, mostly in very
performance critical functions. Just look for lexxx_to_cpu
Btree blocks have the offset of the item header from the start of the block
and the offset of the item data. And, I'm very bad at naming.
Thanks
-chris
--