1488570ebSJim Harris /* SPDX-License-Identifier: BSD-3-Clause 2a6dbe372Spaul luse * Copyright (C) 2016 Intel Corporation. 307fe6a43SSeth Howell * All rights reserved. 45e1e850bSAlexey Marchuk * Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 507fe6a43SSeth Howell */ 607fe6a43SSeth Howell 707fe6a43SSeth Howell #ifndef SPDK_BDEV_MALLOC_H 807fe6a43SSeth Howell #define SPDK_BDEV_MALLOC_H 907fe6a43SSeth Howell 1007fe6a43SSeth Howell #include "spdk/stdinc.h" 1107fe6a43SSeth Howell 12e6b2b907SShuhei Matsumoto #include "spdk/bdev_module.h" 1307fe6a43SSeth Howell 1407fe6a43SSeth Howell typedef void (*spdk_delete_malloc_complete)(void *cb_arg, int bdeverrno); 1507fe6a43SSeth Howell 16e6b2b907SShuhei Matsumoto struct malloc_bdev_opts { 17e6b2b907SShuhei Matsumoto char *name; 18e6b2b907SShuhei Matsumoto struct spdk_uuid uuid; 19e6b2b907SShuhei Matsumoto uint64_t num_blocks; 20e6b2b907SShuhei Matsumoto uint32_t block_size; 211eb06bd6SPanfil, Wojciech uint32_t physical_block_size; 22e6b2b907SShuhei Matsumoto uint32_t optimal_io_boundary; 23aef00d44SShuhei Matsumoto uint32_t md_size; 24aef00d44SShuhei Matsumoto bool md_interleave; 2500bff560SShuhei Matsumoto enum spdk_dif_type dif_type; 2600bff560SShuhei Matsumoto bool dif_is_head_of_md; 27*c016e6ffSShuhei Matsumoto enum spdk_dif_pi_format dif_pi_format; 28e6b2b907SShuhei Matsumoto }; 29e6b2b907SShuhei Matsumoto 30e6b2b907SShuhei Matsumoto int create_malloc_disk(struct spdk_bdev **bdev, const struct malloc_bdev_opts *opts); 3107fe6a43SSeth Howell 324573e4ccSShuhei Matsumoto void delete_malloc_disk(const char *name, spdk_delete_malloc_complete cb_fn, void *cb_arg); 3307fe6a43SSeth Howell 3407fe6a43SSeth Howell #endif /* SPDK_BDEV_MALLOC_H */ 35