Mike Snitzer 28eed34e76 dm thin: support discard with non power of two block size
Support discards when the pool's block size is not a power of 2.
The block layer assumes discard_granularity is a power of 2 (in
blkdev_issue_discard), so we set this to the largest power of 2 that is
a divides into the number of sectors in each block, but never less than
DATA_DEV_BLOCK_SIZE_MIN_SECTORS.

This patch eliminates the "Discard support must be disabled when the
block size is not a power of 2" constraint that was imposed in commit
55f2b8b ("dm thin: support for non power of 2 pool blocksize").  That
commit was incomplete: using a block size that is not a power of 2
shouldn't mean disabling discard support on the device completely.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2012-10-12 21:02:07 +01:00
..
2012-10-02 19:01:32 -07:00
2012-10-02 17:26:42 -07:00
2012-10-07 20:55:16 +09:00
2012-09-26 22:28:21 -04:00
2012-09-22 10:29:19 +01:00
2012-10-08 06:33:44 +09:00
2012-09-24 10:07:40 -07:00
2012-10-09 16:11:46 +09:00
2012-10-07 17:29:24 +09:00
2012-10-10 20:15:24 +09:00
2012-10-10 10:58:42 +09:00
2012-10-03 09:44:08 -07:00
2012-10-09 16:11:46 +09:00
2012-10-01 19:11:38 -07:00
2012-10-07 17:29:24 +09:00
2012-10-10 20:15:24 +09:00
2012-10-01 19:11:38 -07:00
2012-10-10 20:15:24 +09:00
2012-10-01 12:09:59 -07:00
2012-10-01 18:46:13 -07:00