]> git.proxmox.com Git - ceph.git/blob - ceph/src/pmdk/src/libpmem2/config.h
import ceph 16.2.7
[ceph.git] / ceph / src / pmdk / src / libpmem2 / config.h
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /* Copyright 2019-2020, Intel Corporation */
3
4 /*
5 * config.h -- internal definitions for pmem2_config
6 */
7 #ifndef PMEM2_CONFIG_H
8 #define PMEM2_CONFIG_H
9
10 #include "libpmem2.h"
11
12 #define PMEM2_GRANULARITY_INVALID ((enum pmem2_granularity) (-1))
13 #define PMEM2_ADDRESS_ANY 0 /* default value of the address request type */
14
15 struct pmem2_config {
16 /* offset from the beginning of the file */
17 size_t offset;
18 size_t length; /* length of the mapping */
19 /* persistence granularity requested by user */
20 void *addr; /* address of the mapping */
21 int addr_request; /* address request type */
22 enum pmem2_granularity requested_max_granularity;
23 enum pmem2_sharing_type sharing; /* the way the file will be mapped */
24 unsigned protection_flag;
25 struct pmem2_vm_reservation *reserv;
26 size_t reserv_offset;
27 };
28
29 void pmem2_config_init(struct pmem2_config *cfg);
30
31 int pmem2_config_validate_length(const struct pmem2_config *cfg,
32 size_t file_len, size_t alignment);
33
34 #endif /* PMEM2_CONFIG_H */