From 4e51a274dee5e2fa942f9e8f39d02d8e96f9e7a5 Mon Sep 17 00:00:00 2001 From: Andrey Kuzmin Date: Tue, 5 Jun 2018 12:11:24 +0300 Subject: [PATCH] Fix fio_plugin build for FIO_IOOPS_VERSION >= 24. Fio commit d3b07186b1d4c7c1d9adc1306407458ce41ad048 changed return type of the ioengine->queue method to a new enumeration type fio_q_status. Add preprocessor checks to ensure SPDK fio_plugin builds successfully with both current and earlier fio ioengine API version. Change-Id: Ie9eb818473c6453624d6cfe51a19c6bf0d17e334 Signed-off-by: Andrey Kuzmin Reviewed-on: https://review.gerrithub.io/413749 Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris Tested-by: SPDK Automated Test System --- examples/bdev/fio_plugin/fio_plugin.c | 8 +++++++- examples/nvme/fio_plugin/fio_plugin.c | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/examples/bdev/fio_plugin/fio_plugin.c b/examples/bdev/fio_plugin/fio_plugin.c index 60f775fd5..9da1f171e 100644 --- a/examples/bdev/fio_plugin/fio_plugin.c +++ b/examples/bdev/fio_plugin/fio_plugin.c @@ -489,7 +489,13 @@ spdk_fio_completion_cb(struct spdk_bdev_io *bdev_io, spdk_bdev_free_io(bdev_io); } -static int +#if FIO_IOOPS_VERSION >= 24 +typedef enum fio_q_status fio_q_status_t; +#else +typedef int fio_q_status_t; +#endif + +static fio_q_status_t spdk_fio_queue(struct thread_data *td, struct io_u *io_u) { int rc = 1; diff --git a/examples/nvme/fio_plugin/fio_plugin.c b/examples/nvme/fio_plugin/fio_plugin.c index 18974daa0..708fe4ed9 100644 --- a/examples/nvme/fio_plugin/fio_plugin.c +++ b/examples/nvme/fio_plugin/fio_plugin.c @@ -416,7 +416,14 @@ spdk_nvme_io_next_sge(void *ref, void **address, uint32_t *length) return 0; } -static int spdk_fio_queue(struct thread_data *td, struct io_u *io_u) +#if FIO_IOOPS_VERSION >= 24 +typedef enum fio_q_status fio_q_status_t; +#else +typedef int fio_q_status_t; +#endif + +static fio_q_status_t +spdk_fio_queue(struct thread_data *td, struct io_u *io_u) { int rc = 1; struct spdk_fio_thread *fio_thread = td->io_ops_data;