bdev_fio_plugin: Replace spdk_bdev_first/next_leaf() by spdk_for_each_bdev_leaf()
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Change-Id: Icf7bd4348de200d33c242fa63f4facb9592abcaa Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16538 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
This commit is contained in:
parent
5647948681
commit
f5885db9ed
@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause
|
||||
* Copyright (C) 2017 Intel Corporation.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
*/
|
||||
|
||||
#include "spdk/stdinc.h"
|
||||
@ -593,6 +593,15 @@ spdk_fio_setup(struct thread_data *td)
|
||||
return ctx.ret;
|
||||
}
|
||||
|
||||
static int
|
||||
_spdk_fio_add_file(void *ctx, struct spdk_bdev *bdev)
|
||||
{
|
||||
struct thread_data *td = ctx;
|
||||
|
||||
add_file(td, spdk_bdev_get_name(bdev), 0, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
spdk_fio_setup_oat(void *_ctx)
|
||||
{
|
||||
@ -602,12 +611,8 @@ spdk_fio_setup_oat(void *_ctx)
|
||||
struct fio_file *f;
|
||||
|
||||
if (td->o.nr_files == 1 && strcmp(td->files[0]->file_name, "*") == 0) {
|
||||
struct spdk_bdev *bdev;
|
||||
|
||||
/* add all available bdevs as fio targets */
|
||||
for (bdev = spdk_bdev_first_leaf(); bdev; bdev = spdk_bdev_next_leaf(bdev)) {
|
||||
add_file(td, spdk_bdev_get_name(bdev), 0, 1);
|
||||
}
|
||||
spdk_for_each_bdev_leaf(td, _spdk_fio_add_file);
|
||||
}
|
||||
|
||||
for_each_file(td, f, i) {
|
||||
|
Loading…
Reference in New Issue
Block a user