2022-06-03 19:15:11 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
2022-11-01 20:26:26 +00:00
|
|
|
* Copyright (C) 2016 Intel Corporation.
|
2016-07-20 18:16:23 +00:00
|
|
|
* All rights reserved.
|
2021-10-29 13:48:49 +00:00
|
|
|
* Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
2016-07-20 18:16:23 +00:00
|
|
|
*/
|
|
|
|
|
2017-07-13 04:08:53 +00:00
|
|
|
#ifndef SPDK_BDEV_MALLOC_H
|
|
|
|
#define SPDK_BDEV_MALLOC_H
|
2016-07-20 18:16:23 +00:00
|
|
|
|
2017-05-02 18:18:25 +00:00
|
|
|
#include "spdk/stdinc.h"
|
2016-07-20 18:16:23 +00:00
|
|
|
|
2022-10-23 12:46:36 +00:00
|
|
|
#include "spdk/bdev_module.h"
|
2016-07-20 18:16:23 +00:00
|
|
|
|
2018-06-15 07:58:57 +00:00
|
|
|
typedef void (*spdk_delete_malloc_complete)(void *cb_arg, int bdeverrno);
|
|
|
|
|
2022-10-23 12:46:36 +00:00
|
|
|
struct malloc_bdev_opts {
|
|
|
|
char *name;
|
|
|
|
struct spdk_uuid uuid;
|
|
|
|
uint64_t num_blocks;
|
|
|
|
uint32_t block_size;
|
|
|
|
uint32_t optimal_io_boundary;
|
2022-10-24 13:26:19 +00:00
|
|
|
uint32_t md_size;
|
|
|
|
bool md_interleave;
|
2022-10-26 05:58:52 +00:00
|
|
|
enum spdk_dif_type dif_type;
|
|
|
|
bool dif_is_head_of_md;
|
2022-10-23 12:46:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int create_malloc_disk(struct spdk_bdev **bdev, const struct malloc_bdev_opts *opts);
|
2016-07-20 18:16:23 +00:00
|
|
|
|
2022-03-29 05:55:53 +00:00
|
|
|
void delete_malloc_disk(const char *name, spdk_delete_malloc_complete cb_fn, void *cb_arg);
|
2018-06-15 07:58:57 +00:00
|
|
|
|
2017-07-13 04:08:53 +00:00
|
|
|
#endif /* SPDK_BDEV_MALLOC_H */
|