]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Fix a discard granularity calculation to work for non power of 2 block sizes.
authorJoe Thornber <ejt@redhat.com>
Mon, 18 Mar 2013 22:57:27 +0000 (09:57 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Mar 2013 22:57:27 +0000 (09:57 +1100)
commita66c52b50ee88c48e1bdc93803eaaf2f77d99321
tree4a4e33cac9a808805e42f0c816a4b8e5b434f28f
parent7e86580c092d9d6ab822944a5f92b17c75c5d188
Fix a discard granularity calculation to work for non power of 2 block sizes.

In order for thinp to passdown discard bios to the underlying data
device, the data device must have a discard granularity that is a
factor of the thinp block size.  Originally this check was done by
using bitops since the block_size was known to be a power of two.

Introduced by commit f13945d75730081830b6f3360266950e2b7c9067
("dm thin: support a non power of 2 discard_granularity").

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-thin.c