1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /* Copyright 2019-2020, Intel Corporation */
5 * config.h -- internal definitions for pmem2_config
12 #define PMEM2_GRANULARITY_INVALID ((enum pmem2_granularity) (-1))
13 #define PMEM2_ADDRESS_ANY 0 /* default value of the address request type */
16 /* offset from the beginning of the file */
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
;
29 void pmem2_config_init(struct pmem2_config
*cfg
);
31 int pmem2_config_validate_length(const struct pmem2_config
*cfg
,
32 size_t file_len
, size_t alignment
);
34 #endif /* PMEM2_CONFIG_H */