]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Support discards when the pool's block size is not a power of 2.
authorMike Snitzer <snitzer@redhat.com>
Sun, 14 Oct 2012 22:39:19 +0000 (09:39 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sun, 14 Oct 2012 22:39:19 +0000 (09:39 +1100)
commitccc691516e36efe5e44433041775e08ca2c06a1d
treeb4d4b52f84919a3d79a02be60b767fdd4cac75c4
parente5cb7ee28f24a657a0e8874c8fbe40c110af942f
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>
drivers/md/dm-thin.c