Commit 437e54f7 authored by Evgeniy Kochetov's avatar Evgeniy Kochetov Committed by Jim Harris
Browse files

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: default avatarEvgeniy Kochetov <evgeniik@mellanox.com>
Signed-off-by: default avatarSasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: default avatarAlexey Marchuk <alexeymar@mellanox.com>
Change-Id: I55e346f273f169c7894f662dcfa1f57a02024577
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469708


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent f657669e
Loading
Loading
Loading
Loading
+20 −20
Original line number Diff line number Diff line
/*-
 *   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)
{