lib/thread: Add spdk_io_device_get_name as a SPDK internal API

This is a preparation to support thread_get_io_channels RPC
in the next patch. The next patch will refer only name of struct
io_device, and so adding a helper function is better than making
struct io_device public.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9bc9dd78f71aa1e32847dc4c67eb79dae9cfbf9d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/886
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Shuhei Matsumoto 2020-03-05 17:24:06 -05:00 committed by Tomasz Zawadzki
parent 0b0f0c5415
commit eb9d8f3419
2 changed files with 8 additions and 0 deletions

View File

@ -113,4 +113,6 @@ struct spdk_thread {
const char *spdk_poller_state_str(enum spdk_poller_state state);
const char *spdk_io_device_get_name(struct io_device *dev);
#endif /* SPDK_THREAD_INTERNAL_H_ */

View File

@ -1215,6 +1215,12 @@ spdk_io_device_unregister(void *io_device, spdk_io_device_unregister_cb unregist
_spdk_io_device_free(dev);
}
const char *
spdk_io_device_get_name(struct io_device *dev)
{
return dev->name;
}
struct spdk_io_channel *
spdk_get_io_channel(void *io_device)
{