Whamcloud - gitweb
libext2fs: Implement ext2fs_find_first_zero_generic_bmap().
authorSami Liedes <sami.liedes@iki.fi>
Sat, 10 Mar 2012 20:36:12 +0000 (22:36 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 25 Mar 2012 22:55:14 +0000 (18:55 -0400)
commitc1a1e7fc24d6e37f931bbb8eeb29c90243f0a55d
treecea143dad327453bd99166d501e077121df77155
parent5f7c04972fefa8198c34f231a9e8a5430705b4ab
libext2fs: Implement ext2fs_find_first_zero_generic_bmap().

This function searches a bitmap for the first zero bit within a range.
It checks if there is a bitmap backend specific implementation
available (if the relevant field in bitmap_ops is non-NULL). If not,
it uses a generic and slow method by repeatedly calling test_bmap() in
a loop. Also change ext2fs_new_inode() to use this new function.

This change in itself does not result in a large speedup, rather it
refactors the code in preparation for the introduction of a faster
find_first_zero() for bitarray based bitmaps.

Signed-off-by: Sami Liedes <sami.liedes@iki.fi>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/alloc.c
lib/ext2fs/bitops.h
lib/ext2fs/bmap64.h
lib/ext2fs/gen_bitmap64.c