xref: /spdk/module/bdev/malloc/bdev_malloc.h (revision a6dbe3721eb3b5990707fc3e378c95e505dd8ab5)
1 /*   SPDX-License-Identifier: BSD-3-Clause
2  *   Copyright (C) 2016 Intel Corporation.
3  *   All rights reserved.
4  *   Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
5  */
6 
7 #ifndef SPDK_BDEV_MALLOC_H
8 #define SPDK_BDEV_MALLOC_H
9 
10 #include "spdk/stdinc.h"
11 
12 #include "spdk/bdev_module.h"
13 
14 typedef void (*spdk_delete_malloc_complete)(void *cb_arg, int bdeverrno);
15 
16 struct malloc_bdev_opts {
17 	char *name;
18 	struct spdk_uuid uuid;
19 	uint64_t num_blocks;
20 	uint32_t block_size;
21 	uint32_t optimal_io_boundary;
22 	uint32_t md_size;
23 	bool md_interleave;
24 	enum spdk_dif_type dif_type;
25 	bool dif_is_head_of_md;
26 };
27 
28 int create_malloc_disk(struct spdk_bdev **bdev, const struct malloc_bdev_opts *opts);
29 
30 void delete_malloc_disk(const char *name, spdk_delete_malloc_complete cb_fn, void *cb_arg);
31 
32 #endif /* SPDK_BDEV_MALLOC_H */
33