From 187e5d1c52d2ef9a96365e72fbd93115ff9c9829 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Thu, 10 Aug 2017 15:51:08 -0700 Subject: [PATCH] bdev/aio: dump filename in driver_specific JSON Change-Id: I0e8c34237acc88fb51bac56c2f99df52ec199f9b Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/373835 Tested-by: SPDK Automated Test System Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/bdev/aio/bdev_aio.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/bdev/aio/bdev_aio.c b/lib/bdev/aio/bdev_aio.c index faa061d5d..b516d80f6 100644 --- a/lib/bdev/aio/bdev_aio.c +++ b/lib/bdev/aio/bdev_aio.c @@ -40,6 +40,7 @@ #include "spdk/env.h" #include "spdk/fd.h" #include "spdk/io_channel.h" +#include "spdk/json.h" #include "spdk/util.h" #include "spdk_internal/log.h" @@ -320,11 +321,29 @@ bdev_aio_get_io_channel(void *ctx) return spdk_get_io_channel(&fdisk->fd); } + +static int +bdev_aio_dump_config_json(void *ctx, struct spdk_json_write_ctx *w) +{ + struct file_disk *fdisk = ctx; + + spdk_json_write_name(w, "aio"); + spdk_json_write_object_begin(w); + + spdk_json_write_name(w, "filename"); + spdk_json_write_string(w, fdisk->filename); + + spdk_json_write_object_end(w); + + return 0; +} + static const struct spdk_bdev_fn_table aio_fn_table = { .destruct = bdev_aio_destruct, .submit_request = bdev_aio_submit_request, .io_type_supported = bdev_aio_io_type_supported, .get_io_channel = bdev_aio_get_io_channel, + .dump_config_json = bdev_aio_dump_config_json, }; static void aio_free_disk(struct file_disk *fdisk)