From e09174b1eb9b9f64e3652a6042a4c23e00f8bd4c Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 26 Jun 2017 12:26:26 -0700 Subject: [PATCH] nvme/fio_plugin: fix declaration after statement Change-Id: I41c67fc3df3a7823765929351eef9b159415490d Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/367125 Reviewed-by: Ben Walker --- examples/nvme/fio_plugin/fio_plugin.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/examples/nvme/fio_plugin/fio_plugin.c b/examples/nvme/fio_plugin/fio_plugin.c index fde9a2fd8..ac510bb93 100644 --- a/examples/nvme/fio_plugin/fio_plugin.c +++ b/examples/nvme/fio_plugin/fio_plugin.c @@ -346,6 +346,9 @@ static int spdk_fio_queue(struct thread_data *td, struct io_u *io_u) struct spdk_fio_request *fio_req = io_u->engine_data; struct spdk_fio_qpair *fio_qpair; struct spdk_nvme_ns *ns = NULL; + uint32_t block_size; + uint64_t lba; + uint32_t lba_count; /* Find the namespace that corresponds to the file in the io_u */ fio_qpair = fio_thread->fio_qpair; @@ -360,9 +363,9 @@ static int spdk_fio_queue(struct thread_data *td, struct io_u *io_u) return FIO_Q_COMPLETED; } - uint32_t block_size = spdk_nvme_ns_get_sector_size(ns); - uint64_t lba = io_u->offset / block_size; - uint32_t lba_count = io_u->xfer_buflen / block_size; + block_size = spdk_nvme_ns_get_sector_size(ns); + lba = io_u->offset / block_size; + lba_count = io_u->xfer_buflen / block_size; switch (io_u->ddir) { case DDIR_READ: @@ -420,9 +423,11 @@ static int spdk_fio_getevents(struct thread_data *td, unsigned int min, } if (t) { + uint64_t elapse; + clock_gettime(CLOCK_MONOTONIC_RAW, &t1); - uint64_t elapse = ((t1.tv_sec - t0.tv_sec) * 1000000000L) - + t1.tv_nsec - t0.tv_nsec; + elapse = ((t1.tv_sec - t0.tv_sec) * 1000000000L) + + t1.tv_nsec - t0.tv_nsec; if (elapse > timeout) { break; }