PMDK man page

pmemset_part_map

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
SEE ALSO

NAME

pmemset_part_map() - creates a part mapping

SYNOPSIS

#include <libpmemset.h>

struct pmemset_extras;
struct pmemset_part;
struct pmemset_part_descriptor;
struct pmemset_source;
int pmemset_part_map(struct pmemset_part **part_ptr,
		struct pmemset_extras *extra,
		struct pmemset_part_descriptor *desc);

DESCRIPTION

The pmemset_part_map() function creates new part mapping in the virtual address space of the calling process and adds structure describing this mapping to the pmemset. It requires an address of a pointer to initialized part provided in the part_ptr parameter. A part can be created using pmemset_part_new(3) function. The mapping can later be retrieved using pmemset_first_part_map(3), pmemset_next_part_map(3) and pmemset_part_map_by_address(3) functions.

Optionally pmemset_part_map() function can take a part descriptor object passed via desc parameter. If an optional descriptor was provided then address and size of the part mapping are stored in the descriptor when this function succeeds.

During the lifespan of initialized pmemset, a contiguous part coalescing feature value can be set using pmemset_set_contiguous_part_coalescing() function, modifying the default behavior of part mapping. With contiguous part coalescing feature enabled, pmemset_part_map() function tries to map each new part at the virtual memory region that is situated right after the previous mapped part memory range.

When the pmemset_part_map() function succeeds it consumes the part thereby deleting it and the variable pointed by part_ptr is set to NULL.

RETURN VALUE

The pmemset_part_map() function returns 0 on success or a negative error code on failure.

ERRORS

The pmemset_part_map() can fail with the following errors:

SEE ALSO

pmemset_first_part_map(3), pmemset_next_part_map(3), pmemset_part_map_by_address(3), pmemset_part_new(3), pmemset_set_contiguous_part_coalescing(3), pmemset_source_from_temporary(3), pmemset_xsource_from_file(3), libpmemset(7), libpmem2(7), and http://pmem.io