xref: /spdk/module/bdev/ftl/bdev_ftl.h (revision 488570ebd418ba07c9e69e65106dcc964f3bb41b)
1 /*   SPDX-License-Identifier: BSD-3-Clause
2  *   Copyright (c) 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 struct spdk_bdev;
14 struct spdk_uuid;
15 
16 struct ftl_bdev_info {
17 	const char		*name;
18 	struct spdk_uuid	uuid;
19 };
20 
21 struct ftl_bdev_init_opts {
22 	/* Bdev's name */
23 	const char				*name;
24 	/* Base bdev's name */
25 	const char				*base_bdev;
26 	/* Write buffer bdev's name */
27 	const char				*cache_bdev;
28 	/* Bdev's mode */
29 	uint32_t				mode;
30 	/* UUID if device is restored from SSD */
31 	struct spdk_uuid			uuid;
32 	/* FTL library configuration */
33 	struct spdk_ftl_conf			ftl_conf;
34 };
35 
36 typedef void (*ftl_bdev_init_fn)(const struct ftl_bdev_info *, void *, int);
37 
38 int	bdev_ftl_create_bdev(const struct ftl_bdev_init_opts *bdev_opts,
39 			     ftl_bdev_init_fn cb, void *cb_arg);
40 void	bdev_ftl_delete_bdev(const char *name, spdk_bdev_unregister_cb cb_fn, void *cb_arg);
41 
42 #endif /* SPDK_BDEV_FTL_H */
43