bdev/compress: fix size of compressed bdev

Needs to be based on the compressed vol size which is smaller
than the backing io device.

Fixes issue 763

Change-Id: I917c98e86a0755e503d5ba3d4b6c02e42f9ed709
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452158
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
paul luse 2019-04-25 18:41:02 -04:00 committed by Jim Harris
parent d05c553827
commit 7bffdb2db9

View File

@ -1215,7 +1215,7 @@ vbdev_compress_claim(struct vbdev_compress *comp_bdev)
comp_bdev->comp_bdev.split_on_optimal_io_boundary = true;
comp_bdev->comp_bdev.blocklen = comp_bdev->base_bdev->blocklen;
comp_bdev->comp_bdev.blockcnt = comp_bdev->base_bdev->blockcnt;
comp_bdev->comp_bdev.blockcnt = comp_bdev->params.vol_size / comp_bdev->comp_bdev.blocklen;
/* This is the context that is passed to us when the bdev
* layer calls in so we'll save our comp_bdev node here.