md: Allow write-intent bitmaps to have chunksize < PAGE_SIZE
authorNeilBrown <neilb@suse.de>
Tue, 31 Mar 2009 03:27:02 +0000 (14:27 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 31 Mar 2009 03:27:02 +0000 (14:27 +1100)
commit1187cf0a3c8b647d08bc86e043563c8d2a327adc
tree759515a3fdcbf962f35255f90ea6c4d7c708391a
parenteea1bf384e05b5ab747f8530c4fba9e9e6907fff
md: Allow write-intent bitmaps to have chunksize < PAGE_SIZE

md currently insists that the chunk size used for write-intent
bitmaps (the amount of data that corresponds to one chunk)
be at least one page.

The reason for this restriction is lost in the mists of time,
but a review of the code (and a vague memory) suggests that the only
problem would be related to resync.  Resync tries very hard to
work in multiples of a page, but also needs to sync with units
of a bitmap_chunk too.

This connection comes out in the bitmap_start_sync call.

So change bitmap_start_sync to always work in multiples of a page.
If the bitmap chunk size is less that one page, we flag multiple
chunks as 'syncing' and generally make them all appear to the
resync routines like one chunk.

All other code either already works with data ranges that could
span multiple chunks, or explicitly only cares about a single chunk.

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