1PMEM2_VM_RESERVATION_MAP_FINPDM(D3K)Programmer's MaPnMuEaMl2_VM_RESERVATION_MAP_FIND(3)
2
3
4

NAME

6       pmem2_vm_reservation_map_find(),  pmem2_vm_reservation_map_find_prev(),
7       pmem2_vm_reservation_map_find_next(),                 pmem2_vm_reserva‐
8       tion_map_find_first() and pmem2_vm_reservation_map_find_last() - search
9       for the mapping located at the desirable location
10

SYNOPSIS

12              #include <libpmem2.h>
13
14              struct pmem2_map;
15              struct pmem2_vm_reservation;
16              int pmem2_vm_reservation_map_find(struct pmem2_vm_reservation *rsv,
17                      size_t reserv_offset, size_t len, struct pmem2_map **map_ptr);
18              int pmem2_vm_reservation_map_find_prev(struct pmem2_vm_reservation *rsv,
19                      struct pmem2_map *map, struct pmem2_map **prev_map);
20              int pmem2_vm_reservation_map_find_next(struct pmem2_vm_reservation *rsv,
21                      struct pmem2_map *map, struct pmem2_map **next_map);
22              int pmem2_vm_reservation_map_find_first(struct pmem2_vm_reservation *rsv,
23                      struct pmem2_map **first_map);
24              int pmem2_vm_reservation_map_find_last(struct pmem2_vm_reservation *rsv,
25                      struct pmem2_map **last_map);
26

DESCRIPTION

28       Mappings are inserted to the virtual memory reservation in the order of
29       their  virtual  address  space  location.  First mapping represents the
30       earliest mapping in the virtual addres space contained  in  a  reserva‐
31       tion, whereas the last mapping represents the last one.
32
33       The  pmem2_vm_reservation_map_find() function searches for the earliest
34       mapping, stored in the virtual memory  reservation,  intersecting  with
35       the  interval defined by reserv_offset and len variables and returns it
36       via map_ptr variable.
37
38       pmem2_vm_reservation_map_find_prev() function searches for the map pre‐
39       vious  to  the  provided map and returns it via provided prev_map vari‐
40       able.
41
42       pmem2_vm_reservation_map_find_next() function searches for the map next
43       after the provided map and returns it via next_map variable.
44
45       pmem2_vm_reservation_map_find_first()  function  searches for the first
46       map in the reservation and returns it via provided first_map variable.
47
48       pmem2_vm_reservation_map_find_last() function searches for the last map
49       in  the  reservation  and returns it via provided last_map variable.  #
50       RETURN VALUE #
51
52       The         pmem2_vm_reservation_map_find(),          pmem2_vm_reserva‐
53       tion_map_find_prev(),             pmem2_vm_reservation_map_find_next(),
54       pmem2_vm_reservation_map_find_first()       and       pmem2_vm_reserva‐
55       tion_map_find_last()  return  0 on success or a negative error on fail‐
56       ure.
57
58       It passes an address to the found mapping via user provided map pointer
59       variable on success, otherwise it passes NULL value when no mapping was
60       found.
61

ERRORS

63       The         pmem2_vm_reservation_map_find(),          pmem2_vm_reserva‐
64       tion_map_find_prev(),             pmem2_vm_reservation_map_find_next(),
65       pmem2_vm_reservation_map_find_first()       and       pmem2_vm_reserva‐
66       tion_map_find_last() can fail with the following errors:
67
68PMEM2_E_MAPPING_NOT_FOUND  -  no mapping found at the desirable loca‐
69         tion of the reservation
70

SEE ALSO

72       libpmem2(7), and <https://pmem.io>
73
74
75
76PMDK - pmem2 API version 1.0      2021-09-24  PMEM2_VM_RESERVATION_MAP_FIND(3)
Impressum