bdev: remove spdk_bdev thin_provisioning flag
Blockdevs already indicate support for unmap via spdk_bdev_io_type_supported(bdev, SPDK_BDEV_IO_TYPE_UNMAP). Change-Id: I634f27a281fd900bb3a6da2e4ff8a74e43579578 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
4c9645b555
commit
22b6098965
@ -102,9 +102,6 @@ struct spdk_bdev {
|
||||
*/
|
||||
int need_aligned_buffer;
|
||||
|
||||
/** thin provisioning, not used at the moment */
|
||||
int thin_provisioning;
|
||||
|
||||
/** function table for all LUN ops */
|
||||
const struct spdk_bdev_fn_table *fn_table;
|
||||
|
||||
|
@ -403,7 +403,6 @@ struct spdk_bdev *create_malloc_disk(uint64_t num_blocks, uint32_t block_size)
|
||||
mdisk->disk.write_cache = 1;
|
||||
mdisk->disk.blocklen = block_size;
|
||||
mdisk->disk.blockcnt = num_blocks;
|
||||
mdisk->disk.thin_provisioning = 1;
|
||||
mdisk->disk.max_unmap_bdesc_count = MALLOC_MAX_UNMAP_BDESC;
|
||||
|
||||
mdisk->disk.ctxt = mdisk;
|
||||
|
@ -942,7 +942,6 @@ nvme_ctrlr_create_bdevs(struct nvme_ctrlr *nvme_ctrlr)
|
||||
* if nvme controller supports
|
||||
* DataSet Management command.
|
||||
*/
|
||||
bdev->disk.thin_provisioning = 1;
|
||||
bdev->disk.max_unmap_bdesc_count = NVME_DEFAULT_MAX_UNMAP_BDESC_COUNT;
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,6 @@ vbdev_split_create(struct spdk_bdev *base_bdev, uint64_t split_count, uint64_t s
|
||||
d->disk.blocklen = base_bdev->blocklen;
|
||||
d->disk.write_cache = base_bdev->write_cache;
|
||||
d->disk.need_aligned_buffer = base_bdev->need_aligned_buffer;
|
||||
d->disk.thin_provisioning = base_bdev->thin_provisioning;
|
||||
d->disk.max_unmap_bdesc_count = base_bdev->max_unmap_bdesc_count;
|
||||
|
||||
/* Append partition number to the base bdev's name, e.g. Malloc0 -> Malloc0p0 */
|
||||
|
@ -215,7 +215,7 @@ spdk_bdev_scsi_inquiry(struct spdk_bdev *bdev, struct spdk_scsi_task *task,
|
||||
/* SBC Block Device Characteristics */
|
||||
vpage->params[8] = 0xb1;
|
||||
len = 9;
|
||||
if (bdev->thin_provisioning) {
|
||||
if (spdk_bdev_io_type_supported(bdev, SPDK_BDEV_IO_TYPE_UNMAP)) {
|
||||
/* SBC Thin Provisioning */
|
||||
vpage->params[9] = 0xb2;
|
||||
len++;
|
||||
@ -539,7 +539,7 @@ spdk_bdev_scsi_inquiry(struct spdk_bdev *bdev, struct spdk_scsi_task *task,
|
||||
|
||||
len = 20 - hlen;
|
||||
|
||||
if (bdev->thin_provisioning) {
|
||||
if (spdk_bdev_io_type_supported(bdev, SPDK_BDEV_IO_TYPE_UNMAP)) {
|
||||
/*
|
||||
* MAXIMUM UNMAP LBA COUNT: indicates the
|
||||
* maximum number of LBAs that may be
|
||||
@ -620,7 +620,7 @@ spdk_bdev_scsi_inquiry(struct spdk_bdev *bdev, struct spdk_scsi_task *task,
|
||||
}
|
||||
|
||||
case SPDK_SPC_VPD_BLOCK_THIN_PROVISION: {
|
||||
if (!bdev->thin_provisioning) {
|
||||
if (spdk_bdev_io_type_supported(bdev, SPDK_BDEV_IO_TYPE_UNMAP)) {
|
||||
SPDK_ERRLOG("unsupported INQUIRY VPD page 0x%x\n", pc);
|
||||
goto inq_error;
|
||||
}
|
||||
@ -1622,7 +1622,7 @@ spdk_bdev_scsi_process_block(struct spdk_bdev *bdev,
|
||||
* The position of TPE bit is the 7th bit in 14th byte
|
||||
* in READ CAPACITY (16) parameter data.
|
||||
*/
|
||||
if (bdev->thin_provisioning) {
|
||||
if (spdk_bdev_io_type_supported(bdev, SPDK_BDEV_IO_TYPE_UNMAP)) {
|
||||
buffer[14] |= 1 << 7;
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ bdevperf_construct_targets(void)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (g_unmap && !bdev->thin_provisioning) {
|
||||
if (g_unmap && !spdk_bdev_io_type_supported(bdev, SPDK_BDEV_IO_TYPE_UNMAP)) {
|
||||
printf("Skipping %s because it does not support unmap\n", bdev->name);
|
||||
bdev = spdk_bdev_next(bdev);
|
||||
continue;
|
||||
|
@ -68,6 +68,13 @@ spdk_free(void *buf)
|
||||
free(buf);
|
||||
}
|
||||
|
||||
bool
|
||||
spdk_bdev_io_type_supported(struct spdk_bdev *bdev, enum spdk_bdev_io_type io_type)
|
||||
{
|
||||
abort();
|
||||
return false;
|
||||
}
|
||||
|
||||
int
|
||||
spdk_bdev_free_io(struct spdk_bdev_io *bdev_io)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user