ut/bdev: Move bdev open callbacks to other auxiliary functions

Next commits in the series will need these callbacks in other tests
that are closer to the beginning of file.

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I55e346f273f169c7894f662dcfa1f57a02024577
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469708
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Evgeniy Kochetov 2019-09-26 17:32:34 +00:00 committed by Jim Harris
parent f657669eaf
commit 437e54f7d2

View File

@ -1,8 +1,8 @@
/*-
* BSD LICENSE
*
* Copyright (c) Intel Corporation.
* All rights reserved.
* Copyright (c) Intel Corporation. All rights reserved.
* Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -416,6 +416,24 @@ get_device_stat_cb(struct spdk_bdev *bdev, struct spdk_bdev_io_stat *stat, void
*(bool *)cb_arg = true;
}
static void
bdev_open_cb1(enum spdk_bdev_event_type type, struct spdk_bdev *bdev, void *event_ctx)
{
struct spdk_bdev_desc *desc = *(struct spdk_bdev_desc **)event_ctx;
g_event_type1 = type;
spdk_bdev_close(desc);
}
static void
bdev_open_cb2(enum spdk_bdev_event_type type, struct spdk_bdev *bdev, void *event_ctx)
{
struct spdk_bdev_desc *desc = *(struct spdk_bdev_desc **)event_ctx;
g_event_type2 = type;
spdk_bdev_close(desc);
}
static void
get_device_stat_test(void)
{
@ -2000,24 +2018,6 @@ bdev_open_while_hotremove(void)
free_bdev(bdev);
}
static void
bdev_open_cb1(enum spdk_bdev_event_type type, struct spdk_bdev *bdev, void *event_ctx)
{
struct spdk_bdev_desc *desc = *(struct spdk_bdev_desc **)event_ctx;
g_event_type1 = type;
spdk_bdev_close(desc);
}
static void
bdev_open_cb2(enum spdk_bdev_event_type type, struct spdk_bdev *bdev, void *event_ctx)
{
struct spdk_bdev_desc *desc = *(struct spdk_bdev_desc **)event_ctx;
g_event_type2 = type;
spdk_bdev_close(desc);
}
static void
bdev_open_ext(void)
{