bdevperf: Always pass the submitting task to bdevperf_submit_single()
Extract bdevperf_target_get_task() from bdevperf_submit_single(). Then inline the contents of bdevperf_prep_task() into bdevperf_submit_single() and remove bdevperf_prep_task(). These two patches simplify a little weird nesting and parameter passing of bdevperf_submit_single(). Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I37f4ca732d6d9479553365cd612b90dec51e2228 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478690 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Seth Howell <seth.howell@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
50b79fa639
commit
e4e4a96543
@ -792,9 +792,8 @@ bdevperf_target_get_task(struct io_target *target)
|
||||
static __thread unsigned int seed = 0;
|
||||
|
||||
static void
|
||||
bdevperf_prep_task(struct bdevperf_task *task)
|
||||
bdevperf_submit_single(struct io_target *target, struct bdevperf_task *task)
|
||||
{
|
||||
struct io_target *target = task->target;
|
||||
uint64_t offset_in_ios;
|
||||
|
||||
if (g_is_random) {
|
||||
@ -843,21 +842,14 @@ bdevperf_prep_task(struct bdevperf_task *task)
|
||||
bdevperf_submit_task(task);
|
||||
}
|
||||
|
||||
static void
|
||||
bdevperf_submit_single(struct io_target *target, struct bdevperf_task *task)
|
||||
{
|
||||
if (!task) {
|
||||
task = bdevperf_target_get_task(target);
|
||||
}
|
||||
|
||||
bdevperf_prep_task(task);
|
||||
}
|
||||
|
||||
static void
|
||||
bdevperf_submit_io(struct io_target *target, int queue_depth)
|
||||
{
|
||||
struct bdevperf_task *task;
|
||||
|
||||
while (queue_depth-- > 0) {
|
||||
bdevperf_submit_single(target, NULL);
|
||||
task = bdevperf_target_get_task(target);
|
||||
bdevperf_submit_single(target, task);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user