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.

This is a cherry-pick of commit 4e51a274de from master.

Change-Id: Ie7b696c9c410fa5b85d0487bbf99e8e5f1f4a886
Signed-off-by: Andrey Kuzmin <andrey.v.kuzmin@gmail.com>
Reviewed-on: https://review.gerrithub.io/413749
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-on: https://review.gerrithub.io/414057
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Andrey Kuzmin 2018-06-05 12:11:24 +03:00 committed by Daniel Verkamp
parent 16c8d766b5
commit 94f3053de3
2 changed files with 15 additions and 2 deletions

View File

@ -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;

View File

@ -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;