From ce7221d9311814fdfab4a7bf088453225d88da14 Mon Sep 17 00:00:00 2001 From: GangCao Date: Wed, 13 Oct 2021 16:50:35 -0400 Subject: [PATCH] bdevperf: properly rename functions and update the usage of job count There are two resources to construct. One is the job configuration and the other is the job. This patch is to properly rename the related functions. Change-Id: Ie005ed75a558b3176b183f30ef5bfdb9bef30dc2 Signed-off-by: GangCao Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9854 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris --- test/bdev/bdevperf/bdevperf.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/bdev/bdevperf/bdevperf.c b/test/bdev/bdevperf/bdevperf.c index ccc859b6d..4f41d0955 100644 --- a/test/bdev/bdevperf/bdevperf.c +++ b/test/bdev/bdevperf/bdevperf.c @@ -1449,7 +1449,7 @@ config_filename_next(const char *filename, char *out) } static void -bdevperf_construct_config_jobs(void) +bdevperf_construct_jobs(void) { char filename[BDEVPERF_CONFIG_MAX_FILENAME]; struct spdk_thread *thread; @@ -1515,7 +1515,7 @@ make_cli_job_config(const char *filename, int64_t offset, uint64_t range) } static void -bdevperf_construct_multithread_jobs(void) +bdevperf_construct_multithread_job_configs(void) { struct spdk_bdev *bdev; uint32_t i; @@ -1573,7 +1573,7 @@ bdevperf_construct_multithread_jobs(void) } static void -bdevperf_construct_jobs(void) +bdevperf_construct_job_configs(void) { struct spdk_bdev *bdev; @@ -1590,15 +1590,10 @@ bdevperf_construct_jobs(void) * which is different from other modes in that they only support global options. */ - /* Increment initial construct_jobs count so that it will never reach 0 in the middle - * of iteration. - */ - g_construct_job_count = 1; - if (g_bdevperf_conf) { goto end; } else if (g_multithread_mode) { - bdevperf_construct_multithread_jobs(); + bdevperf_construct_multithread_job_configs(); goto end; } @@ -1625,8 +1620,13 @@ bdevperf_construct_jobs(void) } end: + /* Increment initial construct_jobs count so that it will never reach 0 in the middle + * of iteration. + */ + g_construct_job_count = 1; + if (g_run_rc == 0) { - bdevperf_construct_config_jobs(); + bdevperf_construct_jobs(); } _bdevperf_construct_job_done(NULL); @@ -1865,7 +1865,7 @@ bdevperf_run(void *arg1) return; } - bdevperf_construct_jobs(); + bdevperf_construct_job_configs(); } static void @@ -1905,7 +1905,7 @@ rpc_perform_tests(struct spdk_jsonrpc_request *request, const struct spdk_json_v } g_request = request; - bdevperf_construct_jobs(); + bdevperf_construct_job_configs(); } SPDK_RPC_REGISTER("perform_tests", rpc_perform_tests, SPDK_RPC_RUNTIME)