#
af419b0e |
|
13-Aug-2017 |
hyche <cvghy116@gmail.com> |
BTRFS: Implement ExtentAllocator There are 4 new classes, structs: * CachedExtent, is a AVLTreeNode, caches the extent locating in extent tree, a extent can be free, allocated, metadata or a data extent. It also hold a references count, that is incremented each time a new extent refer to it (COW) and item data, that is only for allocated extent (NULL for free). * CachedTreeExtent, is a AVLTree, cache the whole extent tree and has CachedExtent as its node. * BlockGroup represents the group of extents that represent the region for each type of allocated extent. For example, region for data extents, metada blocks. It responsible for inserting nodes in CachedTreeExtent. * And the final, ExtentAllocator it knows how to allocate/deallocate extents, but for now only the allocating is implemented, actually allocating and deallocating works are already implemented, they are in functions _AddFreeExtent, _AddAllocatedExtent in CachedTreeExtent. However the deallocating is not needed for now, so it will be finished later then. Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
|