blob: remove spdk_bs_io_flush_channel
This function was a nop and is not needed. lvol was calling this function when an lvol bdev gets a FLUSH I/O, but that is not needed either. So lvol will now report it does not support flush. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I92df83243f7ebce81c69040a8874891dc2ffc961 Reviewed-on: https://review.gerrithub.io/391023 Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
4c4619323d
commit
7932847300
@ -238,10 +238,6 @@ struct spdk_io_channel *spdk_bs_alloc_io_channel(struct spdk_blob_store *bs);
|
||||
|
||||
void spdk_bs_free_io_channel(struct spdk_io_channel *channel);
|
||||
|
||||
/* Force all previously completed operations on this channel to be persistent. */
|
||||
void spdk_bs_io_flush_channel(struct spdk_io_channel *channel,
|
||||
spdk_blob_op_complete cb_fn, void *cb_arg);
|
||||
|
||||
/* Write data to a blob. Offset is in pages from the beginning of the blob. */
|
||||
void spdk_bs_io_write_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
|
||||
void *payload, uint64_t offset, uint64_t length,
|
||||
|
@ -494,7 +494,6 @@ vbdev_lvol_io_type_supported(void *ctx, enum spdk_bdev_io_type io_type)
|
||||
switch (io_type) {
|
||||
case SPDK_BDEV_IO_TYPE_READ:
|
||||
case SPDK_BDEV_IO_TYPE_WRITE:
|
||||
case SPDK_BDEV_IO_TYPE_FLUSH:
|
||||
case SPDK_BDEV_IO_TYPE_RESET:
|
||||
case SPDK_BDEV_IO_TYPE_UNMAP:
|
||||
case SPDK_BDEV_IO_TYPE_WRITE_ZEROES:
|
||||
@ -595,16 +594,6 @@ lvol_write(struct spdk_lvol *lvol, struct spdk_io_channel *ch, struct spdk_bdev_
|
||||
num_pages, lvol_op_comp, task);
|
||||
}
|
||||
|
||||
static void
|
||||
lvol_flush(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
|
||||
{
|
||||
struct lvol_task *task = (struct lvol_task *)bdev_io->driver_ctx;
|
||||
|
||||
task->status = SPDK_BDEV_IO_STATUS_SUCCESS;
|
||||
|
||||
spdk_bs_io_flush_channel(ch, lvol_op_comp, task);
|
||||
}
|
||||
|
||||
static int
|
||||
lvol_reset(struct spdk_bdev_io *bdev_io)
|
||||
{
|
||||
@ -631,9 +620,6 @@ vbdev_lvol_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_
|
||||
case SPDK_BDEV_IO_TYPE_RESET:
|
||||
lvol_reset(bdev_io);
|
||||
break;
|
||||
case SPDK_BDEV_IO_TYPE_FLUSH:
|
||||
lvol_flush(ch, bdev_io);
|
||||
break;
|
||||
case SPDK_BDEV_IO_TYPE_UNMAP:
|
||||
lvol_unmap(lvol, ch, bdev_io);
|
||||
break;
|
||||
@ -687,7 +673,6 @@ _create_lvol_disk(struct spdk_lvol *lvol)
|
||||
return NULL;
|
||||
}
|
||||
bdev->product_name = "Logical Volume";
|
||||
bdev->write_cache = 1;
|
||||
bdev->blocklen = spdk_bs_get_page_size(lvol->lvol_store->blobstore);
|
||||
total_size = lvol->num_clusters * spdk_bs_get_cluster_size(lvol->lvol_store->blobstore);
|
||||
assert((total_size % bdev->blocklen) == 0);
|
||||
|
@ -2917,13 +2917,6 @@ void spdk_bs_free_io_channel(struct spdk_io_channel *channel)
|
||||
spdk_put_io_channel(channel);
|
||||
}
|
||||
|
||||
void spdk_bs_io_flush_channel(struct spdk_io_channel *channel,
|
||||
spdk_blob_op_complete cb_fn, void *cb_arg)
|
||||
{
|
||||
/* Flush is synchronous right now */
|
||||
cb_fn(cb_arg, 0);
|
||||
}
|
||||
|
||||
void spdk_bs_io_unmap_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
|
||||
uint64_t offset, uint64_t length, spdk_blob_op_complete cb_fn, void *cb_arg)
|
||||
{
|
||||
|
@ -386,11 +386,6 @@ spdk_bs_io_readv_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
|
||||
CU_ASSERT(length == g_io->u.bdev.num_blocks);
|
||||
}
|
||||
|
||||
void
|
||||
spdk_bs_io_flush_channel(struct spdk_io_channel *channel, spdk_blob_op_complete cb_fn, void *cb_arg)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
spdk_bdev_module_list_add(struct spdk_bdev_module_if *bdev_module)
|
||||
{
|
||||
@ -855,8 +850,6 @@ ut_vbdev_lvol_io_type_supported(void)
|
||||
CU_ASSERT(ret == true);
|
||||
ret = vbdev_lvol_io_type_supported(lvol, SPDK_BDEV_IO_TYPE_WRITE);
|
||||
CU_ASSERT(ret == true);
|
||||
ret = vbdev_lvol_io_type_supported(lvol, SPDK_BDEV_IO_TYPE_FLUSH);
|
||||
CU_ASSERT(ret == true);
|
||||
ret = vbdev_lvol_io_type_supported(lvol, SPDK_BDEV_IO_TYPE_RESET);
|
||||
CU_ASSERT(ret == true);
|
||||
ret = vbdev_lvol_io_type_supported(lvol, SPDK_BDEV_IO_TYPE_UNMAP);
|
||||
@ -865,6 +858,8 @@ ut_vbdev_lvol_io_type_supported(void)
|
||||
CU_ASSERT(ret == true);
|
||||
|
||||
/* Unsupported types */
|
||||
ret = vbdev_lvol_io_type_supported(lvol, SPDK_BDEV_IO_TYPE_FLUSH);
|
||||
CU_ASSERT(ret == false);
|
||||
ret = vbdev_lvol_io_type_supported(lvol, SPDK_BDEV_IO_TYPE_NVME_ADMIN);
|
||||
CU_ASSERT(ret == false);
|
||||
ret = vbdev_lvol_io_type_supported(lvol, SPDK_BDEV_IO_TYPE_NVME_IO);
|
||||
@ -880,30 +875,6 @@ ut_lvol_op_comp(void)
|
||||
CU_ASSERT(task.status == SPDK_BDEV_IO_STATUS_FAILED);
|
||||
}
|
||||
|
||||
static void
|
||||
ut_lvol_flush(void)
|
||||
{
|
||||
g_io = calloc(1, sizeof(struct spdk_bdev_io) + sizeof(struct lvol_task));
|
||||
SPDK_CU_ASSERT_FATAL(g_io != NULL);
|
||||
g_base_bdev = calloc(1, sizeof(struct spdk_bdev));
|
||||
SPDK_CU_ASSERT_FATAL(g_base_bdev != NULL);
|
||||
g_lvol = calloc(1, sizeof(struct spdk_lvol));
|
||||
SPDK_CU_ASSERT_FATAL(g_lvol != NULL);
|
||||
|
||||
g_task = (struct lvol_task *)g_io->driver_ctx;
|
||||
g_io->bdev = g_base_bdev;
|
||||
g_io->bdev->ctxt = g_lvol;
|
||||
|
||||
/* Successful flush to lvol */
|
||||
lvol_flush(g_ch, g_io);
|
||||
|
||||
CU_ASSERT(g_task->status == SPDK_BDEV_IO_STATUS_SUCCESS);
|
||||
|
||||
free(g_io);
|
||||
free(g_base_bdev);
|
||||
free(g_lvol);
|
||||
}
|
||||
|
||||
static void
|
||||
ut_lvol_read_write(void)
|
||||
{
|
||||
@ -974,7 +945,6 @@ int main(int argc, char **argv)
|
||||
CU_add_test(suite, "ut_vbdev_lvol_get_io_channel", ut_vbdev_lvol_get_io_channel) == NULL ||
|
||||
CU_add_test(suite, "ut_vbdev_lvol_io_type_supported", ut_vbdev_lvol_io_type_supported) == NULL ||
|
||||
CU_add_test(suite, "ut_lvol_op_comp", ut_lvol_op_comp) == NULL ||
|
||||
CU_add_test(suite, "ut_lvol_flush", ut_lvol_flush) == NULL ||
|
||||
CU_add_test(suite, "ut_lvol_read_write", ut_lvol_read_write) == NULL ||
|
||||
CU_add_test(suite, "ut_vbdev_lvol_submit_request", ut_vbdev_lvol_submit_request) == NULL ||
|
||||
CU_add_test(suite, "lvol_examine", ut_lvol_examine) == NULL
|
||||
|
Loading…
Reference in New Issue
Block a user