1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright (C) 2020 Intel Corporation. 3 * All rights reserved. 4 */ 5 6 #ifndef SPDK_BDEV_FTL_H 7 #define SPDK_BDEV_FTL_H 8 9 #include "spdk/stdinc.h" 10 #include "spdk/bdev_module.h" 11 #include "spdk/ftl.h" 12 13 #include "ftl_core.h" 14 15 struct ftl_bdev_info { 16 const char *name; 17 struct spdk_uuid uuid; 18 }; 19 20 typedef void (*ftl_bdev_thread_fn)(void *); 21 22 struct rpc_ftl_stats_ctx { 23 struct spdk_bdev_desc *ftl_bdev_desc; 24 ftl_bdev_thread_fn cb; 25 struct spdk_jsonrpc_request *request; 26 struct ftl_stats *ftl_stats; 27 }; 28 29 typedef void (*ftl_bdev_init_fn)(const struct ftl_bdev_info *, void *, int); 30 31 int bdev_ftl_create_bdev(const struct spdk_ftl_conf *conf, ftl_bdev_init_fn cb, void *cb_arg); 32 void bdev_ftl_delete_bdev(const char *name, bool fast_shutdown, spdk_bdev_unregister_cb cb_fn, 33 void *cb_arg); 34 int bdev_ftl_defer_init(const struct spdk_ftl_conf *conf); 35 void bdev_ftl_unmap(const char *name, uint64_t lba, uint64_t num_blocks, spdk_ftl_fn cb_fn, 36 void *cb_arg); 37 int bdev_ftl_get_stats(const char *name, ftl_bdev_thread_fn cb, 38 struct spdk_jsonrpc_request *request, struct ftl_stats *stats); 39 40 #endif /* SPDK_BDEV_FTL_H */ 41