Commit Graph

4 Commits (2df733facd99261a4c462f76f72e143e803487d0)

Author SHA1 Message Date
Theodore Ts'o dff0b6a333 libext2fs: add ext2fs_find_first_set_{block,inode}_bitmap2()
Add functions which try to find the first set block or inode in a
bitmap.  This is useful when trying to allocate a range of blocks
efficiently.

Like the find_first_zero family of functions, provide a generic O(N)
search function which will be used if there is no optimized version
provided by the red-black tree or bitarray functions.

Also, expand the test cases for ext2fs_find_first_zero_*() functions.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-13 14:02:06 -05:00
Theodore Ts'o c6b006ea6c libext2fs: add ext2fs_bitcount() function
This function efficiently counts the number of bits in a block of
memory.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
2012-11-28 19:01:43 -05:00
Theodore Ts'o 46f100707c libext2fs: improve testing coverage of tst_bitmaps
Improve the test coverage of tst_bitmaps by:

   (a) adding the ability to test the legacy (32-bit) bitmap code
   (b) adding tests for ext2fs_find_first_zero_inode_bitmap2() and
       ext2fs_find_first_zero_block_bitmap2()

The recent regressions caused by the addition (and use) of
ext2fs_find_first_zero_inode_bitmap2() would have been caught if we
had added these tests first.  (Another object lesson in why unit tests
are critically important!)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-04-09 14:29:47 -04:00
Theodore Ts'o b8ad88b3e7 libext2fs: add tests for the bitmap functions
These tests allow us to be sure that the new bitmap backends are
correctly implemented.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-12-18 01:00:38 -05:00