xref: /spdk/module/event/subsystems/bdev/bdev.c (revision fecffda6ecf8853b82edccde429b68252f0a62c5)
1 /*   SPDX-License-Identifier: BSD-3-Clause
2  *   Copyright (C) 2016 Intel Corporation.
3  *   All rights reserved.
4  */
5 
6 #include "spdk/stdinc.h"
7 
8 #include "spdk/bdev.h"
9 #include "spdk/env.h"
10 #include "spdk/thread.h"
11 
12 #include "spdk_internal/init.h"
13 #include "spdk/env.h"
14 
15 static void
16 bdev_initialize_complete(void *cb_arg, int rc)
17 {
18 	spdk_subsystem_init_next(rc);
19 }
20 
21 static void
22 bdev_subsystem_initialize(void)
23 {
24 	spdk_bdev_initialize(bdev_initialize_complete, NULL);
25 }
26 
27 static void
28 bdev_subsystem_finish_done(void *cb_arg)
29 {
30 	spdk_subsystem_fini_next();
31 }
32 
33 static void
34 bdev_subsystem_finish(void)
35 {
36 	spdk_bdev_finish(bdev_subsystem_finish_done, NULL);
37 }
38 
39 static void
40 bdev_subsystem_config_json(struct spdk_json_write_ctx *w)
41 {
42 	spdk_bdev_subsystem_config_json(w);
43 }
44 
45 static struct spdk_subsystem g_spdk_subsystem_bdev = {
46 	.name = "bdev",
47 	.init = bdev_subsystem_initialize,
48 	.fini = bdev_subsystem_finish,
49 	.write_config_json = bdev_subsystem_config_json,
50 };
51 
52 SPDK_SUBSYSTEM_REGISTER(g_spdk_subsystem_bdev);
53 SPDK_SUBSYSTEM_DEPEND(bdev, accel)
54 SPDK_SUBSYSTEM_DEPEND(bdev, vmd)
55 SPDK_SUBSYSTEM_DEPEND(bdev, sock)
56 SPDK_SUBSYSTEM_DEPEND(bdev, iobuf)
57