]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dm-thin will be most likely used with a block size that is a power of
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 24 Jul 2012 23:25:17 +0000 (09:25 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 24 Jul 2012 23:25:17 +0000 (09:25 +1000)
commit627fc1a7ce490b6dbde7d052334fe5ec141f5a3e
tree542328e709d41e08356b4305fe9a07c285cea55f
parent7c36aa20d13a6d66b0ce69907215972a832d961a
dm-thin will be most likely used with a block size that is a power of
two. So it should be optimized for this case.

This patch changes division and modulo operations to shifts and bit
masks if block size is a power of two.

A test that bi_sector is divisible by a block size is removed from
io_overlaps_block. Device mapper never sends bios that span a block
boundary. Consequently, if we tested that bi_size is equivalent to block
size, bi_sector must already be on a block boundary.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-thin.c