]> git.baikalelectronics.ru Git - kernel.git/commit
dm thin: fix non power of two discard granularity calc
authorJoe Thornber <ejt@redhat.com>
Wed, 20 Mar 2013 17:21:25 +0000 (17:21 +0000)
committerAlasdair G Kergon <agk@redhat.com>
Wed, 20 Mar 2013 17:21:25 +0000 (17:21 +0000)
commit97d9d7a3f7f47fa988d81fd54494eb511fe9b270
tree4a4e33cac9a808805e42f0c816a4b8e5b434f28f
parentf0a119c60b409135470458b03f123f39638896b0
dm thin: fix non power of two discard granularity calc

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 09b1f415cb42624c4b069c444c840df751d73802
("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