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 physical_block_size; 22 uint32_t optimal_io_boundary; 23 uint32_t md_size; 24 bool md_interleave; 25 enum spdk_dif_type dif_type; 26 bool dif_is_head_of_md; 27 enum spdk_dif_pi_format dif_pi_format; 28 }; 29 30 int create_malloc_disk(struct spdk_bdev **bdev, const struct malloc_bdev_opts *opts); 31 32 void delete_malloc_disk(const char *name, spdk_delete_malloc_complete cb_fn, void *cb_arg); 33 34 #endif /* SPDK_BDEV_MALLOC_H */ 35