libext4: introduce support for flexible block groups.
commitd76973c2bfdc27bfc941ad522218564772836ded
authorMaurizio Lombardi <m.lombardi85@gmail.com>
Sat, 25 Apr 2015 21:20:11 +0000 (25 23:20 +0200)
committerMaurizio Lombardi <m.lombardi85@gmail.com>
Sat, 25 Apr 2015 21:20:11 +0000 (25 23:20 +0200)
tree9263af7ed194f12698f78dbe18be9724bf9f7feb
parent7f295759166093a44a7ee1aceee7f7af5443f538
libext4: introduce support for flexible block groups.

With FLEX_BG, several block groups are tied together as one single group,
the first group of the flex_bg contains the block/inode bitmaps and the inode tables of all the other groups.
This improves metadata locality and frees up a lot of contiguous free space for extents.

- modified ext4_balloc_free_blocks() so it can free extents spanning 2 or more block groups
- with FLEX_BG the inode table, the bitmap and inode blocks of a group can reside on a different group.
    - the ext4_balloc_get_first_data_block_in_group() function has been modified to return a correct result in such a case.
    - improve the ext4_filesystem_init_block_bitmap() for the flex_bg case.
- added the ext4_filesystem_blockaddr2group() function that given a block number returns the id of the group it belongs to.
- added the ext4_filesystem_bg_get_itable_size() functions that given a group id number returns the size in blocks of its inode table.
uspace/lib/ext4/libext4_balloc.c
uspace/lib/ext4/libext4_filesystem.c
uspace/lib/ext4/libext4_filesystem.h
uspace/lib/ext4/libext4_types.h