]> git.baikalelectronics.ru Git - kernel.git/commit
md/bitmap: optimise scanning of empty bitmaps.
authorNeilBrown <neilb@suse.de>
Tue, 1 Jun 2010 09:37:33 +0000 (19:37 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 26 Jul 2010 03:21:32 +0000 (13:21 +1000)
commit27177d5b8f13bc0441879b723a43f1b174eac687
treec73e1849052f56a8f6033498f7fbd65c6259c776
parent748ecb760717caf803cb2b8c1fbaf3261cc31977
md/bitmap: optimise scanning of empty bitmaps.

A bitmap is stored as one page per 2048 bits.
If none of the bits are set, the page is not allocated.

When bitmap_get_counter finds that a page isn't allocate,
it just reports that one bit work of space isn't flagged,
rather than reporting that 2048 bits worth of space are
unflagged.
This can cause searches for flagged bits (e.g. bitmap_close_sync)
to do more work than is really necessary.

So change bitmap_get_counter (when creating) to report a number of
blocks that more accurately reports the range of the device for which
no counter currently exists.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/bitmap.c