diff --git a/include/spdk/bdev.h b/include/spdk/bdev.h index 3e995b6ed0..cd0117ca5c 100644 --- a/include/spdk/bdev.h +++ b/include/spdk/bdev.h @@ -84,23 +84,6 @@ enum spdk_bdev_io_type { SPDK_BDEV_IO_TYPE_RESET, }; -/** Blockdev reset operation type */ -enum spdk_bdev_reset_type { - /** - * A hard reset indicates that the blockdev layer should not - * invoke the completion callback for I/Os issued before the - * reset is issued but completed after the reset is complete. - */ - SPDK_BDEV_RESET_HARD, - - /** - * A soft reset indicates that the blockdev layer should still - * invoke the completion callback for I/Os issued before the - * reset is issued but completed after the reset is complete. - */ - SPDK_BDEV_RESET_SOFT, -}; - /** * Block device completion callback * @@ -233,7 +216,7 @@ struct spdk_bdev_io *spdk_bdev_flush(struct spdk_bdev *bdev, struct spdk_io_chan spdk_bdev_io_completion_cb cb, void *cb_arg); int spdk_bdev_free_io(struct spdk_bdev_io *bdev_io); int spdk_bdev_reset(struct spdk_bdev *bdev, struct spdk_io_channel *ch, - enum spdk_bdev_reset_type, spdk_bdev_io_completion_cb cb, void *cb_arg); + spdk_bdev_io_completion_cb cb, void *cb_arg); struct spdk_io_channel *spdk_bdev_get_io_channel(struct spdk_bdev *bdev); /** diff --git a/include/spdk_internal/bdev.h b/include/spdk_internal/bdev.h index 6a1eb93c46..02df247686 100644 --- a/include/spdk_internal/bdev.h +++ b/include/spdk_internal/bdev.h @@ -285,9 +285,6 @@ struct spdk_bdev_io { /** Represents the number of bytes to be flushed, starting at offset. */ uint64_t length; } flush; - struct { - enum spdk_bdev_reset_type type; - } reset; } u; /** Status for the IO */ diff --git a/lib/bdev/bdev.c b/lib/bdev/bdev.c index 4499c1fa74..feabb2af3c 100644 --- a/lib/bdev/bdev.c +++ b/lib/bdev/bdev.c @@ -912,7 +912,6 @@ spdk_bdev_flush(struct spdk_bdev *bdev, struct spdk_io_channel *ch, int spdk_bdev_reset(struct spdk_bdev *bdev, struct spdk_io_channel *ch, - enum spdk_bdev_reset_type reset_type, spdk_bdev_io_completion_cb cb, void *cb_arg) { struct spdk_bdev_io *bdev_io; @@ -928,7 +927,6 @@ spdk_bdev_reset(struct spdk_bdev *bdev, struct spdk_io_channel *ch, bdev_io->ch = channel; bdev_io->type = SPDK_BDEV_IO_TYPE_RESET; - bdev_io->u.reset.type = reset_type; spdk_bdev_io_init(bdev_io, bdev, cb_arg, cb); rc = spdk_bdev_io_submit(bdev_io); @@ -1006,10 +1004,8 @@ spdk_bdev_io_complete(struct spdk_bdev_io *bdev_io, enum spdk_bdev_io_status sta if (bdev_io->type == SPDK_BDEV_IO_TYPE_RESET) { /* Successful reset */ if (status == SPDK_BDEV_IO_STATUS_SUCCESS) { - /* Increase the blockdev generation if it is a hard reset */ - if (bdev_io->u.reset.type == SPDK_BDEV_RESET_HARD) { - bdev_io->bdev->gencnt++; - } + /* Increase the blockdev generation */ + bdev_io->bdev->gencnt++; } } else { /* diff --git a/lib/bdev/error/vbdev_error.c b/lib/bdev/error/vbdev_error.c index 3d7c43b332..5909e05522 100644 --- a/lib/bdev/error/vbdev_error.c +++ b/lib/bdev/error/vbdev_error.c @@ -78,9 +78,7 @@ vbdev_error_reset(struct vbdev_error_disk *error_disk, struct spdk_bdev_io *bdev * since the spdk_bdev_io_complete() path that normally updates it will not execute * after we resubmit the I/O to the base_bdev. */ - if (bdev_io->u.reset.type == SPDK_BDEV_RESET_HARD) { - error_disk->disk.gencnt++; - } + error_disk->disk.gencnt++; } static void diff --git a/lib/bdev/split/vbdev_split.c b/lib/bdev/split/vbdev_split.c index ff874ecce3..d0d9d60092 100644 --- a/lib/bdev/split/vbdev_split.c +++ b/lib/bdev/split/vbdev_split.c @@ -104,9 +104,7 @@ split_reset(struct split_disk *split_disk, struct spdk_bdev_io *bdev_io) * since the spdk_bdev_io_complete() path that normally updates it will not execute * after we resubmit the I/O to the base_bdev. */ - if (bdev_io->u.reset.type == SPDK_BDEV_RESET_HARD) { - split_disk->disk.gencnt++; - } + split_disk->disk.gencnt++; } static void diff --git a/lib/scsi/scsi_bdev.c b/lib/scsi/scsi_bdev.c index 4a2c9644bd..e42cf23776 100644 --- a/lib/scsi/scsi_bdev.c +++ b/lib/scsi/scsi_bdev.c @@ -1954,6 +1954,6 @@ spdk_bdev_scsi_execute(struct spdk_bdev *bdev, struct spdk_scsi_task *task) int spdk_bdev_scsi_reset(struct spdk_bdev *bdev, struct spdk_scsi_task *task) { - return spdk_bdev_reset(bdev, task->ch, SPDK_BDEV_RESET_SOFT, + return spdk_bdev_reset(bdev, task->ch, spdk_bdev_scsi_task_complete_mgmt, task); } diff --git a/test/lib/bdev/bdevio/bdevio.c b/test/lib/bdev/bdevio/bdevio.c index 35b86a11ff..31c44cba57 100644 --- a/test/lib/bdev/bdevio/bdevio.c +++ b/test/lib/bdev/bdevio/bdevio.c @@ -656,11 +656,10 @@ static void __blockdev_reset(void *arg1, void *arg2) { struct bdevio_request *req = arg1; - enum spdk_bdev_reset_type *reset_type = arg2; struct io_target *target = req->target; int rc; - rc = spdk_bdev_reset(target->bdev, target->ch, *reset_type, quick_test_complete, NULL); + rc = spdk_bdev_reset(target->bdev, target->ch, quick_test_complete, NULL); if (rc < 0) { g_completion_success = false; wake_ut_thread(); @@ -668,7 +667,7 @@ __blockdev_reset(void *arg1, void *arg2) } static void -blockdev_reset(struct io_target *target, enum spdk_bdev_reset_type reset_type) +blockdev_reset(struct io_target *target) { struct bdevio_request req; @@ -676,7 +675,7 @@ blockdev_reset(struct io_target *target, enum spdk_bdev_reset_type reset_type) g_completion_success = false; - execute_spdk_function(__blockdev_reset, &req, &reset_type); + execute_spdk_function(__blockdev_reset, &req, NULL); } static void @@ -686,10 +685,7 @@ blockdev_test_reset(void) target = g_io_targets; while (target != NULL) { - blockdev_reset(target, SPDK_BDEV_RESET_HARD); - CU_ASSERT_EQUAL(g_completion_success, true); - - blockdev_reset(target, SPDK_BDEV_RESET_SOFT); + blockdev_reset(target); CU_ASSERT_EQUAL(g_completion_success, true); target = target->next; diff --git a/test/lib/bdev/bdevperf/bdevperf.c b/test/lib/bdev/bdevperf/bdevperf.c index ec78b25c06..9dbbd7a226 100644 --- a/test/lib/bdev/bdevperf/bdevperf.c +++ b/test/lib/bdev/bdevperf/bdevperf.c @@ -394,7 +394,7 @@ reset_target(void *arg) /* Do reset. */ rte_mempool_get(task_pool, (void **)&task); task->target = target; - spdk_bdev_reset(target->bdev, target->ch, SPDK_BDEV_RESET_SOFT, + spdk_bdev_reset(target->bdev, target->ch, reset_cb, task); } diff --git a/test/lib/scsi/scsi_bdev/scsi_bdev_ut.c b/test/lib/scsi/scsi_bdev/scsi_bdev_ut.c index cfb7349526..1ece298223 100644 --- a/test/lib/scsi/scsi_bdev/scsi_bdev_ut.c +++ b/test/lib/scsi/scsi_bdev/scsi_bdev_ut.c @@ -225,7 +225,6 @@ spdk_bdev_unmap(struct spdk_bdev *bdev, struct spdk_io_channel *ch, int spdk_bdev_reset(struct spdk_bdev *bdev, struct spdk_io_channel *ch, - enum spdk_bdev_reset_type reset_type, spdk_bdev_io_completion_cb cb, void *cb_arg) { return 0;