The implementation is divided into two parts: Generic extents support that implements initialize/lookup/insert/remove functions for the extents tree, and VFS support that allows methods and callbacks like ext3_get_block(), ext3_truncate(), ext3_new_block() to use extents.
In order to use the generic extents layer, the user of the generic extents layer must declare its tree via an ext3_extents_tree structure. The structure describes where the root of the tree is stored, and specifies the helper routines used to operate on it. This way one can root a tree not only in i_data as described above, but also in a separate block or in EA (Extended Attributes) storage. The helper routines described by struct ext3_extents_helpers can be used to control the block allocation needed for tree growth, journaling metadata, using different criteria of extents mergability, removing extents etc.