1PMEM2_GET_DRAIN_FN(3)      PMDK Programmer's Manual      PMEM2_GET_DRAIN_FN(3)
2
3
4

NAME

6       pmem2_get_drain_fn() - get a drain function
7

SYNOPSIS

9              #include <libpmem2.h>
10
11              typedef void (*pmem2_drain_fn)(void);
12
13              struct pmem2_map;
14
15              pmem2_drain_fn pmem2_get_drain_fn(struct pmem2_map *map);
16

DESCRIPTION

18       The  pmem2_get_drain_fn()  function returns a pointer to a function re‐
19       sponsible for efficiently draining flushes (see  pmem2_get_flush_fn(3))
20       in  the  range  owned  by map.  Draining, in this context, means making
21       sure that the flushes before this operation won’t  be  reordered  after
22       it.  While it is not strictly true, draining can be thought of as wait‐
23       ing for previous flushes to complete.
24
25       If two (or more) mappings share the same drain function, it is safe  to
26       call this function once for all flushes belonging to those mappings.
27

RETURN VALUE

29       The pmem2_get_drain_fn() function never returns NULL.
30
31       The pmem2_get_drain_fn() for the same map always returns the same func‐
32       tion.  This means that it’s safe to cache its return  value.   However,
33       this  function  is very cheap (because it returns a precomputed value),
34       so caching may not be necessary.
35

SEE ALSO

37       pmem2_get_flush_fn(3), pmem2_get_persist_fn(3), pmem2_map_new(3), libp‐
38       mem2(7) and <https://pmem.io>
39
40
41
42PMDK - pmem2 API version 1.0      2021-07-22             PMEM2_GET_DRAIN_FN(3)
Impressum