1*2b435d1aSEvgeniy Kochetov /* SPDX-License-Identifier: BSD-3-Clause 2*2b435d1aSEvgeniy Kochetov * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 3*2b435d1aSEvgeniy Kochetov */ 4*2b435d1aSEvgeniy Kochetov 5*2b435d1aSEvgeniy Kochetov #include "spdk/stdinc.h" 6*2b435d1aSEvgeniy Kochetov 7*2b435d1aSEvgeniy Kochetov #include "spdk/fsdev.h" 8*2b435d1aSEvgeniy Kochetov #include "spdk/env.h" 9*2b435d1aSEvgeniy Kochetov #include "spdk/thread.h" 10*2b435d1aSEvgeniy Kochetov 11*2b435d1aSEvgeniy Kochetov #include "spdk_internal/init.h" 12*2b435d1aSEvgeniy Kochetov #include "spdk/env.h" 13*2b435d1aSEvgeniy Kochetov 14*2b435d1aSEvgeniy Kochetov static void 15*2b435d1aSEvgeniy Kochetov fsdev_initialize_complete(void *cb_arg, int rc) 16*2b435d1aSEvgeniy Kochetov { 17*2b435d1aSEvgeniy Kochetov spdk_subsystem_init_next(rc); 18*2b435d1aSEvgeniy Kochetov } 19*2b435d1aSEvgeniy Kochetov 20*2b435d1aSEvgeniy Kochetov static void 21*2b435d1aSEvgeniy Kochetov fsdev_subsystem_initialize(void) 22*2b435d1aSEvgeniy Kochetov { 23*2b435d1aSEvgeniy Kochetov spdk_fsdev_initialize(fsdev_initialize_complete, NULL); 24*2b435d1aSEvgeniy Kochetov } 25*2b435d1aSEvgeniy Kochetov 26*2b435d1aSEvgeniy Kochetov static void 27*2b435d1aSEvgeniy Kochetov fsdev_subsystem_finish_done(void *cb_arg) 28*2b435d1aSEvgeniy Kochetov { 29*2b435d1aSEvgeniy Kochetov spdk_subsystem_fini_next(); 30*2b435d1aSEvgeniy Kochetov } 31*2b435d1aSEvgeniy Kochetov 32*2b435d1aSEvgeniy Kochetov static void 33*2b435d1aSEvgeniy Kochetov fsdev_subsystem_finish(void) 34*2b435d1aSEvgeniy Kochetov { 35*2b435d1aSEvgeniy Kochetov spdk_fsdev_finish(fsdev_subsystem_finish_done, NULL); 36*2b435d1aSEvgeniy Kochetov } 37*2b435d1aSEvgeniy Kochetov 38*2b435d1aSEvgeniy Kochetov static void 39*2b435d1aSEvgeniy Kochetov fsdev_subsystem_config_json(struct spdk_json_write_ctx *w) 40*2b435d1aSEvgeniy Kochetov { 41*2b435d1aSEvgeniy Kochetov spdk_fsdev_subsystem_config_json(w); 42*2b435d1aSEvgeniy Kochetov } 43*2b435d1aSEvgeniy Kochetov 44*2b435d1aSEvgeniy Kochetov static struct spdk_subsystem g_spdk_subsystem_fsdev = { 45*2b435d1aSEvgeniy Kochetov .name = "fsdev", 46*2b435d1aSEvgeniy Kochetov .init = fsdev_subsystem_initialize, 47*2b435d1aSEvgeniy Kochetov .fini = fsdev_subsystem_finish, 48*2b435d1aSEvgeniy Kochetov .write_config_json = fsdev_subsystem_config_json, 49*2b435d1aSEvgeniy Kochetov }; 50*2b435d1aSEvgeniy Kochetov 51*2b435d1aSEvgeniy Kochetov SPDK_SUBSYSTEM_REGISTER(g_spdk_subsystem_fsdev); 52