pmem2_vm_reservation_map_find_first3
Search for the mapping located at the desirable location
Part of pmem2_vm_reservation_map_find(3).
Overview
Mappings are inserted to the virtual memory reservation in the order of their virtual address space location. First mapping represents the earliest mapping in the virtual address space contained in a reservation, whereas the last mapping represents the last one.
The pmem2_vm_reservation_map_find() function searches for the earliest mapping, stored in the virtual memory reservation, intersecting with the interval defined by reserv_offset and len variables and returns it via map_ptr variable.
pmem2_vm_reservation_map_find_prev() function searches for the map previous to the provided map and returns it via provided prev_map variable.
pmem2_vm_reservation_map_find_next() function searches for the map next after the provided map and returns it via next_map variable.
pmem2_vm_reservation_map_find_first() function searches for the first map in the reservation and returns it via provided first_map variable.
pmem2_vm_reservation_map_find_last() function searches for the last map in the reservation and returns it via provided last_map variable. # RETURN VALUE #
The pmem2_vm_reservation_map_find(), pmem2_vm_reservation_map_find_prev(), pmem2_vm_reservation_map_find_next(), pmem2_vm_reservation_map_find_first() and pmem2_vm_reservation_map_find_last() return 0 on success or a negative error on failure.
It passes an address to the found mapping via user provided map pointer variable on success, otherwise it passes NULL value when no mapping was found.
Errors
The pmem2_vm_reservation_map_find(), pmem2_vm_reservation_map_find_prev(), pmem2_vm_reservation_map_find_next(), pmem2_vm_reservation_map_find_first() and pmem2_vm_reservation_map_find_last() can fail with the following errors:
- •
-
PMEM2_E_MAPPING_NOT_FOUND- no mapping found at the desirable location of the reservation
History
- Debian 13 (Trixie): the text shown here
- Debian 12 (Bookworm)