From 437e54f7d2115da55e6796fca8e6974fb94738b7 Mon Sep 17 00:00:00 2001 From: Evgeniy Kochetov Date: Thu, 26 Sep 2019 17:32:34 +0000 Subject: [PATCH] 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 Signed-off-by: Sasha Kotchubievsky Signed-off-by: Alexey Marchuk Change-Id: I55e346f273f169c7894f662dcfa1f57a02024577 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469708 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- test/unit/lib/bdev/bdev.c/bdev_ut.c | 40 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/test/unit/lib/bdev/bdev.c/bdev_ut.c b/test/unit/lib/bdev/bdev.c/bdev_ut.c index 3964c96cc..4b9e66fbd 100644 --- a/test/unit/lib/bdev/bdev.c/bdev_ut.c +++ b/test/unit/lib/bdev/bdev.c/bdev_ut.c @@ -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) {