pmdk-1.8/ 0000775 0000000 0000000 00000000000 13615011435 011014 5 ustar root root pmdk-1.8/VERSION 0000664 0000000 0000000 00000000004 13615011243 012053 0 ustar root root 1.8
pmdk-1.8/doc/ 0000775 0000000 0000000 00000000000 13615011243 011556 5 ustar root root pmdk-1.8/doc/pmem_ctl/ 0000775 0000000 0000000 00000000000 13615011416 013360 5 ustar root root pmdk-1.8/doc/pmem_ctl/pmem_ctl.5.md 0000664 0000000 0000000 00000013134 13615011243 015645 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEM_CTL, 5)
collection: pmem_ctl
header: PMDK
date: pmem_ctl API version 1.4
...
[comment]: <> (Copyright 2018-2019, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmem_ctl.5 -- man page for CTL)
[NAME](#name)
[DESCRIPTION](#description)
[CTL EXTERNAL CONFIGURATION](#ctl-external-configuration)
[SEE ALSO](#see-also)
# NAME #
ctl - interface for examination and modification of the library's internal state.
# DESCRIPTION #
The CTL namespace is organized in a tree structure. Starting from the root,
each node can be either internal, containing other elements, or a leaf.
Internal nodes themselves can only contain other nodes and cannot be entry
points. There are two types of those nodes: *named* and *indexed*. Named nodes
have string identifiers. Indexed nodes represent an abstract array index and
have an associated string identifier. The index itself is provided by the user.
A collection of indexes present on the path of an entry point is provided to
the handler functions as name and index pairs.
Entry points are the leaves of the CTL namespace structure. Each entry point
can read from the internal state, write to the internal state,
exec a function or a combination of these operations.
The entry points are listed in the following format:
name | r(ead)w(rite)x(ecute) | global/- | read argument type | write argument type | exec argument type | config argument type
A description of **pmem_ctl** functions can be found on the following
manual pages:
**libpmemblk_ctl_get**(3), **libpmemlog_ctl_get**(3), **libpmemobj_ctl_get**(3)
# CTL EXTERNAL CONFIGURATION #
In addition to direct function call, each write entry point can also be set
using two alternative methods.
The first method is to load a configuration directly from the
**PMEMBLK_CONF**/ **PMEMLOG_CONF**/ **PMEMOBJ_CONF** environment variable.
A properly formatted ctl config string is a single-line
sequence of queries separated by ';':
```
query0;query1;...;queryN
```
A single query is constructed from the name of the ctl write entry point and
the argument, separated by '=':
```
entry_point=entry_point_argument
```
The entry point argument type is defined by the entry point itself, but there
are three predefined primitives:
*) integer: represented by a sequence of [0-9] characters that form
a single number.
*) boolean: represented by a single character: y/n/Y/N/0/1, each
corresponds to true or false. If the argument contains any
trailing characters, they are ignored.
*) string: a simple sequence of characters.
There are also complex argument types that are formed from the primitives
separated by a ',':
```
first_arg,second_arg
```
In summary, a full configuration sequence looks like this:
```
(first_entry_point)=(arguments, ...);...;(last_entry_point)=(arguments, ...);
```
As an example, to set both prefault at_open and at_create variables:
```
PMEMBLK_CONF="prefault.at_open=1;prefault.at_create=1"
```
The second method of loading an external configuration is to set the
**PMEMBLK_CONF_FILE**/ **PMEMLOG_CONF_FILE**/ **PMEMOBJ_CONF_FILE**
environment variable to point to a file that contains
a sequence of ctl queries. The parsing rules are all the same, but the file
can also contain white-spaces and comments.
To create a comment, simply use '#' anywhere in a line and everything
afterwards, until a new line, will be ignored.
An example configuration file:
```
#########################
# My pmemblk configuration
#########################
#
# Global settings:
prefault. # modify the behavior of pre-faulting
at_open = 1; # prefault when the pool is opened
prefault.
at_create = 0; # but don't prefault when it's created
# Per-pool settings:
# ...
```
# SEE ALSO #
**libpmemblk_ctl_get**(3), **libpmemlog_ctl_get**(3), **libpmemobj_ctl_get**(3)
and ****
pmdk-1.8/doc/pmem_ctl/pmem_ctl.5 0000644 0000000 0000000 00000012764 13615011416 015256 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEM_CTL" "5" "2020-01-31" "PMDK - pmem_ctl API version 1.4" "PMDK Programmer's Manual"
.hy
.\" Copyright 2018-2019, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
ctl \- interface for examination and modification of the library's
internal state.
.SH DESCRIPTION
.PP
The CTL namespace is organized in a tree structure.
Starting from the root, each node can be either internal, containing
other elements, or a leaf.
Internal nodes themselves can only contain other nodes and cannot be
entry points.
There are two types of those nodes: \f[I]named\f[] and \f[I]indexed\f[].
Named nodes have string identifiers.
Indexed nodes represent an abstract array index and have an associated
string identifier.
The index itself is provided by the user.
A collection of indexes present on the path of an entry point is
provided to the handler functions as name and index pairs.
.PP
Entry points are the leaves of the CTL namespace structure.
Each entry point can read from the internal state, write to the internal
state, exec a function or a combination of these operations.
.PP
The entry points are listed in the following format:
.PP
name | r(ead)w(rite)x(ecute) | global/\- | read argument type | write
argument type | exec argument type | config argument type
.PP
A description of \f[B]pmem_ctl\f[] functions can be found on the
following manual pages: \f[B]libpmemblk_ctl_get\f[](3),
\f[B]libpmemlog_ctl_get\f[](3), \f[B]libpmemobj_ctl_get\f[](3)
.SH CTL EXTERNAL CONFIGURATION
.PP
In addition to direct function call, each write entry point can also be
set using two alternative methods.
.PP
The first method is to load a configuration directly from the
\f[B]PMEMBLK_CONF\f[]/ \f[B]PMEMLOG_CONF\f[]/ \f[B]PMEMOBJ_CONF\f[]
environment variable.
A properly formatted ctl config string is a single\-line sequence of
queries separated by `;':
.IP
.nf
\f[C]
query0;query1;...;queryN
\f[]
.fi
.PP
A single query is constructed from the name of the ctl write entry point
and the argument, separated by `=':
.IP
.nf
\f[C]
entry_point=entry_point_argument
\f[]
.fi
.PP
The entry point argument type is defined by the entry point itself, but
there are three predefined primitives:
.IP
.nf
\f[C]
*)\ integer:\ represented\ by\ a\ sequence\ of\ [0\-9]\ characters\ that\ form
\ \ \ \ a\ single\ number.
*)\ boolean:\ represented\ by\ a\ single\ character:\ y/n/Y/N/0/1,\ each
\ \ \ \ corresponds\ to\ true\ or\ false.\ If\ the\ argument\ contains\ any
\ \ \ \ trailing\ characters,\ they\ are\ ignored.
*)\ string:\ a\ simple\ sequence\ of\ characters.
\f[]
.fi
.PP
There are also complex argument types that are formed from the
primitives separated by a `,':
.IP
.nf
\f[C]
first_arg,second_arg
\f[]
.fi
.PP
In summary, a full configuration sequence looks like this:
.IP
.nf
\f[C]
(first_entry_point)=(arguments,\ ...);...;(last_entry_point)=(arguments,\ ...);
\f[]
.fi
.PP
As an example, to set both prefault at_open and at_create variables:
.IP
.nf
\f[C]
PMEMBLK_CONF="prefault.at_open=1;prefault.at_create=1"
\f[]
.fi
.PP
The second method of loading an external configuration is to set the
\f[B]PMEMBLK_CONF_FILE\f[]/ \f[B]PMEMLOG_CONF_FILE\f[]/
\f[B]PMEMOBJ_CONF_FILE\f[] environment variable to point to a file that
contains a sequence of ctl queries.
The parsing rules are all the same, but the file can also contain
white\-spaces and comments.
.PP
To create a comment, simply use `#' anywhere in a line and everything
afterwards, until a new line, will be ignored.
.PP
An example configuration file:
.IP
.nf
\f[C]
#########################
#\ My\ pmemblk\ configuration
#########################
#
#\ Global\ settings:
prefault.\ #\ modify\ the\ behavior\ of\ pre\-faulting
\ \ \ \ at_open\ =\ 1;\ #\ prefault\ when\ the\ pool\ is\ opened
prefault.
\ \ \ \ at_create\ =\ 0;\ #\ but\ don\[aq]t\ prefault\ when\ it\[aq]s\ created
#\ Per\-pool\ settings:
#\ ...
\f[]
.fi
.SH SEE ALSO
.PP
\f[B]libpmemblk_ctl_get\f[](3), \f[B]libpmemlog_ctl_get\f[](3),
\f[B]libpmemobj_ctl_get\f[](3) and \f[B]\f[]
pmdk-1.8/doc/pmem_ctl/.gitignore 0000664 0000000 0000000 00000000013 13615011243 015340 0 ustar root root pmem_ctl.5
pmdk-1.8/doc/libvmmalloc/ 0000775 0000000 0000000 00000000000 13615011243 014057 5 ustar root root pmdk-1.8/doc/libvmmalloc/README.md 0000664 0000000 0000000 00000000126 13615011243 015335 0 ustar root root This library has been moved to a
[separate repository](https://github.com/pmem/vmem).
pmdk-1.8/doc/pmempool/ 0000775 0000000 0000000 00000000000 13615011420 013403 5 ustar root root pmdk-1.8/doc/pmempool/pmempool-sync.1 0000644 0000000 0000000 00000011420 13615011420 016263 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMPOOL-SYNC" "1" "2020-01-31" "PMDK - pmem Tools version 1.4" "PMDK Programmer's Manual"
.hy
.\" Copyright 2016-2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmempool\-sync\f[] \- Synchronize replicas or their parts within a
pool set.
.SH SYNOPSIS
.IP
.nf
\f[C]
pmempool\ sync\ [options]\
\f[]
.fi
.PP
NOTE: Only the pool set file used to create the pool should be used for
syncing the pool.
.SH DESCRIPTION
.PP
The \f[B]pmempool sync\f[] command synchronizes data between replicas
within a pool set.
It checks if metadata of all replicas in a pool set are consistent,
i.e.\ all parts are healthy, and if any of them is not, the corrupted or
missing parts are recreated and filled with data from one of the healthy
replicas.
Currently synchronizing data is allowed only for \f[B]pmemobj\f[] pools
(see \f[B]libpmemobj\f[](7)).
.PP
If a pool set has the option \f[I]SINGLEHDR\f[] or \f[I]NOHDRS\f[] (see
\f[B]poolset\f[](5)), \f[B]pmempool sync\f[] command has limited
capability of checking its metadata.
This is due to limited or no, respectively, internal metadata at the
beginning of pool set parts in every replica when either of the options
is used.
In that cases, only missing parts or the ones which cannot be opened are
recreated.
.SS Available options:
.TP
.B \f[C]\-b,\ \-\-bad\-blocks\f[]
Fix bad blocks \- it causes creating or reading special recovery files.
When bad blocks are detected, special recovery files have to be created
in order to fix them safely.
A separate recovery file is created for each part of the pool.
The recovery files are created in the same directory where the poolset
file is located using the following name pattern:
_r _p _badblocks.txt These recovery
files are automatically removed if the sync operation finishes
successfully.
.RS
.PP
If the last sync operation was interrupted and not finished correctly
(eg.
the application crashed) and the bad blocks fixing procedure was in
progress, the bad block recovery files may be left over.
In such case bad blocks might have been cleared and zeroed, but the
correct data from these blocks was not recovered (not copied from a
healthy replica), so the recovery files MUST NOT be deleted manually,
because it would cause a data loss.
Pmempool\-sync should be run again with the `\-b' option set.
It will finish the previously interrupted sync operation and copy
correct data to zeroed bad blocks using the left\-over bad block
recovery files (the bad blocks will be read from the saved recovery
files).
Pmempool will delete the recovery files automatically at the end of the
sync operation.
.PP
Using this option may have limitations depending on the operating
system.
For details see description of the CHECK_BAD_BLOCKS feature in
\f[B]pmempool\-feature\f[](1).
.RE
.TP
.B \f[C]\-d,\ \-\-dry\-run\f[]
Enable dry run mode.
In this mode no changes are applied, only check for viability of
synchronization.
.RS
.RE
.TP
.B \f[C]\-v,\ \-\-verbose\f[]
Increase verbosity level.
.RS
.RE
.TP
.B \f[C]\-h,\ \-\-help\f[]
Display help message and exit.
.RS
.RE
.SH SEE ALSO
.PP
\f[B]pmempool(1)\f[], \f[B]libpmemblk(7)\f[], \f[B]libpmemlog(7)\f[],
\f[B]libpmempool(7)\f[] and \f[B]\f[]
pmdk-1.8/doc/pmempool/pmempool-info.1.md 0000664 0000000 0000000 00000032632 13615011243 016656 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMPOOL-INFO, 1)
collection: pmempool
header: PMDK
date: pmem Tools version 1.4
...
[comment]: <> (Copyright 2016-2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmempool-info.1 -- man page for pmempool-info)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[RANGE](#range)
[STATISTICS](#statistics)
[EXAMPLE](#example)
[SEE ALSO](#see-also)
# NAME #
**pmempool-info** - show information about persistent memory pool
# SYNOPSIS #
```
$ pmempool info []
```
# DESCRIPTION #
The **pmempool** invoked with *info* command analyzes an existing pool
created by **PMDK** libraries provided by **file** parameter.
The **file** can be either existing pool file, a part file or a poolset file.
The main task of this command is to print all usable information from
pool headers and user data in human readable format. It automatically recognizes the pool
type by parsing and analyzing the pool header. The recognition
is done by checking the signature in the pool header. The main job of *info* command
is to present internal data structures as they are stored in file but *not* for checking
consistency. For this purpose there is the **pmempool-check**(1) command available.
The **pmempool** with *info* command analyzes pool file as long as it is possible
regarding *correctness* of internal meta-data (correct offsets, sizes etc.).
If it is *not* possible to analyze the rest of the file, **pmempool** exits
with error code and prints appropriate error message.
Currently there is lack of interprocess synchronization for pool files,
so the *info* command should be invoked off-line. Using **pmempool** on pool file which
may be modified by another process may lead to unexpected errors in pool file.
A poolset file passed to **pmempool info** may contain multiple replicas,
also remote ones, but **pmempool** currently does not read any data from remote replicas.
It prints only a remote node address and a remote replica descriptor.
**pmempool info** opens pool file in *read-only* mode so the file
will remain untouched after processing.
The *info* command may collect and print basic statistics about data usage.
The statistics are specific to the type of pool. See **STATISTICS** section for details.
Although the pool consistency is *not* checked by the *info* command,
it prints information about checksum errors and/or offsets errors.
##### Common options: #####
By default the *info* command of **pmempool** prints information about the most important
internal data structures from pool. The particular set of headers and meta-data depend on
pool type. The pool type is recognized automatically and appropriate information is displayed
in human-readable format.
To force processing specified file(s) as desired pool type use **-f** option with appropriate
name of pool type. The valid names off pool types are **blk**, **log**, **obj** or **btt**.
This option may be useful when the pool header is corrupted and automatic recognition of
pool type fails.
`-f, --force blk|log|obj|btt`
Force parsing pool as specified pool type.
>NOTE:
By default only pool headers and internal meta-data are displayed.
To display user data use **-d** option. Using **-r** option you can
specify number of blocks/bytes/data chunks or objects using special
text format. See **RANGE** section for details. The range refers to
*block numbers* in case of pmem blk pool type, to *chunk numbers*
in case of pmem log pool type and to *object numbers* in case of
pmem obj pool type.
See **EXAMPLES** section for an example of usage of these options.
`-d, --data`
Dump user data in hexadecimal format.
In case of pmem *blk* pool type data is dumped in *blocks*.
In case of pmem *log* pool type data is dumped as a wholeor in *chunks* if **-w**
option is used (See **Options for PMEMLOG** section for details).
`-r, --range `
Range of blocks/data chunks/objects/zone headers/chunk headers/lanes.
See **RANGE** section for details about range format.
`-n, --human`
Print sizes in human-readable format with appropriate units (e.g. 4k, 8M, 16G)
`-x, --headers-hex`
Print pool's internal data in mixed format which consists of hexadecimal dump of
header's data and parsed format displayed in human-readable format. This
allows one to see how data is stored in file.
`-s, --stats`
Print pool's statistics. See **STATISTICS** section for details.
`-k, --bad-blocks=`
Print bad blocks found in the pool.
`-h, --help`
Display help message and exit.
##### Options for PMEMLOG: #####
`-w, --walk `
Use this option to walk through used data with fixed data chunk size.
See **pmemlog_walk**(3) in **libpmemlog**(7) for details.
##### Options for PMEMBLK: #####
By default the *info* command displays the **pmemblk** header and
BTT (Block Translation Table) Info header in case of **pmemblk** pool type.
To display BTT Map and/or BTT FLOG (Free List and Log) use **-m**
and **-g** options respectively or increase verbosity level.
In order to display BTT Info header backup use **-B** option.
`-m, --map`
Print BTT Map entries.
`-g, --flog`
Print BTT FLOG entries.
`-B, --backup`
Print BTT Info header backup.
>NOTE:
By default the *info* command displays all data blocks when **-d** options is used.
However it is possible to skip blocks marked with *zero* and/or *error* flags.
It is also possible to skip blocks which are *not* marked with any flag. Skipping
blocks has impact on blocks ranges (e.g. display 10 blocks marked with error flag
in the range from 0 to 10000) and statistics.
`-z, --skip-zeros`
Skip blocks marked with *zero* flag.
`-e, --skip-error`
Skip blocks marked with *error* flag.
`-u, --skip-no-flag`
Skip blocks *not* marked with any flag.
##### Options for PMEMOBJ: #####
By default the *info* command displays pool header and **pmemobj** pool descriptor.
In order to print information about other data structures one of the
following options may be used.
`-l, --lanes []`
Print information about lanes. If range is not specified all lanes are displayed.
The range can be specified using **-r** option right after the **-l** option.
See **RANGE** section for details about range format.
`-R, --recovery`
Print information about only those lanes which require recovery process.
This option requires **-l**, **--lanes** option.
`-O, --object-store`
Print information about all allocated objects.
`-t, --types `
Print information about allocated objects only from specified range of type numbers.
If **-s**, **--stats** option is specified the objects statistics refer to objects from
specified range of type numbers. This option requires **-O**, **--object-store** or **-s**,
**--stats** options. See **RANGE** section for details about range format.
`-E, --no-empty`
Ignore empty lists of objects. This option requires **-O**, **--object-store** option.
`-o, --root`
Print information about a root object.
`-A, --alloc-header`
Print object's allocation header. This option requires **-O**, **--object-store** or **-l**,
**--lanes** or **-o**, **--root** options.
`-a, --oob-header`
Print object's out of band header. This option requires **-O**, **--object-store** or **-l**,
**--lanes** or **-o**, **--root** options.
`-H, --heap`
Print information about **pmemobj** heap. By default only a heap header is displayed.
`-Z, --zones`
If the **-H**, **--heap** option is used, print information about zones from specified range.
If the **-O**, **--object-store** option is used, print information about objects only
from specified range of zones. This option requires **-O**, **--object-store**, **-H**, **--heap**
or **-s**, **--stats** options.
The range can be specified using **-r** option right after the **-Z** option.
See **RANGE** section for details about range format.
`-C, --chunks []`
If the **-H, --heap** option is used, print information about chunks from specified range.
By default information about chunks of types *used* , *free* and *run* are displayed.
If the **-O, --object-store** option is used, print information about objects from
specified range of chunks within a zone. This option requires **-O, --object-store**,
**-H, --heap** or **-s, --stats** options.
The range can be specified using **-r** option right after the **-C** option.
See **RANGE** section for details about range format.
`-T, --chunk-type used,free,run,footer`
Print only specified type(s) of chunks.
The multiple types may be specified separated by comma.
This option requires **-H, --heap** and **-C, --chunks** options.
`-b, --bitmap`
Print bitmap of used blocks in chunks of type run.
This option requires **-H, --heap** and **-C, --chunks** options.
`-p, --replica `
Print information from *\* replica. The 0 value means the master pool file.
# RANGE #
Using **-r, --range** option it is possible to dump only a range of user data.
This section describes valid format of *\* string.
You can specify multiple ranges separated by commas.
`-`
All blocks/bytes/data chunks from *\* to *\* will be dumped.
`-`
All blocks/bytes/data chunks up to *\* will be dumped.
`-`
All blocks/bytes/data chunks starting from *\* will be dumped.
``
Only *\* block/byte/data chunk will be dumped.
# STATISTICS #
Below is the description of statistical measures for specific pool types.
##### PMEMLOG #####
+ **Total** - Total space in pool.
+ **Available** - Size and percentage of available space.
+ **Used** - Size and percentage of used space.
##### PMEMBLK #####
+ **Total blocks** - Total number of blocks in pool.
+ **Zeroed blocks** - Number and percentage of blocks marked with *zero* flag.
+ **Error blocks** - Number and percentage of blocks marked with *error* flag.
+ **Blocks without any flag** - Number and percentage of blocks *not* marked with any flag.
>NOTE:
In case of pmemblk, statistics are evaluated for blocks which meet requirements regarding:
*range* of blocks (**-r** option),
*skipped* types of blocks (**-z**, **-e**, **-u** options).
##### PMEMOBJ #####
+ **Object store**
+ **Number of objects** - Total number of objects and number of objects per type number.
+ **Number of bytes** - Total number of bytes and number of bytes per type number.
+ **Heap**
+ **Number of zones** - Total number of zones in the pool.
+ **Number of used zones** - Number of used zones in the pool.
+ **Zone** The zone's statistics are presented for each zone separately and the aggregated results from all zones.
+ **Number of chunks** - Total number of chunks in the zone and number of chunks of specified type.
+ **Chunks size** - Total size of all chunks in the zone and sum of sizes of chunks of specified type.
+ **Allocation classes**
+ **Units** - Total number of units of specified class.
+ **Used units** - Number of used units of specified class.
+ **Bytes** - Total number of bytes of specified class.
+ **Used bytes** - Number of used bytes of specified class.
+ **Total bytes** - Total number of bytes of all classes.
+ **Total used bytes** - Total number of used bytes of all classes.
# EXAMPLE #
```
$ pmempool info ./pmemblk
```
Parse and print information about "pmemblk" pool file.
```
$ pmempool info -f blk ./pmempool
```
Force parsing "pmempool" file as **pmemblk** pool type.
```
$ pmempool info -d ./pmemlog
```
Print information and data in hexadecimal dump format for file "pmemlog".
```
$ pmempool info -d -r10-100 -eu ./pmemblk
```
Print information from "pmemblk" file. Dump data blocks from 10 to 100,
skip blocks marked with error flag and not marked with any flag.
# SEE ALSO #
**pmempool**(1), **libpmemblk**(7), **libpmemlog**(7),
**libpmemobj**(7) and ****
pmdk-1.8/doc/pmempool/pmempool-transform.1 0000644 0000000 0000000 00000013523 13615011420 017330 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMPOOL-TRANSFORM" "1" "2020-01-31" "PMDK - pmem Tools version 1.4" "PMDK Programmer's Manual"
.hy
.\" Copyright 2016-2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmempool\-transform\f[] \- Modify internal structure of a pool set.
.SH SYNOPSIS
.IP
.nf
\f[C]
pmempool\ transform\ [options]\ \
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]pmempool transform\f[] command modifies internal structure of a
pool set defined by the \f[C]poolset_file_src\f[] file, according to a
structure described in the \f[C]poolset_file_dst\f[] file.
.PP
The following operations are supported:
.IP \[bu] 2
adding replicas \- one or more new replicas can be added and
synchronized with other replicas in the pool set,
.IP \[bu] 2
removing replicas \- one or more replicas can be removed from the pool
set ,
.IP \[bu] 2
adding or removing pool set options.
.PP
Only one of the above operations can be performed at a time.
.PP
Currently adding and removing replicas are allowed only for
\f[B]pmemobj\f[] pools (see \f[B]libpmemobj\f[](7)).
.PP
The \f[I]poolset_file_src\f[] argument provides the source pool set to
be changed.
.PP
The \f[I]poolset_file_dst\f[] argument points to the target pool set.
.PP
When adding or deleting replicas, the two pool set files can differ only
in the definitions of replicas which are to be added or deleted.
When adding or removing pool set options (see \f[B]poolset\f[](5)), the
rest of both pool set files have to be of the same structure.
The operation of adding/removing a pool set option can be performed on a
pool set with local replicas only.
To add/remove a pool set option to/from a pool set with remote replicas,
one has to remove the remote replicas first, then add/remove the option,
and finally recreate the remote replicas having added/removed the pool
set option to/from the remote replicas' poolset files.
To add a replica it is necessary for its effective size to match or
exceed the pool size.
Otherwise the whole operation fails and no changes are applied.
If none of the poolset options is used, the effective size of a replica
is the sum of sizes of all its part files decreased by 4096 bytes per
each part file.
The 4096 bytes of each part file is utilized for storing internal
metadata of the pool part files.
If the option \f[I]SINGLEHDR\f[] is used, the effective size of a
replica is the sum of sizes of all its part files decreased once by 4096
bytes.
In this case only the first part contains internal metadata.
If the option \f[I]NOHDRS\f[] is used, the effective size of a replica
is the sum of sizes of all its part files.
In this case none of the parts contains internal metadata.
.SS Available options:
.TP
.B \f[C]\-d,\ \-\-dry\-run\f[]
Enable dry run mode.
In this mode no changes are applied, only check for viability of the
operation is performed.
.RS
.RE
.TP
.B \f[C]\-v,\ \-\-verbose\f[]
Increase verbosity level.
.RS
.RE
.TP
.B \f[C]\-h,\ \-\-help\f[]
Display help message and exit.
.RS
.RE
.SH EXAMPLES
.SS Example 1.
.PP
Let files \f[C]/path/poolset_file_src\f[] and
\f[C]/path/poolset_file_dst\f[] have the following contents:
.IP
.nf
\f[C]
PMEMPOOLSET
20M\ /0/partfile1
20M\ /0/partfile2
25M\ /0/partfile3
REPLICA
40M\ /1/partfile1
20M\ /1/partfile2
\f[]
.fi
.IP
.nf
\f[C]
PMEMPOOLSET
20M\ /0/partfile1
20M\ /0/partfile2
25M\ /0/partfile3
REPLICA
40M\ /1/partfile1
20M\ /1/partfile2
REPLICA
50M\ /2/partfile1
20M\ /2/partfile2
\f[]
.fi
.PP
Then, the command
.PP
\f[C]pmempool\ transform\ /path/poolset_file_src\ /path/poolset_file_dst\f[]
.PP
adds a replica to the pool set.
All other replicas remain unchanged and the size of the pool remains
60M.
.SS Example 2.
.PP
Let files \f[C]/path/poolset_file_src\f[] and
\f[C]/path/poolset_file_dst\f[] have the following contents:
.IP
.nf
\f[C]
PMEMPOOLSET
20M\ /0/partfile1
20M\ /0/partfile2
25M\ /0/partfile3
REPLICA
40M\ /1/partfile1
20M\ /1/partfile2
\f[]
.fi
.IP
.nf
\f[C]
PMEMPOOLSET
20M\ /0/partfile1
20M\ /0/partfile2
25M\ /0/partfile3
\f[]
.fi
.PP
Then
.PP
\f[C]pmempool_transform\ /path/poolset_file_src\ /path/poolset_file_dst\f[]
.PP
deletes the second replica from the pool set.
The first replica remains unchanged and the size of the pool is still
60M.
.SH SEE ALSO
.PP
\f[B]pmempool(1)\f[], \f[B]libpmemblk(7)\f[], \f[B]libpmemlog(7)\f[],
\f[B]libpmempool(7)\f[] and \f[B]\f[]
pmdk-1.8/doc/pmempool/pmempool-rm.1.md 0000664 0000000 0000000 00000010510 13615011243 016330 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMPOOL-RM, 1)
collection: pmempool
header: PMDK
date: pmem Tools version 1.4
...
[comment]: <> (Copyright 2016-2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmempool-rm.1 -- man page for pmempool-rm)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[EXAMPLE](#example)
[SEE ALSO](#see-also)
# NAME #
**pmempool-rm** - remove a persistent memory pool
# SYNOPSIS #
```
$ pmempool rm [] ..
```
# DESCRIPTION #
The **pmempool rm** command removes each specified file. If the specified file
is a pool set file, all pool files (single-file pool or part files) and remote
replicas are removed. By default the **pmempool rm** does not remove pool set
files. All local and remote pool files are removed using **unlink**(3) call,
except the pools created on **device dax** which are zeroed instead.
If specified file does not exist, the remote pool is broken or not accessible,
the **pmempool rm** command terminates with an error code. By default it prompts
before removing *write-protected* local files.
See **REMOTE REPLICATION** section for more details about support for remote
pools.
See **EXAMPLES** section for example usage of the *rm* command.
##### Available options: #####
`-h, --help`
Print help message
`-v, --verbose`
Be verbose and print all removing files.
`-s, --only-pools`
Remove only pool files and do not remove pool set files (default behaviour).
`-a, --all`
Remove all pool set files - local and remote.
`-l, --local`
Remove local pool set files.
`-r, --remote`
Remove remote pool set files.
`-f, --force`
Remove all specified files, ignore nonexistent files, never prompt.
`-i, --interactive`
Prompt before removing every single file or remote pool.
# REMOTE REPLICATION #
A remote pool is removed using **rpmem_remove**(3) function if **librpmem**(7)
library is available. If a pool set file contains remote replication but
**librpmem**(7) is not available, the **pmempool rm** command terminates with
an error code, unless the **-f, --force** option is specified.
# EXAMPLE #
```
$ pmempool rm pool.obj pool.blk
```
Remove specified pool files.
```
$ pmempool rm pool.set
```
Remove all pool files from the "pool.set", do not remove *pool.set* itself.
```
$ pmempool rm -a pool.set
```
Remove all pool files from the "pool.set", remove the local pool set file and all
remote pool set files.
# SEE ALSO #
**pmempool**(1), **libpmemblk**(7), **libpmemlog**(7),
**libpmemobj**(7), **librpmem**(7) and ****
pmdk-1.8/doc/pmempool/pmempool-create.1.md 0000664 0000000 0000000 00000013071 13615011243 017162 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMPOOL-CREATE, 1)
collection: pmempool
header: PMDK
date: pmem Tools version 1.4
...
[comment]: <> (Copyright 2016-2019, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmempool-create.1 -- man page for pmempool-create)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[EXAMPLE](#example)
[SEE ALSO](#see-also)
# NAME #
**pmempool-create** - create a persistent memory pool
# SYNOPSIS #
```
$ pmempool create [] [] []
```
# DESCRIPTION #
The **pmempool** invoked with *create* command creates a pool file
of specified type. Depending on a pool type it is possible to provide more properties of pool.
Valid pool types are: **blk**, **log** and **obj** which stands for
*pmemblk*, *pmemlog* and *pmemobj* pools respectively. By default
the pool file is created with *minimum* allowed size for specified
pool type. The minimum sizes for **blk**, **log** and **obj** pool
types are **PMEMBLK_MIN_POOL**, **PMEMLOG_MIN_POOL** and **PMEMOBJ_MIN_POOL**
respectively. See **libpmemblk**(7), **libpmemlog**(7)
and **libpmemobj**(7) for details.
For *pmemblk* pool type block size *\* is a required argument.
In order to set custom size of pool use **-s** option, or use **-M** option
to create a pool of maximum available size on underlying file system.
The *size* argument may be passed in format that permits only the upper-case
character for byte - B as specified in IEC 80000-13, IEEE 1541 and the
Metric Interchange Format. Standards accept SI units with obligatory
B - kB, MB, GB, ... which means multiplier by 1000 and IEC units with
optional "iB" - KiB, MiB, GiB, ..., K, M, G, ... - which means multiplier by 1024.
##### Available options: #####
`-s, --size `
Size of pool file.
`-M, --max-size`
Set size of pool to available space of underlying file system.
`-m, --mode `
Set permissions to (the default is 0664) when creating the files.
If the file already exist the permissions are not changed.
`-i, --inherit `
Create a new pool of the same size and other properties as *\*.
`-b, --clear-bad-blocks`
Clear bad blocks in existing files.
`-f, --force`
Remove the pool before creating.
`-v, --verbose`
Increase verbosity level.
`-h, --help`
Display help message and exit.
##### Options for PMEMBLK: #####
By default when creating a pmem **blk** pool, the **BTT** layout is *not*
written until the first *write operation* of block entry is performed.
Using **-w** option you can force writing the **BTT** layout by writing
zero data to specified block number. By default the *write operation*
is performed to block number 0. Please refer to **libpmemblk**(7) for details.
`-w, --write-layout`
Force writing the **BTT** layout by performing *write operation* to block number zero.
##### Options for PMEMOBJ: #####
By default when creating a pmem **obj** pool, the layout name provided to
the **libpmemobj** library is an empty string. Please refer to
**libpmemobj**(7) for details.
`-l, --layout `
Layout name of the **pmemobj** pool.
# EXAMPLE #
```
$ pmempool create blk 512 pool.blk
```
Create a blk pool file of minimum allowed size and block size 512 bytes
```
$ pmempool create log -M pool.log
```
Create a log pool file of maximum allowed size
```
$ pmempool create blk --size=4G --write-layout 1K pool.blk
```
Create a blk pool file of size 4G, block size 1K and write the BTT layout
```
$ pmempool create --layout my_layout obj pool.obj
```
Create an obj pool file of minimum allowed size and layout "my_layout"
```
$ pmempool create --inherit=pool.log new_pool.log
```
Create a pool file based on pool.log file
# SEE ALSO #
**pmempool**(1), **libpmemblk**(7), **libpmemlog**(7),
**libpmemobj**(7) and ****
pmdk-1.8/doc/pmempool/pmempool-dump.1.md 0000664 0000000 0000000 00000010414 13615011243 016662 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMPOOL-DUMP, 1)
collection: pmempool
header: PMDK
date: pmem Tools version 1.4
...
[comment]: <> (Copyright 2016-2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmempool-dump.1 -- man page for pmempool-dump)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[RANGE](#range)
[EXAMPLE](#example)
[SEE ALSO](#see-also)
# NAME #
**pmempool-dump** - dump user data from persistent memory pool
# SYNOPSIS #
```
$ pmempool dump []
```
# DESCRIPTION #
The **pmempool** invoked with *dump* command dumps user data from specified pool file.
The output format may be either binary or hexadecimal.
By default the output format is hexadecimal.
By default data is dumped to standard output. It is possible to dump data to other
file by specifying **-o** option. In this case data will be appended to this file.
Using **-r** option you can specify number of blocks/bytes/data chunks using
special text format. See **RANGE** section for details.
##### Available options: #####
`-b, --binary`
Dump data in binary format.
`-r, --range `
Range of pool file to dump. This may be number of blocks for **blk** pool
type or either number of bytes or number of data chunks for **log** pool type.
`-c, --chunk `
Size of chunk for **log** pool type. See **pmemlog_walk**(3) in **libpmemlog**(7) for details.
`-o, --output `
Name of output file.
`-h, --help`
Display help message and exit.
# RANGE #
Using **-r**, **--range** option it is possible to dump only a range of user data.
This section describes valid format of *\* string.
You can specify multiple ranges separated by commas.
`-`
All blocks/bytes/data chunks from *\* to *\* will be dumped.
`-`
All blocks/bytes/data chunks up to *\* will be dumped.
`-`
All blocks/bytes/data chunks starting from *\* will be dumped.
``
Only *\* block/byte/data chunk will be dumped.
# EXAMPLE #
```
$ pmempool dump pool.bin
```
Dump user data from pool.bin file to standard output
```
$ pmempool dump -o output.bin -r1,10-100 pool_blk.bin
```
Dump block number 1 and blocks from 10 to 100 from pool_blk.bin
containing pmem blk pool to output.bin file
```
$ pmempool dump -r 1K-2K pool.bin
```
Dump data form 1K to 2K from pool.bin file.
# SEE ALSO #
**pmempool**(1), **libpmemblk**(7), **libpmemlog**(7),
**libpmemobj**(7) and ****
pmdk-1.8/doc/pmempool/pmempool-convert.1 0000644 0000000 0000000 00000004114 13615011420 016771 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMPOOL-CONVERT" "1" "2020-01-31" "PMDK - pmem Tools version 1.4" "PMDK Programmer's Manual"
.hy
.\" Copyright 2016-2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmempool\-convert\f[] \- this is a wrapper around pmdk\-convert
tool.
More information can be found in \f[B]pmdk\-convert\f[](1) man page.
.SH SEE ALSO
.PP
\f[B]pmdk\-convert\f[](1), \f[B]pmempool\f[](1), \f[B]libpmemblk\f[](7),
\f[B]libpmemlog\f[](7), \f[B]libpmemobj\f[](7), \f[B]libpmempool\f[](7)
and \f[B]\f[]
pmdk-1.8/doc/pmempool/pmempool-check.1.md 0000664 0000000 0000000 00000010456 13615011243 017000 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMPOOL-CHECK, 1)
collection: pmempool
header: PMDK
date: pmem Tools version 1.4
...
[comment]: <> (Copyright 2016-2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmempool-check.1 -- man page for pmempool-check)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[EXAMPLE](#example)
[SEE ALSO](#see-also)
# NAME #
**pmempool-check** - check and repair persistent memory pool
# SYNOPSIS #
```
$ pmempool check []
```
# DESCRIPTION #
The **pmempool** invoked with *check* command checks consistency of a given pool file.
If the pool file is consistent **pmempool** exits with 0 value. If the
pool file is not consistent non-zero error code is returned.
In case of any errors, the proper message is printed. The verbosity level
may be increased using **-v** option. The output messages may be also suppressed using
**-q** option.
It is possible to try to fix encountered problems using **-r** option.
In order to be sure this will not corrupt your data you can either create backup of the
pool file using **-b** option or just print what would be fixed
without modifying original pool using **-N** option.
> NOTE:
Currently, checking the consistency of a *pmemobj* pool is **not** supported.
##### Available options: #####
`-r, --repair`
Try to repair a pool file if possible.
`-y, --yes`
Answer yes on all questions.
`-d, --dry-run`
Don't execute, just show what would be done. Not supported on Device DAX.
`-N, --no-exec`
Deprecated alias for `dry-run`.
`-b, --backup `
Create backup of a pool file before executing. Terminate if it is *not*
possible to create a backup file. This option requires **-r** option.
`-a, --advanced`
Perform advanced repairs. This option enables more aggressive steps in attempts
to repair a pool. This option requires `-r, --repair`.
`-q, --quiet`
Be quiet and don't print any messages.
`-v, --verbose`
Be more verbose.
`-h, --help`
Display help message and exit.
# EXAMPLE #
```
$ pmempool check pool.bin
```
Check consistency of "pool.bin" pool file
```
$ pmempool check --repair --backup pool.bin.backup pool.bin
```
Check consistency of "pool.bin" pool file, create backup and repair
if necessary.
```
$ pmempool check -rvN pool.bin
```
Check consistency of "pool.bin" pool file, print what would be repaired with
increased verbosity level.
# SEE ALSO #
**pmempool**(1), **libpmemblk**(7), **libpmemlog**(7),
**libpmemobj**(7), **libpmempool**(7) and ****
pmdk-1.8/doc/pmempool/pmempool-check.1 0000644 0000000 0000000 00000010362 13615011420 016370 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMPOOL-CHECK" "1" "2020-01-31" "PMDK - pmem Tools version 1.4" "PMDK Programmer's Manual"
.hy
.\" Copyright 2016-2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmempool\-check\f[] \- check and repair persistent memory pool
.SH SYNOPSIS
.IP
.nf
\f[C]
$\ pmempool\ check\ []\
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]pmempool\f[] invoked with \f[I]check\f[] command checks
consistency of a given pool file.
If the pool file is consistent \f[B]pmempool\f[] exits with 0 value.
If the pool file is not consistent non\-zero error code is returned.
.PP
In case of any errors, the proper message is printed.
The verbosity level may be increased using \f[B]\-v\f[] option.
The output messages may be also suppressed using \f[B]\-q\f[] option.
.PP
It is possible to try to fix encountered problems using \f[B]\-r\f[]
option.
In order to be sure this will not corrupt your data you can either
create backup of the pool file using \f[B]\-b\f[] option or just print
what would be fixed without modifying original pool using \f[B]\-N\f[]
option.
.RS
.PP
NOTE: Currently, checking the consistency of a \f[I]pmemobj\f[] pool is
\f[B]not\f[] supported.
.RE
.SS Available options:
.PP
\f[C]\-r,\ \-\-repair\f[]
.PP
Try to repair a pool file if possible.
.PP
\f[C]\-y,\ \-\-yes\f[]
.PP
Answer yes on all questions.
.PP
\f[C]\-d,\ \-\-dry\-run\f[]
.PP
Don't execute, just show what would be done.
Not supported on Device DAX.
.PP
\f[C]\-N,\ \-\-no\-exec\f[]
.PP
Deprecated alias for \f[C]dry\-run\f[].
.PP
\f[C]\-b,\ \-\-backup\ \f[]
.PP
Create backup of a pool file before executing.
Terminate if it is \f[I]not\f[] possible to create a backup file.
This option requires \f[B]\-r\f[] option.
.PP
\f[C]\-a,\ \-\-advanced\f[]
.PP
Perform advanced repairs.
This option enables more aggressive steps in attempts to repair a pool.
This option requires \f[C]\-r,\ \-\-repair\f[].
.PP
\f[C]\-q,\ \-\-quiet\f[]
.PP
Be quiet and don't print any messages.
.PP
\f[C]\-v,\ \-\-verbose\f[]
.PP
Be more verbose.
.PP
\f[C]\-h,\ \-\-help\f[]
.PP
Display help message and exit.
.SH EXAMPLE
.IP
.nf
\f[C]
$\ pmempool\ check\ pool.bin
\f[]
.fi
.PP
Check consistency of \[lq]pool.bin\[rq] pool file
.IP
.nf
\f[C]
$\ pmempool\ check\ \-\-repair\ \-\-backup\ pool.bin.backup\ pool.bin
\f[]
.fi
.PP
Check consistency of \[lq]pool.bin\[rq] pool file, create backup and
repair if necessary.
.IP
.nf
\f[C]
$\ pmempool\ check\ \-rvN\ pool.bin
\f[]
.fi
.PP
Check consistency of \[lq]pool.bin\[rq] pool file, print what would be
repaired with increased verbosity level.
.SH SEE ALSO
.PP
\f[B]pmempool\f[](1), \f[B]libpmemblk\f[](7), \f[B]libpmemlog\f[](7),
\f[B]libpmemobj\f[](7), \f[B]libpmempool\f[](7) and
\f[B]\f[]
pmdk-1.8/doc/pmempool/.gitignore 0000664 0000000 0000000 00000000247 13615011243 015401 0 ustar root root pmempool-check.1
pmempool-convert.1
pmempool-create.1
pmempool-dump.1
pmempool-feature.1
pmempool-info.1
pmempool-rm.1
pmempool-sync.1
pmempool-transform.1
pmempool.1
pmdk-1.8/doc/pmempool/pmempool-sync.1.md 0000664 0000000 0000000 00000012060 13615011243 016670 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMPOOL-SYNC, 1)
collection: pmempool
header: PMDK
date: pmem Tools version 1.4
...
[comment]: <> (Copyright 2016-2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmempool-sync.1 -- man page for pmempool-sync)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[EXAMPLES](#examples)
[SEE ALSO](#see-also)
# NAME #
**pmempool-sync** - Synchronize replicas or their parts within a pool set.
# SYNOPSIS #
```
pmempool sync [options]
```
NOTE: Only the pool set file used to create the pool should be used
for syncing the pool.
# DESCRIPTION #
The **pmempool sync** command synchronizes data between replicas within
a pool set. It checks if metadata of all replicas in a pool set
are consistent, i.e. all parts are healthy, and if any of them is not,
the corrupted or missing parts are recreated and filled with data from one of
the healthy replicas.
Currently synchronizing data is allowed only for **pmemobj** pools (see
**libpmemobj**(7)).
_WINUX(,=q=If a pool set has the option *SINGLEHDR* or *NOHDRS*
(see **poolset**(5)), **pmempool sync** command has limited capability
of checking its metadata. This is due to limited or no, respectively, internal
metadata at the beginning of pool set parts in every replica when either of the
options is used. In that cases, only missing parts or the ones which cannot
be opened are recreated.=e=)
##### Available options: #####
`-b, --bad-blocks`
: Fix bad blocks - it causes creating or reading special recovery files.
When bad blocks are detected, special recovery files have to be created
in order to fix them safely. A separate recovery file is created for each part
of the pool. The recovery files are created in the same directory
where the poolset file is located using the following name pattern:
\ _r \ _p \ _badblocks.txt
These recovery files are automatically removed if the sync operation finishes
successfully.
If the last sync operation was interrupted and not finished correctly
(eg. the application crashed) and the bad blocks fixing procedure was
in progress, the bad block recovery files may be left over. In such case
bad blocks might have been cleared and zeroed, but the correct data from these
blocks was not recovered (not copied from a healthy replica), so the recovery
files MUST NOT be deleted manually, because it would cause a data loss.
Pmempool-sync should be run again with the '-b' option set. It will finish
the previously interrupted sync operation and copy correct data to zeroed
bad blocks using the left-over bad block recovery files (the bad blocks
will be read from the saved recovery files). Pmempool will delete the recovery
files automatically at the end of the sync operation.
Using this option may have limitations depending on the operating system.
For details see description of the CHECK_BAD_BLOCKS feature
in **pmempool-feature**(1).
`-d, --dry-run`
: Enable dry run mode. In this mode no changes are applied, only check for
viability of synchronization.
`-v, --verbose`
: Increase verbosity level.
`-h, --help`
: Display help message and exit.
# SEE ALSO #
**pmempool(1)**, **libpmemblk(7)**, **libpmemlog(7)**,
**libpmempool(7)** and ****
pmdk-1.8/doc/pmempool/pmempool.1.md 0000664 0000000 0000000 00000010327 13615011243 015722 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMPOOL, 1)
collection: pmempool
header: PMDK
date: pmem Tools version 1.4
...
[comment]: <> (Copyright 2016-2019, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmempool.1 -- man page for pmempool)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[OPTIONS](#options)
[COMMANDS](#commands)
[SEE ALSO](#see-also)
# NAME #
**pmempool** - Persistent Memory Pool Management Tool
# SYNOPSIS #
```
$ pmempool [--help] [--version] []
```
# DESCRIPTION #
The **pmempool** is a management tool for *Persistent Memory* pool files
created by **PMDK** libraries.
The main purpose of **pmempool** is to provide a user with a set of utilities
for off-line analysis and manipulation of pools created by pmem libraries.
The pmempool is a generic command which consists of subcommands for specific
purposes. Some of subcommands are required to work *without* any impact
on processed pool, but some of them *may* create a new or modify an existing one.
The **pmempool** may be useful for troubleshooting by system administrators
and for software developers who work on applications based on **PMDK**.
The latter may find these tools useful for testing and debugging purposes also.
# OPTIONS #
`-V, --version`
Prints the version of **pmempool**.
`-h, --help`
Prints synopsis and list of commands.
# COMMANDS #
Currently there is a following set of commands available:
+ **pmempool-info**(1) -
Prints information and statistics in human-readable format about specified pool.
+ **pmempool-check**(1) -
Checks pool's consistency and repairs pool if it is not consistent.
+ **pmempool-create**(1) -
Creates a pool of specified type with additional properties specific for this type of pool.
+ **pmempool-dump**(1) -
Dumps usable data from pool in hexadecimal or binary format.
+ **pmempool-rm**(1) -
Removes pool file or all pool files listed in pool set configuration file.
+ **pmempool-convert**(1) -
Updates the pool to the latest available layout version.
+ **pmempool-sync**(1) -
Synchronizes replicas within a poolset.
+ **pmempool-transform**(1) -
Modifies internal structure of a poolset.
+ **pmempool-feature**(1) -
Toggle or query a poolset features.
In order to get more information about specific *command* you can use **pmempool help .**
# SEE ALSO #
**libpmemblk**(7), **libpmemlog**(7), **libpmemobj**(7)
and ****
pmdk-1.8/doc/pmempool/pmempool-info.1 0000644 0000000 0000000 00000035571 13615011420 016257 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMPOOL-INFO" "1" "2020-01-31" "PMDK - pmem Tools version 1.4" "PMDK Programmer's Manual"
.hy
.\" Copyright 2016-2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmempool\-info\f[] \- show information about persistent memory pool
.SH SYNOPSIS
.IP
.nf
\f[C]
$\ pmempool\ info\ []\
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]pmempool\f[] invoked with \f[I]info\f[] command analyzes an
existing pool created by \f[B]PMDK\f[] libraries provided by
\f[B]file\f[] parameter.
The \f[B]file\f[] can be either existing pool file, a part file or a
poolset file.
.PP
The main task of this command is to print all usable information from
pool headers and user data in human readable format.
It automatically recognizes the pool type by parsing and analyzing the
pool header.
The recognition is done by checking the signature in the pool header.
The main job of \f[I]info\f[] command is to present internal data
structures as they are stored in file but \f[I]not\f[] for checking
consistency.
For this purpose there is the \f[B]pmempool\-check\f[](1) command
available.
.PP
The \f[B]pmempool\f[] with \f[I]info\f[] command analyzes pool file as
long as it is possible regarding \f[I]correctness\f[] of internal
meta\-data (correct offsets, sizes etc.).
If it is \f[I]not\f[] possible to analyze the rest of the file,
\f[B]pmempool\f[] exits with error code and prints appropriate error
message.
.PP
Currently there is lack of interprocess synchronization for pool files,
so the \f[I]info\f[] command should be invoked off\-line.
Using \f[B]pmempool\f[] on pool file which may be modified by another
process may lead to unexpected errors in pool file.
.PP
A poolset file passed to \f[B]pmempool info\f[] may contain multiple
replicas, also remote ones, but \f[B]pmempool\f[] currently does not
read any data from remote replicas.
It prints only a remote node address and a remote replica descriptor.
.PP
\f[B]pmempool info\f[] opens pool file in \f[I]read\-only\f[] mode so
the file will remain untouched after processing.
.PP
The \f[I]info\f[] command may collect and print basic statistics about
data usage.
The statistics are specific to the type of pool.
See \f[B]STATISTICS\f[] section for details.
.PP
Although the pool consistency is \f[I]not\f[] checked by the
\f[I]info\f[] command, it prints information about checksum errors
and/or offsets errors.
.SS Common options:
.PP
By default the \f[I]info\f[] command of \f[B]pmempool\f[] prints
information about the most important internal data structures from pool.
The particular set of headers and meta\-data depend on pool type.
The pool type is recognized automatically and appropriate information is
displayed in human\-readable format.
.PP
To force processing specified file(s) as desired pool type use
\f[B]\-f\f[] option with appropriate name of pool type.
The valid names off pool types are \f[B]blk\f[], \f[B]log\f[],
\f[B]obj\f[] or \f[B]btt\f[].
This option may be useful when the pool header is corrupted and
automatic recognition of pool type fails.
.PP
\f[C]\-f,\ \-\-force\ blk|log|obj|btt\f[]
.PP
Force parsing pool as specified pool type.
.RS
.PP
NOTE: By default only pool headers and internal meta\-data are
displayed.
To display user data use \f[B]\-d\f[] option.
Using \f[B]\-r\f[] option you can specify number of blocks/bytes/data
chunks or objects using special text format.
See \f[B]RANGE\f[] section for details.
The range refers to \f[I]block numbers\f[] in case of pmem blk pool
type, to \f[I]chunk numbers\f[] in case of pmem log pool type and to
\f[I]object numbers\f[] in case of pmem obj pool type.
See \f[B]EXAMPLES\f[] section for an example of usage of these options.
.RE
.PP
\f[C]\-d,\ \-\-data\f[]
.PP
Dump user data in hexadecimal format.
In case of pmem \f[I]blk\f[] pool type data is dumped in
\f[I]blocks\f[].
In case of pmem \f[I]log\f[] pool type data is dumped as a wholeor in
\f[I]chunks\f[] if \f[B]\-w\f[] option is used (See \f[B]Options for
PMEMLOG\f[] section for details).
.PP
\f[C]\-r,\ \-\-range\ \f[]
.PP
Range of blocks/data chunks/objects/zone headers/chunk headers/lanes.
See \f[B]RANGE\f[] section for details about range format.
.PP
\f[C]\-n,\ \-\-human\f[]
.PP
Print sizes in human\-readable format with appropriate units (e.g.\ 4k,
8M, 16G)
.PP
\f[C]\-x,\ \-\-headers\-hex\f[]
.PP
Print pool's internal data in mixed format which consists of hexadecimal
dump of header's data and parsed format displayed in human\-readable
format.
This allows one to see how data is stored in file.
.PP
\f[C]\-s,\ \-\-stats\f[]
.PP
Print pool's statistics.
See \f[B]STATISTICS\f[] section for details.
.PP
\f[C]\-k,\ \-\-bad\-blocks=\f[]
.PP
Print bad blocks found in the pool.
.PP
\f[C]\-h,\ \-\-help\f[]
.PP
Display help message and exit.
.SS Options for PMEMLOG:
.PP
\f[C]\-w,\ \-\-walk\ \f[]
.PP
Use this option to walk through used data with fixed data chunk size.
See \f[B]pmemlog_walk\f[](3) in \f[B]libpmemlog\f[](7) for details.
.SS Options for PMEMBLK:
.PP
By default the \f[I]info\f[] command displays the \f[B]pmemblk\f[]
header and BTT (Block Translation Table) Info header in case of
\f[B]pmemblk\f[] pool type.
.PP
To display BTT Map and/or BTT FLOG (Free List and Log) use \f[B]\-m\f[]
and \f[B]\-g\f[] options respectively or increase verbosity level.
.PP
In order to display BTT Info header backup use \f[B]\-B\f[] option.
.PP
\f[C]\-m,\ \-\-map\f[]
.PP
Print BTT Map entries.
.PP
\f[C]\-g,\ \-\-flog\f[]
.PP
Print BTT FLOG entries.
.PP
\f[C]\-B,\ \-\-backup\f[]
.PP
Print BTT Info header backup.
.RS
.PP
NOTE: By default the \f[I]info\f[] command displays all data blocks when
\f[B]\-d\f[] options is used.
However it is possible to skip blocks marked with \f[I]zero\f[] and/or
\f[I]error\f[] flags.
It is also possible to skip blocks which are \f[I]not\f[] marked with
any flag.
Skipping blocks has impact on blocks ranges (e.g.\ display 10 blocks
marked with error flag in the range from 0 to 10000) and statistics.
.RE
.PP
\f[C]\-z,\ \-\-skip\-zeros\f[]
.PP
Skip blocks marked with \f[I]zero\f[] flag.
.PP
\f[C]\-e,\ \-\-skip\-error\f[]
.PP
Skip blocks marked with \f[I]error\f[] flag.
.PP
\f[C]\-u,\ \-\-skip\-no\-flag\f[]
.PP
Skip blocks \f[I]not\f[] marked with any flag.
.SS Options for PMEMOBJ:
.PP
By default the \f[I]info\f[] command displays pool header and
\f[B]pmemobj\f[] pool descriptor.
In order to print information about other data structures one of the
following options may be used.
.PP
\f[C]\-l,\ \-\-lanes\ []\f[]
.PP
Print information about lanes.
If range is not specified all lanes are displayed.
The range can be specified using \f[B]\-r\f[] option right after the
\f[B]\-l\f[] option.
See \f[B]RANGE\f[] section for details about range format.
.PP
\f[C]\-R,\ \-\-recovery\f[]
.PP
Print information about only those lanes which require recovery process.
This option requires \f[B]\-l\f[], \f[B]\[en]lanes\f[] option.
.PP
\f[C]\-O,\ \-\-object\-store\f[]
.PP
Print information about all allocated objects.
.PP
\f[C]\-t,\ \-\-types\ \f[]
.PP
Print information about allocated objects only from specified range of
type numbers.
If \f[B]\-s\f[], \f[B]\[en]stats\f[] option is specified the objects
statistics refer to objects from specified range of type numbers.
This option requires \f[B]\-O\f[], \f[B]\[en]object\-store\f[] or
\f[B]\-s\f[], \f[B]\[en]stats\f[] options.
See \f[B]RANGE\f[] section for details about range format.
.PP
\f[C]\-E,\ \-\-no\-empty\f[]
.PP
Ignore empty lists of objects.
This option requires \f[B]\-O\f[], \f[B]\[en]object\-store\f[] option.
.PP
\f[C]\-o,\ \-\-root\f[]
.PP
Print information about a root object.
.PP
\f[C]\-A,\ \-\-alloc\-header\f[]
.PP
Print object's allocation header.
This option requires \f[B]\-O\f[], \f[B]\[en]object\-store\f[] or
\f[B]\-l\f[], \f[B]\[en]lanes\f[] or \f[B]\-o\f[], \f[B]\[en]root\f[]
options.
.PP
\f[C]\-a,\ \-\-oob\-header\f[]
.PP
Print object's out of band header.
This option requires \f[B]\-O\f[], \f[B]\[en]object\-store\f[] or
\f[B]\-l\f[], \f[B]\[en]lanes\f[] or \f[B]\-o\f[], \f[B]\[en]root\f[]
options.
.PP
\f[C]\-H,\ \-\-heap\f[]
.PP
Print information about \f[B]pmemobj\f[] heap.
By default only a heap header is displayed.
.PP
\f[C]\-Z,\ \-\-zones\f[]
.PP
If the \f[B]\-H\f[], \f[B]\[en]heap\f[] option is used, print
information about zones from specified range.
If the \f[B]\-O\f[], \f[B]\[en]object\-store\f[] option is used, print
information about objects only from specified range of zones.
This option requires \f[B]\-O\f[], \f[B]\[en]object\-store\f[],
\f[B]\-H\f[], \f[B]\[en]heap\f[] or \f[B]\-s\f[], \f[B]\[en]stats\f[]
options.
The range can be specified using \f[B]\-r\f[] option right after the
\f[B]\-Z\f[] option.
See \f[B]RANGE\f[] section for details about range format.
.PP
\f[C]\-C,\ \-\-chunks\ []\f[]
.PP
If the \f[B]\-H, \[en]heap\f[] option is used, print information about
chunks from specified range.
By default information about chunks of types \f[I]used\f[] ,
\f[I]free\f[] and \f[I]run\f[] are displayed.
If the \f[B]\-O, \[en]object\-store\f[] option is used, print
information about objects from specified range of chunks within a zone.
This option requires \f[B]\-O, \[en]object\-store\f[], \f[B]\-H,
\[en]heap\f[] or \f[B]\-s, \[en]stats\f[] options.
The range can be specified using \f[B]\-r\f[] option right after the
\f[B]\-C\f[] option.
See \f[B]RANGE\f[] section for details about range format.
.PP
\f[C]\-T,\ \-\-chunk\-type\ used,free,run,footer\f[]
.PP
Print only specified type(s) of chunks.
The multiple types may be specified separated by comma.
This option requires \f[B]\-H, \[en]heap\f[] and \f[B]\-C,
\[en]chunks\f[] options.
.PP
\f[C]\-b,\ \-\-bitmap\f[]
.PP
Print bitmap of used blocks in chunks of type run.
This option requires \f[B]\-H, \[en]heap\f[] and \f[B]\-C,
\[en]chunks\f[] options.
.PP
\f[C]\-p,\ \-\-replica\ \f[]
.PP
Print information from \f[I]\f[] replica.
The 0 value means the master pool file.
.SH RANGE
.PP
Using \f[B]\-r, \[en]range\f[] option it is possible to dump only a
range of user data.
This section describes valid format of \f[I]\f[] string.
.PP
You can specify multiple ranges separated by commas.
.PP
\f[C]\-\f[]
.PP
All blocks/bytes/data chunks from \f[I]\f[] to \f[I]\f[]
will be dumped.
.PP
\f[C]\-\f[]
.PP
All blocks/bytes/data chunks up to \f[I]\f[] will be dumped.
.PP
\f[C]\-\f[]
.PP
All blocks/bytes/data chunks starting from \f[I]\f[] will be
dumped.
.PP
\f[C]\f[]
.PP
Only \f[I]\f[] block/byte/data chunk will be dumped.
.SH STATISTICS
.PP
Below is the description of statistical measures for specific pool
types.
.SS PMEMLOG
.IP \[bu] 2
\f[B]Total\f[] \- Total space in pool.
.IP \[bu] 2
\f[B]Available\f[] \- Size and percentage of available space.
.IP \[bu] 2
\f[B]Used\f[] \- Size and percentage of used space.
.SS PMEMBLK
.IP \[bu] 2
\f[B]Total blocks\f[] \- Total number of blocks in pool.
.IP \[bu] 2
\f[B]Zeroed blocks\f[] \- Number and percentage of blocks marked with
\f[I]zero\f[] flag.
.IP \[bu] 2
\f[B]Error blocks\f[] \- Number and percentage of blocks marked with
\f[I]error\f[] flag.
.IP \[bu] 2
\f[B]Blocks without any flag\f[] \- Number and percentage of blocks
\f[I]not\f[] marked with any flag.
.RS
.PP
NOTE: In case of pmemblk, statistics are evaluated for blocks which meet
requirements regarding: \f[I]range\f[] of blocks (\f[B]\-r\f[] option),
\f[I]skipped\f[] types of blocks (\f[B]\-z\f[], \f[B]\-e\f[],
\f[B]\-u\f[] options).
.RE
.SS PMEMOBJ
.IP \[bu] 2
\f[B]Object store\f[]
.RS 2
.IP \[bu] 2
\f[B]Number of objects\f[] \- Total number of objects and number of
objects per type number.
.IP \[bu] 2
\f[B]Number of bytes\f[] \- Total number of bytes and number of bytes
per type number.
.RE
.IP \[bu] 2
\f[B]Heap\f[]
.RS 2
.IP \[bu] 2
\f[B]Number of zones\f[] \- Total number of zones in the pool.
.IP \[bu] 2
\f[B]Number of used zones\f[] \- Number of used zones in the pool.
.RE
.IP \[bu] 2
\f[B]Zone\f[] The zone's statistics are presented for each zone
separately and the aggregated results from all zones.
.RS 2
.IP \[bu] 2
\f[B]Number of chunks\f[] \- Total number of chunks in the zone and
number of chunks of specified type.
.IP \[bu] 2
\f[B]Chunks size\f[] \- Total size of all chunks in the zone and sum of
sizes of chunks of specified type.
.RE
.IP \[bu] 2
\f[B]Allocation classes\f[]
.RS 2
.IP \[bu] 2
\f[B]Units\f[] \- Total number of units of specified class.
.IP \[bu] 2
\f[B]Used units\f[] \- Number of used units of specified class.
.IP \[bu] 2
\f[B]Bytes\f[] \- Total number of bytes of specified class.
.IP \[bu] 2
\f[B]Used bytes\f[] \- Number of used bytes of specified class.
.IP \[bu] 2
\f[B]Total bytes\f[] \- Total number of bytes of all classes.
.IP \[bu] 2
\f[B]Total used bytes\f[] \- Total number of used bytes of all classes.
.RE
.SH EXAMPLE
.IP
.nf
\f[C]
$\ pmempool\ info\ ./pmemblk
\f[]
.fi
.PP
Parse and print information about \[lq]pmemblk\[rq] pool file.
.IP
.nf
\f[C]
$\ pmempool\ info\ \-f\ blk\ ./pmempool
\f[]
.fi
.PP
Force parsing \[lq]pmempool\[rq] file as \f[B]pmemblk\f[] pool type.
.IP
.nf
\f[C]
$\ pmempool\ info\ \-d\ ./pmemlog
\f[]
.fi
.PP
Print information and data in hexadecimal dump format for file
\[lq]pmemlog\[rq].
.IP
.nf
\f[C]
$\ pmempool\ info\ \-d\ \-r10\-100\ \-eu\ ./pmemblk
\f[]
.fi
.PP
Print information from \[lq]pmemblk\[rq] file.
Dump data blocks from 10 to 100, skip blocks marked with error flag and
not marked with any flag.
.SH SEE ALSO
.PP
\f[B]pmempool\f[](1), \f[B]libpmemblk\f[](7), \f[B]libpmemlog\f[](7),
\f[B]libpmemobj\f[](7) and \f[B]\f[]
pmdk-1.8/doc/pmempool/pmempool-dump.1 0000644 0000000 0000000 00000010230 13615011420 016252 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMPOOL-DUMP" "1" "2020-01-31" "PMDK - pmem Tools version 1.4" "PMDK Programmer's Manual"
.hy
.\" Copyright 2016-2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmempool\-dump\f[] \- dump user data from persistent memory pool
.SH SYNOPSIS
.IP
.nf
\f[C]
$\ pmempool\ dump\ []\
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]pmempool\f[] invoked with \f[I]dump\f[] command dumps user data
from specified pool file.
The output format may be either binary or hexadecimal.
.PP
By default the output format is hexadecimal.
.PP
By default data is dumped to standard output.
It is possible to dump data to other file by specifying \f[B]\-o\f[]
option.
In this case data will be appended to this file.
.PP
Using \f[B]\-r\f[] option you can specify number of blocks/bytes/data
chunks using special text format.
See \f[B]RANGE\f[] section for details.
.SS Available options:
.PP
\f[C]\-b,\ \-\-binary\f[]
.PP
Dump data in binary format.
.PP
\f[C]\-r,\ \-\-range\ \f[]
.PP
Range of pool file to dump.
This may be number of blocks for \f[B]blk\f[] pool type or either number
of bytes or number of data chunks for \f[B]log\f[] pool type.
.PP
\f[C]\-c,\ \-\-chunk\ \f[]
.PP
Size of chunk for \f[B]log\f[] pool type.
See \f[B]pmemlog_walk\f[](3) in \f[B]libpmemlog\f[](7) for details.
.PP
\f[C]\-o,\ \-\-output\ \f[]
.PP
Name of output file.
.PP
\f[C]\-h,\ \-\-help\f[]
.PP
Display help message and exit.
.SH RANGE
.PP
Using \f[B]\-r\f[], \f[B]\[en]range\f[] option it is possible to dump
only a range of user data.
This section describes valid format of \f[I]\f[] string.
.PP
You can specify multiple ranges separated by commas.
.PP
\f[C]\-\f[]
.PP
All blocks/bytes/data chunks from \f[I]\f[] to \f[I]\f[]
will be dumped.
.PP
\f[C]\-\f[]
.PP
All blocks/bytes/data chunks up to \f[I]\f[] will be dumped.
.PP
\f[C]\-\f[]
.PP
All blocks/bytes/data chunks starting from \f[I]\f[] will be
dumped.
.PP
\f[C]\f[]
.PP
Only \f[I]\f[] block/byte/data chunk will be dumped.
.SH EXAMPLE
.IP
.nf
\f[C]
$\ pmempool\ dump\ pool.bin
\f[]
.fi
.PP
Dump user data from pool.bin file to standard output
.IP
.nf
\f[C]
$\ pmempool\ dump\ \-o\ output.bin\ \-r1,10\-100\ pool_blk.bin
\f[]
.fi
.PP
Dump block number 1 and blocks from 10 to 100 from pool_blk.bin
containing pmem blk pool to output.bin file
.IP
.nf
\f[C]
$\ pmempool\ dump\ \-r\ 1K\-2K\ pool.bin
\f[]
.fi
.PP
Dump data form 1K to 2K from pool.bin file.
.SH SEE ALSO
.PP
\f[B]pmempool\f[](1), \f[B]libpmemblk\f[](7), \f[B]libpmemlog\f[](7),
\f[B]libpmemobj\f[](7) and \f[B]\f[]
pmdk-1.8/doc/pmempool/pmempool-feature.1 0000644 0000000 0000000 00000011124 13615011420 016743 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMPOOL-FEATURE" "1" "2020-01-31" "PMDK - pmem Tools version 1.4" "PMDK Programmer's Manual"
.hy
.\" Copyright 2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmempool\-feature\f[] \- toggle or query pool set features
.SH SYNOPSIS
.IP
.nf
\f[C]
$\ pmempool\ feature\ (\-e|\-d|\-q\ feature\-name)\ [options]\
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]pmempool feature\f[] command enables / disables or queries pool
set features.
.PP
Available pool \f[I]feature\-names\f[] are:
.IP \[bu] 2
\f[B]SINGLEHDR\f[] \- only the first part in each replica contains the
pool part internal metadata.
This value can be used only with \f[B]\-q\f[].
It can not be enabled or disabled.
For details see \f[B]poolset\f[](5).
.IP \[bu] 2
\f[B]CHECKSUM_2K\f[] \- only the first 2KiB of pool part internal
metadata is checksummed.
Other features may depend on this one to store additional metadata in
otherwise unused second 2KiB part of a header.
When \f[B]CHECKSUM_2K\f[] is disabled whole 4KiB is checksummed.
.IP \[bu] 2
\f[B]SHUTDOWN_STATE\f[] \- enables additional check performed during
pool open which verifies pool consistency in the presence of dirty
shutdown.
\f[B]CHECKSUM_2K\f[] has to be enabled prior to \f[B]SHUTDOWN_STATE\f[]
otherwise enabling \f[B]SHUTDOWN_STATE\f[] will fail.
.IP \[bu] 2
\f[B]CHECK_BAD_BLOCKS\f[] \- enables checking bad blocks performed
during opening a pool and fixing bad blocks performed by pmempool\-sync
during syncing a pool.
Currently (Linux kernel v4.19, libndctl v62) checking and fixing bad
blocks require read access to the following resource files (containing
physical addresses) of NVDIMM devices which only root can read by
default:
.IP
.nf
\f[C]
/sys/bus/nd/devices/ndbus*/region*/resource
/sys/bus/nd/devices/ndbus*/region*/dax*/resource
/sys/bus/nd/devices/ndbus*/region*/pfn*/resource
/sys/bus/nd/devices/ndbus*/region*/namespace*/resource
\f[]
.fi
.PP
It is possible to use poolset as \f[I]file\f[] argument.
But poolsets with remote replicas are not supported.
.SS Available options:
.PP
\f[C]\-h,\ \-\-help\f[]
.PP
Print help message.
.PP
\f[C]\-v,\ \-\-verbose\f[]
.PP
Increase verbosity level.
.PP
\f[C]\-e,\ \-\-enable\ feature\-name\f[]
.PP
Enable feature for pool set.
.PP
\f[C]\-d,\ \-\-disable\ feature\-name\f[]
.PP
Disable feature for pool set.
.PP
\f[C]\-q,\ \-\-query\ feature\-name\f[]
.PP
Print feature status.
.SH COMPATIBILITY
.PP
Poolsets with features not defined in this document (e.g.\ enabled by
the newer software version) are not supported.
.SH DISCLAIMER
.PP
\f[C]pmempool\ feature\f[] command is not fail safe.
.SH EXAMPLE
.IP
.nf
\f[C]
$\ pmempool\ feature\ \-\-enable\ CHECKSUM_2K\ pool.set
\f[]
.fi
.PP
Enables POOL_FEAT_CKSUM_2K incompat feature flag.
.IP
.nf
\f[C]
$\ pmempool\ feature\ \-\-disable\ CHECKSUM_2K\ pool.set
\f[]
.fi
.PP
Disables POOL_FEAT_CKSUM_2K incompat feature flag.
.IP
.nf
\f[C]
$\ pmempool\ feature\ \-\-query\ CHECKSUM_2K\ pool.set
0
\f[]
.fi
.PP
Prints POOL_FEAT_CKSUM_2K incompat feature flag value.
.SH SEE ALSO
.PP
\f[B]poolset\f[](5) and \f[B]\f[]
pmdk-1.8/doc/pmempool/pmempool-convert.1.md 0000664 0000000 0000000 00000004754 13615011243 017407 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMPOOL-CONVERT, 1)
collection: pmempool
header: PMDK
date: pmem Tools version 1.4
...
[comment]: <> (Copyright 2016-2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmempool-convert.1 -- man page for pmempool-convert)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[EXAMPLE](#example)
[SEE ALSO](#see-also)
# NAME #
**pmempool-convert** - this is a wrapper around pmdk-convert tool. More information
can be found in **pmdk-convert**(1) man page.
# SEE ALSO #
**pmdk-convert**(1), **pmempool**(1), **libpmemblk**(7), **libpmemlog**(7),
**libpmemobj**(7), **libpmempool**(7) and ****
pmdk-1.8/doc/pmempool/pmempool.1 0000644 0000000 0000000 00000010037 13615011420 015314 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMPOOL" "1" "2020-01-31" "PMDK - pmem Tools version 1.4" "PMDK Programmer's Manual"
.hy
.\" Copyright 2016-2019, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmempool\f[] \- Persistent Memory Pool Management Tool
.SH SYNOPSIS
.IP
.nf
\f[C]
$\ pmempool\ [\-\-help]\ [\-\-version]\ \ []
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]pmempool\f[] is a management tool for \f[I]Persistent
Memory\f[] pool files created by \f[B]PMDK\f[] libraries.
.PP
The main purpose of \f[B]pmempool\f[] is to provide a user with a set of
utilities for off\-line analysis and manipulation of pools created by
pmem libraries.
The pmempool is a generic command which consists of subcommands for
specific purposes.
Some of subcommands are required to work \f[I]without\f[] any impact on
processed pool, but some of them \f[I]may\f[] create a new or modify an
existing one.
.PP
The \f[B]pmempool\f[] may be useful for troubleshooting by system
administrators and for software developers who work on applications
based on \f[B]PMDK\f[].
The latter may find these tools useful for testing and debugging
purposes also.
.SH OPTIONS
.PP
\f[C]\-V,\ \-\-version\f[]
.PP
Prints the version of \f[B]pmempool\f[].
.PP
\f[C]\-h,\ \-\-help\f[]
.PP
Prints synopsis and list of commands.
.SH COMMANDS
.PP
Currently there is a following set of commands available:
.IP \[bu] 2
\f[B]pmempool\-info\f[](1) \- Prints information and statistics in
human\-readable format about specified pool.
.IP \[bu] 2
\f[B]pmempool\-check\f[](1) \- Checks pool's consistency and repairs
pool if it is not consistent.
.IP \[bu] 2
\f[B]pmempool\-create\f[](1) \- Creates a pool of specified type with
additional properties specific for this type of pool.
.IP \[bu] 2
\f[B]pmempool\-dump\f[](1) \- Dumps usable data from pool in hexadecimal
or binary format.
.IP \[bu] 2
\f[B]pmempool\-rm\f[](1) \- Removes pool file or all pool files listed
in pool set configuration file.
.IP \[bu] 2
\f[B]pmempool\-convert\f[](1) \- Updates the pool to the latest
available layout version.
.IP \[bu] 2
\f[B]pmempool\-sync\f[](1) \- Synchronizes replicas within a poolset.
.IP \[bu] 2
\f[B]pmempool\-transform\f[](1) \- Modifies internal structure of a
poolset.
.IP \[bu] 2
\f[B]pmempool\-feature\f[](1) \- Toggle or query a poolset features.
.PP
In order to get more information about specific \f[I]command\f[] you can
use \f[B]pmempool help .\f[]
.SH SEE ALSO
.PP
\f[B]libpmemblk\f[](7), \f[B]libpmemlog\f[](7), \f[B]libpmemobj\f[](7)
and \f[B]\f[]
pmdk-1.8/doc/pmempool/pmempool-rm.1 0000644 0000000 0000000 00000010340 13615011420 015725 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMPOOL-RM" "1" "2020-01-31" "PMDK - pmem Tools version 1.4" "PMDK Programmer's Manual"
.hy
.\" Copyright 2016-2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmempool\-rm\f[] \- remove a persistent memory pool
.SH SYNOPSIS
.IP
.nf
\f[C]
$\ pmempool\ rm\ []\ ..
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]pmempool rm\f[] command removes each specified file.
If the specified file is a pool set file, all pool files (single\-file
pool or part files) and remote replicas are removed.
By default the \f[B]pmempool rm\f[] does not remove pool set files.
All local and remote pool files are removed using \f[B]unlink\f[](3)
call, except the pools created on \f[B]device dax\f[] which are zeroed
instead.
If specified file does not exist, the remote pool is broken or not
accessible, the \f[B]pmempool rm\f[] command terminates with an error
code.
By default it prompts before removing \f[I]write\-protected\f[] local
files.
See \f[B]REMOTE REPLICATION\f[] section for more details about support
for remote pools.
See \f[B]EXAMPLES\f[] section for example usage of the \f[I]rm\f[]
command.
.SS Available options:
.PP
\f[C]\-h,\ \-\-help\f[]
.PP
Print help message
.PP
\f[C]\-v,\ \-\-verbose\f[]
.PP
Be verbose and print all removing files.
.PP
\f[C]\-s,\ \-\-only\-pools\f[]
.PP
Remove only pool files and do not remove pool set files (default
behaviour).
.PP
\f[C]\-a,\ \-\-all\f[]
.PP
Remove all pool set files \- local and remote.
.PP
\f[C]\-l,\ \-\-local\f[]
.PP
Remove local pool set files.
.PP
\f[C]\-r,\ \-\-remote\f[]
.PP
Remove remote pool set files.
.PP
\f[C]\-f,\ \-\-force\f[]
.PP
Remove all specified files, ignore nonexistent files, never prompt.
.PP
\f[C]\-i,\ \-\-interactive\f[]
.PP
Prompt before removing every single file or remote pool.
.SH REMOTE REPLICATION
.PP
A remote pool is removed using \f[B]rpmem_remove\f[](3) function if
\f[B]librpmem\f[](7) library is available.
If a pool set file contains remote replication but \f[B]librpmem\f[](7)
is not available, the \f[B]pmempool rm\f[] command terminates with an
error code, unless the \f[B]\-f, \[en]force\f[] option is specified.
.SH EXAMPLE
.IP
.nf
\f[C]
$\ pmempool\ rm\ pool.obj\ pool.blk
\f[]
.fi
.PP
Remove specified pool files.
.IP
.nf
\f[C]
$\ pmempool\ rm\ pool.set
\f[]
.fi
.PP
Remove all pool files from the \[lq]pool.set\[rq], do not remove
\f[I]pool.set\f[] itself.
.IP
.nf
\f[C]
$\ pmempool\ rm\ \-a\ pool.set
\f[]
.fi
.PP
Remove all pool files from the \[lq]pool.set\[rq], remove the local pool
set file and all remote pool set files.
.SH SEE ALSO
.PP
\f[B]pmempool\f[](1), \f[B]libpmemblk\f[](7), \f[B]libpmemlog\f[](7),
\f[B]libpmemobj\f[](7), \f[B]librpmem\f[](7) and
\f[B]\f[]
pmdk-1.8/doc/pmempool/pmempool-create.1 0000644 0000000 0000000 00000013253 13615011420 016560 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMPOOL-CREATE" "1" "2020-01-31" "PMDK - pmem Tools version 1.4" "PMDK Programmer's Manual"
.hy
.\" Copyright 2016-2019, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmempool\-create\f[] \- create a persistent memory pool
.SH SYNOPSIS
.IP
.nf
\f[C]
$\ pmempool\ create\ []\ []\ []\
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]pmempool\f[] invoked with \f[I]create\f[] command creates a
pool file of specified type.
Depending on a pool type it is possible to provide more properties of
pool.
.PP
Valid pool types are: \f[B]blk\f[], \f[B]log\f[] and \f[B]obj\f[] which
stands for \f[I]pmemblk\f[], \f[I]pmemlog\f[] and \f[I]pmemobj\f[] pools
respectively.
By default the pool file is created with \f[I]minimum\f[] allowed size
for specified pool type.
The minimum sizes for \f[B]blk\f[], \f[B]log\f[] and \f[B]obj\f[] pool
types are \f[B]PMEMBLK_MIN_POOL\f[], \f[B]PMEMLOG_MIN_POOL\f[] and
\f[B]PMEMOBJ_MIN_POOL\f[] respectively.
See \f[B]libpmemblk\f[](7), \f[B]libpmemlog\f[](7) and
\f[B]libpmemobj\f[](7) for details.
.PP
For \f[I]pmemblk\f[] pool type block size \f[I]\f[] is a required
argument.
.PP
In order to set custom size of pool use \f[B]\-s\f[] option, or use
\f[B]\-M\f[] option to create a pool of maximum available size on
underlying file system.
.PP
The \f[I]size\f[] argument may be passed in format that permits only the
upper\-case character for byte \- B as specified in IEC 80000\-13, IEEE
1541 and the Metric Interchange Format.
Standards accept SI units with obligatory B \- kB, MB, GB, \&... which
means multiplier by 1000 and IEC units with optional \[lq]iB\[rq] \-
KiB, MiB, GiB, \&..., K, M, G, \&... \- which means multiplier by 1024.
.SS Available options:
.PP
\f[C]\-s,\ \-\-size\ \f[]
.PP
Size of pool file.
.PP
\f[C]\-M,\ \-\-max\-size\f[]
.PP
Set size of pool to available space of underlying file system.
.PP
\f[C]\-m,\ \-\-mode\ \f[]
.PP
Set permissions to (the default is 0664) when creating the files.
If the file already exist the permissions are not changed.
.PP
\f[C]\-i,\ \-\-inherit\ \f[]
.PP
Create a new pool of the same size and other properties as
\f[I]\f[].
.PP
\f[C]\-b,\ \-\-clear\-bad\-blocks\f[]
.PP
Clear bad blocks in existing files.
.PP
\f[C]\-f,\ \-\-force\f[]
.PP
Remove the pool before creating.
.PP
\f[C]\-v,\ \-\-verbose\f[]
.PP
Increase verbosity level.
.PP
\f[C]\-h,\ \-\-help\f[]
.PP
Display help message and exit.
.SS Options for PMEMBLK:
.PP
By default when creating a pmem \f[B]blk\f[] pool, the \f[B]BTT\f[]
layout is \f[I]not\f[] written until the first \f[I]write operation\f[]
of block entry is performed.
Using \f[B]\-w\f[] option you can force writing the \f[B]BTT\f[] layout
by writing zero data to specified block number.
By default the \f[I]write operation\f[] is performed to block number 0.
Please refer to \f[B]libpmemblk\f[](7) for details.
.PP
\f[C]\-w,\ \-\-write\-layout\f[]
.PP
Force writing the \f[B]BTT\f[] layout by performing \f[I]write
operation\f[] to block number zero.
.SS Options for PMEMOBJ:
.PP
By default when creating a pmem \f[B]obj\f[] pool, the layout name
provided to the \f[B]libpmemobj\f[] library is an empty string.
Please refer to \f[B]libpmemobj\f[](7) for details.
.PP
\f[C]\-l,\ \-\-layout\ \f[]
.PP
Layout name of the \f[B]pmemobj\f[] pool.
.SH EXAMPLE
.IP
.nf
\f[C]
$\ pmempool\ create\ blk\ 512\ pool.blk
\f[]
.fi
.PP
Create a blk pool file of minimum allowed size and block size 512 bytes
.IP
.nf
\f[C]
$\ pmempool\ create\ log\ \-M\ pool.log
\f[]
.fi
.PP
Create a log pool file of maximum allowed size
.IP
.nf
\f[C]
$\ pmempool\ create\ blk\ \-\-size=4G\ \-\-write\-layout\ 1K\ pool.blk
\f[]
.fi
.PP
Create a blk pool file of size 4G, block size 1K and write the BTT
layout
.IP
.nf
\f[C]
$\ pmempool\ create\ \-\-layout\ my_layout\ obj\ pool.obj
\f[]
.fi
.PP
Create an obj pool file of minimum allowed size and layout
\[lq]my_layout\[rq]
.IP
.nf
\f[C]
$\ pmempool\ create\ \-\-inherit=pool.log\ new_pool.log
\f[]
.fi
.PP
Create a pool file based on pool.log file
.SH SEE ALSO
.PP
\f[B]pmempool\f[](1), \f[B]libpmemblk\f[](7), \f[B]libpmemlog\f[](7),
\f[B]libpmemobj\f[](7) and \f[B]\f[]
pmdk-1.8/doc/pmempool/pmempool-transform.1.md 0000664 0000000 0000000 00000015220 13615011243 017730 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMPOOL-TRANSFORM, 1)
collection: pmempool
header: PMDK
date: pmem Tools version 1.4
...
[comment]: <> (Copyright 2016-2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmempool-transform.1 -- man page for pmempool-transform)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[EXAMPLES](#examples)
[SEE ALSO](#see-also)
# NAME #
**pmempool-transform** - Modify internal structure of a pool set.
# SYNOPSIS #
```
pmempool transform [options]
```
# DESCRIPTION #
The **pmempool transform** command modifies internal structure of a pool set
defined by the `poolset_file_src` file, according to a structure described in
the `poolset_file_dst` file.
The following operations are supported:
* adding replicas - one or more new replicas can be added and synchronized with
other replicas in the pool set,
* removing replicas - one or more replicas can be removed from the pool set
_WINUX(.,=q=,
* adding or removing pool set options.=e=)
Only one of the above operations can be performed at a time.
Currently adding and removing replicas are allowed only for **pmemobj** pools
(see **libpmemobj**(7)).
The *poolset_file_src* argument provides the source pool set to be changed.
The *poolset_file_dst* argument points to the target pool set.
_WINUX(=q=When adding or deleting replicas, the two pool set files can differ only in the
definitions of replicas which are to be added or deleted. One cannot add and
remove replicas in the same step. Only one of these operations can be performed
at a time. Reordering replicas is not supported
Also, to add a replica it is necessary for its effective size to match or exceed
the pool size. Otherwise the whole operation fails and no changes are applied.
Effective size of a replica is the sum of sizes of all its part files decreased
by 4096 bytes per each part file. The 4096 bytes of each part file is
utilized for storing internal metadata of the pool part files.=e=)
_WINUX(,=q=When adding or deleting replicas, the two pool set files can differ
only in the definitions of replicas which are to be added or deleted. When
adding or removing pool set options (see **poolset**(5)), the rest of both pool
set files have to be of the same structure. The operation of adding/removing
a pool set option can be performed on a pool set with local replicas only. To
add/remove a pool set option to/from a pool set with remote replicas, one has
to remove the remote replicas first, then add/remove the option, and finally
recreate the remote replicas having added/removed the pool set option to/from
the remote replicas' poolset files.
To add a replica it is necessary for its effective size to match or exceed the
pool size. Otherwise the whole operation fails and no changes are applied.
If none of the poolset options is used, the effective size of a replica is the
sum of sizes of all its part files decreased by 4096 bytes per each part file.
The 4096 bytes of each part file is utilized for storing internal metadata of
the pool part files.
If the option *SINGLEHDR* is used, the effective size of a replica is the sum of
sizes of all its part files decreased once by 4096 bytes. In this case only
the first part contains internal metadata.
If the option *NOHDRS* is used, the effective size of a replica is the sum of
sizes of all its part files. In this case none of the parts contains internal
metadata.=e=)
##### Available options: #####
`-d, --dry-run`
: Enable dry run mode. In this mode no changes are applied, only check for
viability of the operation is performed.
`-v, --verbose`
: Increase verbosity level.
`-h, --help`
: Display help message and exit.
# EXAMPLES #
##### Example 1. #####
Let files `/path/poolset_file_src` and `/path/poolset_file_dst` have the
following contents:
```
PMEMPOOLSET
20M /0/partfile1
20M /0/partfile2
25M /0/partfile3
REPLICA
40M /1/partfile1
20M /1/partfile2
```
```
PMEMPOOLSET
20M /0/partfile1
20M /0/partfile2
25M /0/partfile3
REPLICA
40M /1/partfile1
20M /1/partfile2
REPLICA
50M /2/partfile1
20M /2/partfile2
```
Then, the command
`pmempool transform /path/poolset_file_src /path/poolset_file_dst`
adds a replica to the pool set. All other replicas remain unchanged and
the size of the pool remains 60M.
##### Example 2. #####
Let files `/path/poolset_file_src` and `/path/poolset_file_dst` have the
following contents:
```
PMEMPOOLSET
20M /0/partfile1
20M /0/partfile2
25M /0/partfile3
REPLICA
40M /1/partfile1
20M /1/partfile2
```
```
PMEMPOOLSET
20M /0/partfile1
20M /0/partfile2
25M /0/partfile3
```
Then
`pmempool_transform /path/poolset_file_src /path/poolset_file_dst`
deletes the second replica from the pool set. The first replica remains
unchanged and the size of the pool is still 60M.
# SEE ALSO #
**pmempool(1)**, **libpmemblk(7)**, **libpmemlog(7)**,
**libpmempool(7)** and ****
pmdk-1.8/doc/pmempool/pmempool-feature.1.md 0000664 0000000 0000000 00000011434 13615011243 017353 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMPOOL-FEATURE, 1)
collection: pmempool
header: PMDK
date: pmem Tools version 1.4
...
[comment]: <> (Copyright 2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmempool-feature.1 -- man page for pmempool-feature)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[COMPATIBILITY](#compatibility)
[DISCLAIMER](#disclaimer)
[EXAMPLE](#example)
[SEE ALSO](#see-also)
# NAME #
**pmempool-feature** - toggle or query pool set features
# SYNOPSIS #
```
$ pmempool feature (-e|-d|-q feature-name) [options]
```
# DESCRIPTION #
The **pmempool feature** command enables / disables or queries pool set features.
Available pool *feature-names* are:
+ **SINGLEHDR** - only the first part in each replica contains the pool part
internal metadata. This value can be used only with **-q**. It can not be
enabled or disabled. For details see **poolset**(5).
+ **CHECKSUM_2K** - only the first 2KiB of pool part internal metadata
is checksummed. Other features may depend on this one to store additional metadata
in otherwise unused second 2KiB part of a header.
When **CHECKSUM_2K** is disabled whole 4KiB is checksummed.
+ **SHUTDOWN_STATE** - enables additional check performed during
pool open which verifies pool consistency in the presence of dirty shutdown.
**CHECKSUM_2K** has to be enabled prior to **SHUTDOWN_STATE**
otherwise enabling **SHUTDOWN_STATE** will fail.
+ **CHECK_BAD_BLOCKS** - enables checking bad blocks performed during opening
a pool and fixing bad blocks performed by pmempool-sync during syncing a pool.
Currently (Linux kernel v4.19, libndctl v62) checking and fixing bad blocks
require read access to the following resource files (containing physical
addresses) of NVDIMM devices which only root can read by default:
```
/sys/bus/nd/devices/ndbus*/region*/resource
/sys/bus/nd/devices/ndbus*/region*/dax*/resource
/sys/bus/nd/devices/ndbus*/region*/pfn*/resource
/sys/bus/nd/devices/ndbus*/region*/namespace*/resource
```
It is possible to use poolset as *file* argument. But poolsets with remote
replicas are not supported.
##### Available options: #####
`-h, --help`
Print help message.
`-v, --verbose`
Increase verbosity level.
`-e, --enable feature-name`
Enable feature for pool set.
`-d, --disable feature-name`
Disable feature for pool set.
`-q, --query feature-name`
Print feature status.
# COMPATIBILITY #
Poolsets with features not defined in this document (e.g. enabled by the newer
software version) are not supported.
# DISCLAIMER #
```pmempool feature``` command is not fail safe.
# EXAMPLE #
```
$ pmempool feature --enable CHECKSUM_2K pool.set
```
Enables POOL_FEAT_CKSUM_2K incompat feature flag.
```
$ pmempool feature --disable CHECKSUM_2K pool.set
```
Disables POOL_FEAT_CKSUM_2K incompat feature flag.
```
$ pmempool feature --query CHECKSUM_2K pool.set
0
```
Prints POOL_FEAT_CKSUM_2K incompat feature flag value.
# SEE ALSO #
**poolset**(5) and ****
pmdk-1.8/doc/libpmemblk/ 0000775 0000000 0000000 00000000000 13615011416 013676 5 ustar root root pmdk-1.8/doc/libpmemblk/pmemblk_open.3 0000664 0000000 0000000 00000000025 13615011243 016425 0 ustar root root .so pmemblk_create.3
pmdk-1.8/doc/libpmemblk/pmemblk_check.3 0000664 0000000 0000000 00000000025 13615011243 016541 0 ustar root root .so pmemblk_create.3
pmdk-1.8/doc/libpmemblk/libpmemblk.7 0000644 0000000 0000000 00000032622 13615011416 016107 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "LIBPMEMBLK" "7" "2020-01-31" "PMDK - pmemblk API version 1.1" "PMDK Programmer's Manual"
.hy
.\" Copyright 2016-2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]libpmemblk\f[] \- persistent memory resident array of blocks
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\
cc\ ...\ \-lpmemblk\ \-lpmem
\f[]
.fi
.SS Library API versioning:
.IP
.nf
\f[C]
const\ char\ *pmemblk_check_version(
\ \ \ \ unsigned\ major_required,
\ \ \ \ unsigned\ minor_required);
\f[]
.fi
.SS Managing library behavior:
.IP
.nf
\f[C]
void\ pmemblk_set_funcs(
\ \ \ \ void\ *(*malloc_func)(size_t\ size),
\ \ \ \ void\ (*free_func)(void\ *ptr),
\ \ \ \ void\ *(*realloc_func)(void\ *ptr,\ size_t\ size),
\ \ \ \ char\ *(*strdup_func)(const\ char\ *s));
\f[]
.fi
.SS Error handling:
.IP
.nf
\f[C]
const\ char\ *pmemblk_errormsg(void);
\f[]
.fi
.SS Other library functions:
.PP
A description of other \f[B]libpmemblk\f[] functions can be found on the
following manual pages:
.PP
\f[B]pmemblk_bsize\f[](3), \f[B]pmemblk_create\f[](3),
\f[B]pmemblk_ctl_exec\f[](3), \f[B]pmemblk_ctl_get\f[](3),
\f[B]pmemblk_ctl_set\f[](3), \f[B]pmemblk_read\f[](3),
\f[B]pmemblk_set_zero\f[](3),
.SH DESCRIPTION
.PP
\f[B]libpmemblk\f[] provides an array of blocks in \f[I]persistent
memory\f[] (pmem) such that updates to a single block are atomic.
This library is intended for applications using direct access storage
(DAX), which is storage that supports load/store access without paging
blocks from a block storage device.
Some types of \f[I]non\-volatile memory DIMMs\f[] (NVDIMMs) provide this
type of byte addressable access to storage.
A \f[I]persistent memory aware file system\f[] is typically used to
expose the direct access to applications.
Memory mapping a file from this type of file system results in the
load/store, non\-paged access to pmem.
\f[B]libpmemblk\f[] builds on this type of memory mapped file.
.PP
This library is for applications that need a potentially large array of
blocks, all the same size, where any given block is updated atomically
(the update cannot be \f[I]torn\f[] by program interruption such as
power failures).
This library builds on the low\-level pmem support provided by
\f[B]libpmem\f[](7), handling the transactional update of the blocks,
flushing to persistence, and recovery for the application.
\f[B]libpmemblk\f[] is one of a collection of persistent memory
libraries available, the others are:
.IP \[bu] 2
\f[B]libpmemobj\f[](7), a general use persistent memory API, providing
memory allocation and transactional operations on variable\-sized
objects.
.IP \[bu] 2
\f[B]libpmemlog\f[](7), providing a pmem\-resident log file.
.IP \[bu] 2
\f[B]libpmem\f[](7), low\-level persistent memory support.
.PP
Under normal usage, \f[B]libpmemblk\f[] will never print messages or
intentionally cause the process to exit.
The only exception to this is the debugging information, when enabled,
as described under \f[B]DEBUGGING AND ERROR HANDLING\f[] below.
.PP
To use the atomic block arrays supplied by \f[B]libpmemblk\f[], a
\f[I]memory pool\f[] is first created using the
\f[B]pmemblk_create\f[]() function described in
\f[B]pmemblk_create\f[](3).
The other \f[B]libpmemblk\f[] functions operate on the resulting block
memory pool using the opaque handle, of type \f[I]PMEMblkpool*\f[], that
is returned by \f[B]pmemblk_create\f[]() or \f[B]pmemblk_open\f[]().
Internally, \f[B]libpmemblk\f[] will use either \f[B]pmem_persist\f[](3)
or \f[B]msync\f[](2) when it needs to flush changes, depending on
whether the memory pool appears to be persistent memory or a regular
file (see the \f[B]pmem_is_pmem\f[](3) function in \f[B]libpmem\f[](7)
for more information).
There is no need for applications to flush changes directly when using
the block memory API provided by \f[B]libpmemblk\f[].
.SH CAVEATS
.PP
\f[B]libpmemblk\f[] relies on the library destructor being called from
the main thread.
For this reason, all functions that might trigger destruction (e.g.
\f[B]dlclose\f[](3)) should be called in the main thread.
Otherwise some of the resources associated with that thread might not be
cleaned up properly.
.SH LIBRARY API VERSIONING
.PP
This section describes how the library API is versioned, allowing
applications to work with an evolving API.
.PP
The \f[B]pmemblk_check_version\f[]() function is used to determine
whether the installed \f[B]libpmemblk\f[] supports the version of the
library API required by an application.
The easiest way to do this is for the application to supply the
compile\-time version information, supplied by defines in
\f[B]\f[], like this:
.IP
.nf
\f[C]
reason\ =\ pmemblk_check_version(PMEMBLK_MAJOR_VERSION,
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ PMEMBLK_MINOR_VERSION);
if\ (reason\ !=\ NULL)\ {
\ \ \ \ /*\ version\ check\ failed,\ reason\ string\ tells\ you\ why\ */
}
\f[]
.fi
.PP
Any mismatch in the major version number is considered a failure, but a
library with a newer minor version number will pass this check since
increasing minor versions imply backwards compatibility.
.PP
An application can also check specifically for the existence of an
interface by checking for the version where that interface was
introduced.
These versions are documented in this man page as follows: unless
otherwise specified, all interfaces described here are available in
version 1.0 of the library.
Interfaces added after version 1.0 will contain the text \f[I]introduced
in version x.y\f[] in the section of this manual describing the feature.
.PP
When the version check performed by \f[B]pmemblk_check_version\f[]() is
successful, the return value is NULL.
Otherwise the return value is a static string describing the reason for
failing the version check.
The string returned by \f[B]pmemblk_check_version\f[]() must not be
modified or freed.
.SH MANAGING LIBRARY BEHAVIOR
.PP
The \f[B]pmemblk_set_funcs\f[]() function allows an application to
override memory allocation calls used internally by \f[B]libpmemblk\f[].
Passing in NULL for any of the handlers will cause the
\f[B]libpmemblk\f[] default function to be used.
The library does not make heavy use of the system malloc functions, but
it does allocate approximately 4\-8 kilobytes for each memory pool in
use.
.SH DEBUGGING AND ERROR HANDLING
.PP
The \f[B]pmemblk_errormsg\f[]() function returns a pointer to a static
buffer containing the last error message logged for the current thread.
If \f[I]errno\f[] was set, the error message may include a description
of the corresponding error code, as returned by \f[B]strerror\f[](3).
The error message buffer is thread\-local; errors encountered in one
thread do not affect its value in other threads.
The buffer is never cleared by any library function; its content is
significant only when the return value of the immediately preceding call
to a \f[B]libpmemblk\f[] function indicated an error, or if
\f[I]errno\f[] was set.
The application must not modify or free the error message string, but it
may be modified by subsequent calls to other library functions.
.PP
Two versions of \f[B]libpmemblk\f[] are typically available on a
development system.
The normal version, accessed when a program is linked using the
\f[B]\-lpmemblk\f[] option, is optimized for performance.
That version skips checks that impact performance and never logs any
trace information or performs any run\-time assertions.
If an error is detected in a call to \f[B]libpmemblk\f[], the error
message describing the failure may be retrieved with
\f[B]pmemblk_errormsg\f[]() as described above.
.PP
A second version of \f[B]libpmemblk\f[], accessed when a program uses
the libraries under \f[B]/usr/lib/pmdk_debug\f[], contains run\-time
assertions and trace points.
The typical way to access the debug version is to set the
\f[B]LD_LIBRARY_PATH\f[] environment variable to
\f[B]/usr/lib/pmdk_debug\f[] or \f[B]/usr/lib64/pmdk_debug\f[], as
appropriate.
Debugging output is controlled using the following environment
variables.
These variables have no effect on the non\-debug version of the library.
.IP \[bu] 2
\f[B]PMEMBLK_LOG_LEVEL\f[]
.PP
The value of \f[B]PMEMBLK_LOG_LEVEL\f[] enables trace points in the
debug version of the library, as follows:
.IP \[bu] 2
\f[B]0\f[] \- This is the default level when \f[B]PMEMBLK_LOG_LEVEL\f[]
is not set.
No log messages are emitted at this level.
.IP \[bu] 2
\f[B]1\f[] \- Additional details on any errors detected are logged, in
addition to returning the \f[I]errno\f[]\-based errors as usual.
The same information may be retrieved using \f[B]pmemblk_errormsg\f[]().
.IP \[bu] 2
\f[B]2\f[] \- A trace of basic operations is logged.
.IP \[bu] 2
\f[B]3\f[] \- Enables a very verbose amount of function call tracing in
the library.
.IP \[bu] 2
\f[B]4\f[] \- Enables voluminous and fairly obscure tracing information
that is likely only useful to the \f[B]libpmemblk\f[] developers.
.PP
Unless \f[B]PMEMBLK_LOG_FILE\f[] is set, debugging output is written to
\f[I]stderr\f[].
.IP \[bu] 2
\f[B]PMEMBLK_LOG_FILE\f[]
.PP
Specifies the name of a file where all logging information should be
written.
If the last character in the name is \[lq]\-\[rq], the \f[I]PID\f[] of
the current process will be appended to the file name when the log file
is created.
If \f[B]PMEMBLK_LOG_FILE\f[] is not set, the logging output is written
to \f[I]stderr\f[].
.PP
See also \f[B]libpmem\f[](7) for information on other environment
variables that may affect \f[B]libpmemblk\f[] behavior.
.SH EXAMPLE
.PP
The following example illustrates how the \f[B]libpmemblk\f[] API is
used.
.IP
.nf
\f[C]
#include\
#include\
#include\
#include\
#include\
#include\
/*\ size\ of\ the\ pmemblk\ pool\ \-\-\ 1\ GB\ */
#define\ POOL_SIZE\ ((size_t)(1\ <<\ 30))
/*\ size\ of\ each\ element\ in\ the\ pmem\ pool\ */
#define\ ELEMENT_SIZE\ 1024
int
main(int\ argc,\ char\ *argv[])
{
\ \ \ \ const\ char\ path[]\ =\ "/pmem\-fs/myfile";
\ \ \ \ PMEMblkpool\ *pbp;
\ \ \ \ size_t\ nelements;
\ \ \ \ char\ buf[ELEMENT_SIZE];
\ \ \ \ /*\ create\ the\ pmemblk\ pool\ or\ open\ it\ if\ it\ already\ exists\ */
\ \ \ \ pbp\ =\ pmemblk_create(path,\ ELEMENT_SIZE,\ POOL_SIZE,\ 0666);
\ \ \ \ if\ (pbp\ ==\ NULL)
\ \ \ \ \ \ \ \ pbp\ =\ pmemblk_open(path,\ ELEMENT_SIZE);
\ \ \ \ if\ (pbp\ ==\ NULL)\ {
\ \ \ \ \ \ \ \ perror(path);
\ \ \ \ \ \ \ \ exit(1);
\ \ \ \ }
\ \ \ \ /*\ how\ many\ elements\ fit\ into\ the\ file?\ */
\ \ \ \ nelements\ =\ pmemblk_nblock(pbp);
\ \ \ \ printf("file\ holds\ %zu\ elements",\ nelements);
\ \ \ \ /*\ store\ a\ block\ at\ index\ 5\ */
\ \ \ \ strcpy(buf,\ "hello,\ world");
\ \ \ \ if\ (pmemblk_write(pbp,\ buf,\ 5)\ <\ 0)\ {
\ \ \ \ \ \ \ \ perror("pmemblk_write");
\ \ \ \ \ \ \ \ exit(1);
\ \ \ \ }
\ \ \ \ /*\ read\ the\ block\ at\ index\ 10\ (reads\ as\ zeros\ initially)\ */
\ \ \ \ if\ (pmemblk_read(pbp,\ buf,\ 10)\ <\ 0)\ {
\ \ \ \ \ \ \ \ perror("pmemblk_read");
\ \ \ \ \ \ \ \ exit(1);
\ \ \ \ }
\ \ \ \ /*\ zero\ out\ the\ block\ at\ index\ 5\ */
\ \ \ \ if\ (pmemblk_set_zero(pbp,\ 5)\ <\ 0)\ {
\ \ \ \ \ \ \ \ perror("pmemblk_set_zero");
\ \ \ \ \ \ \ \ exit(1);
\ \ \ \ }
\ \ \ \ /*\ ...\ */
\ \ \ \ pmemblk_close(pbp);
}
\f[]
.fi
.PP
See for more examples using the
\f[B]libpmemblk\f[] API.
.SH BUGS
.PP
Unlike \f[B]libpmemobj\f[](7), data replication is not supported in
\f[B]libpmemblk\f[].
Thus, specifying replica sections in pool set files is not allowed.
.SH ACKNOWLEDGEMENTS
.PP
\f[B]libpmemblk\f[] builds on the persistent memory programming model
recommended by the SNIA NVM Programming Technical Work Group:
.SH SEE ALSO
.PP
\f[B]msync\f[](2), \f[B]dlclose\f[](3), \f[B]pmemblk_bsize\f[](3),
\f[B]pmemblk_create\f[](3), \f[B]pmemblk_ctl_exec\f[](3),
\f[B]pmemblk_ctl_get\f[](3), \f[B]pmemblk_ctl_set\f[](3),
\f[B]pmemblk_read\f[](3), \f[B]pmemblk_set_zero\f[](3),
\f[B]pmem_is_pmem\f[](3), \f[B]pmem_persist\f[](3),
\f[B]strerror\f[](3), \f[B]libpmem\f[](7), \f[B]libpmemlog\f[](7),
\f[B]libpmemobj\f[](7) and \f[B]\f[]
pmdk-1.8/doc/libpmemblk/pmemblk_nblock.3 0000664 0000000 0000000 00000000024 13615011243 016733 0 ustar root root .so pmemblk_bsize.3
pmdk-1.8/doc/libpmemblk/pmemblk_create.3 0000644 0000000 0000000 00000021421 13615011416 016732 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMBLK_CREATE" "3" "2020-01-31" "PMDK - pmemblk API version 1.1" "PMDK Programmer's Manual"
.hy
.\" Copyright 2017-2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmemblk_create\f[](), \f[B]pmemblk_open\f[](),
\f[B]pmemblk_close\f[](), \f[B]pmemblk_check\f[]() \- create, open,
close and validate block pool
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\
PMEMblkpool\ *pmemblk_create(const\ char\ *path,\ size_t\ bsize,
\ \ \ \ \ \ \ \ size_t\ poolsize,\ mode_t\ mode);
PMEMblkpool\ *pmemblk_open(const\ char\ *path,\ size_t\ bsize);
void\ pmemblk_close(PMEMblkpool\ *pbp);
int\ pmemblk_check(const\ char\ *path,\ size_t\ bsize);
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]pmemblk_create\f[]() function creates a block memory pool with
the given total \f[I]poolsize\f[], divided into as many elements of size
\f[I]bsize\f[] as will fit in the pool.
Since the transactional nature of a block memory pool requires some
space overhead in the memory pool, the resulting number of available
blocks is less than \f[I]poolsize\f[]/\f[I]bsize\f[], and is made
available to the caller via the \f[B]pmemblk_nblock\f[](3) function.
Given the specifics of the implementation, the number of available
blocks for the user cannot be less than 256.
This translates to at least 512 internal blocks.
\f[I]path\f[] specifies the name of the memory pool file to be created.
\f[I]mode\f[] specifies the permissions to use when creating the file,
as described by \f[B]creat\f[](2).
The memory pool file is fully allocated to the size \f[I]poolsize\f[]
using \f[B]posix_fallocate\f[](3).
The caller may choose to take responsibility for creating the memory
pool file by creating it before calling \f[B]pmemblk_create\f[](), and
then specifying \f[I]poolsize\f[] as zero.
In this case \f[B]pmemblk_create\f[]() will take the pool size from the
size of the existing file, and will verify that the file appears to be
empty by searching for any non\-zero data in the pool header at the
beginning of the file.
The net pool size of a pool file is equal to the file size.
The minimum net pool size allowed by the library for a block pool is
defined in \f[B]\f[] as \f[B]PMEMBLK_MIN_POOL\f[].
\f[I]bsize\f[] can be any non\-zero value; however, \f[B]libpmemblk\f[]
will silently round up the given size to \f[B]PMEMBLK_MIN_BLK\f[], as
defined in \f[B]\f[].
.PP
Depending on the configuration of the system, the available
non\-volatile memory space may be divided into multiple memory devices.
In such case, the maximum size of the pmemblk memory pool could be
limited by the capacity of a single memory device.
\f[B]libpmemblk\f[](7) allows building a persistent memory resident
array spanning multiple memory devices by creation of persistent memory
pools consisting of multiple files, where each part of such a \f[I]pool
set\f[] may be stored on a different memory device or pmem\-aware
filesystem.
.PP
Creation of all the parts of the pool set can be done with
\f[B]pmemblk_create\f[](); however, the recommended method for creating
pool sets is by using the \f[B]pmempool\f[](1) utility.
.PP
When creating a pool set consisting of multiple files, the \f[I]path\f[]
argument passed to \f[B]pmemblk_create\f[]() must point to the special
\f[I]set\f[] file that defines the pool layout and the location of all
the parts of the pool set.
The \f[I]poolsize\f[] argument must be 0.
The meaning of the \f[I]mode\f[] argument does not change, except that
the same \f[I]mode\f[] is used for creation of all the parts of the pool
set.
.PP
For more information on pool set format, see \f[B]poolset\f[](5).
.PP
The \f[B]pmemblk_open\f[]() function opens an existing block memory
pool.
As with \f[B]pmemblk_create\f[](), \f[I]path\f[] must identify either an
existing block memory pool file, or the \f[I]set\f[] file used to create
a pool set.
The application must have permission to open the file and memory map the
file or pool set with read/write permissions.
If \f[I]bsize\f[] is non\-zero, \f[B]pmemblk_open\f[]() will verify that
the given block size matches the block size used when the pool was
created.
Otherwise, \f[B]pmemblk_open\f[]() will open the pool without verifying
the block size.
The \f[I]bsize\f[] can be determined using the \f[B]pmemblk_bsize\f[](3)
function.
.PP
Be aware that if the pool contains bad blocks inside, opening can be
aborted by the SIGBUS signal, because currently the pool is not checked
against bad blocks during opening.
It can be turned on by setting the CHECK_BAD_BLOCKS compat feature.
For details see description of this feature in
\f[B]pmempool\-feature\f[](1).
.PP
The \f[B]pmemblk_close\f[]() function closes the memory pool indicated
by \f[I]pbp\f[] and deletes the memory pool handle.
The block memory pool itself lives on in the file that contains it and
may be re\-opened at a later time using \f[B]pmemblk_open\f[]() as
described above.
.PP
The \f[B]pmemblk_check\f[]() function performs a consistency check of
the file indicated by \f[I]path\f[], and returns 1 if the memory pool is
found to be consistent.
If the pool is found not to be consistent, further use of the file with
\f[B]libpmemblk\f[] will result in undefined behavior.
The debug version of \f[B]libpmemblk\f[] will provide additional details
on inconsistencies when \f[B]PMEMBLK_LOG_LEVEL\f[] is at least 1, as
described in the \f[B]DEBUGGING AND ERROR HANDLING\f[] section in
\f[B]libpmemblk\f[](7).
\f[B]pmemblk_check\f[]() opens the given \f[I]path\f[] read\-only so it
never makes any changes to the file.
This function is not supported on Device DAX.
.SH RETURN VALUE
.PP
On success, \f[B]pmemblk_create\f[]() returns a \f[I]PMEMblkpool*\f[]
handle to the block memory pool.
On error, it returns NULL and sets \f[I]errno\f[] appropriately.
.PP
On success, \f[B]pmemblk_open\f[]() returns a \f[I]PMEMblkpool*\f[]
handle that can be used with most of the functions in
\f[B]libpmemblk\f[](7).
On error, it returns NULL and sets \f[I]errno\f[] appropriately.
Possible errors include:
.IP \[bu] 2
failure to open \f[I]path\f[]
.IP \[bu] 2
\f[I]path\f[] specifies a \f[I]set\f[] file and any of the pool set
files cannot be opened
.IP \[bu] 2
\f[I]path\f[] specifies a \f[I]set\f[] file and the actual size of any
file does not match the corresponding part size defined in the
\f[I]set\f[] file
.IP \[bu] 2
\f[I]bsize\f[] is non\-zero and does not match the block size given when
the pool was created.
\f[I]errno\f[] is set to \f[B]EINVAL\f[] in this case.
.PP
The \f[B]pmemblk_close\f[]() function returns no value.
.PP
\f[B]pmemblk_check\f[]() returns 1 if the memory pool is found to be
consistent.
If the check is successfully performed but the pool is found to be
inconsistent, \f[B]pmemblk_check\f[]() returns 0.
This includes the case where \f[I]bsize\f[] is non\-zero and does not
match the block size given when the pool was created.
If the consistency check cannot be performed, \f[B]pmemblk_check\f[]()
returns \-1 and sets \f[I]errno\f[] appropriately.
.SH CAVEATS
.PP
Not all file systems support \f[B]posix_fallocate\f[](3).
\f[B]pmemblk_create\f[]() will fail if the underlying file system does
not support \f[B]posix_fallocate\f[](3).
.SH SEE ALSO
.PP
\f[B]pmempool\f[](1), \f[B]creat\f[](2), \f[B]pmemblk_nblock\f[](3),
\f[B]posix_fallocate\f[](3), \f[B]poolset\f[](5), \f[B]libpmemblk\f[](7)
and \f[B]\f[]
pmdk-1.8/doc/libpmemblk/pmemblk_ctl_exec.3 0000664 0000000 0000000 00000000026 13615011243 017253 0 ustar root root .so pmemblk_ctl_get.3
pmdk-1.8/doc/libpmemblk/pmemblk_check_version.3 0000664 0000000 0000000 00000000026 13615011243 020307 0 ustar root root .so man7/libpmemblk.7
pmdk-1.8/doc/libpmemblk/pmemblk_write.3 0000664 0000000 0000000 00000000023 13615011243 016614 0 ustar root root .so pmemblk_read.3
pmdk-1.8/doc/libpmemblk/pmemblk_set_error.3 0000664 0000000 0000000 00000000027 13615011243 017472 0 ustar root root .so pmemblk_set_zero.3
pmdk-1.8/doc/libpmemblk/pmemblk_set_zero.3 0000644 0000000 0000000 00000005602 13615011416 017324 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMBLK_SET_ZERO" "3" "2020-01-31" "PMDK - pmemblk API version 1.1" "PMDK Programmer's Manual"
.hy
.\" Copyright 2017-2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmemblk_set_zero\f[](), \f[B]pmemblk_set_error\f[]() \- block
management functions
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\
int\ pmemblk_set_zero(PMEMblkpool\ *pbp,\ long\ long\ blockno);
int\ pmemblk_set_error(PMEMblkpool\ *pbp,\ long\ long\ blockno);
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]pmemblk_set_zero\f[]() function writes zeros to block number
\f[I]blockno\f[] in persistent memory resident array of blocks
\f[I]pbp\f[].
Using this function is faster than actually writing a block of zeros
since \f[B]libpmemblk\f[](7) uses metadata to indicate the block should
read back as zero.
.PP
The \f[B]pmemblk_set_error\f[]() function sets the error state for block
number \f[I]blockno\f[] in persistent memory resident array of blocks
\f[I]pbp\f[].
A block in the error state returns \f[I]errno\f[] \f[B]EIO\f[] when
read.
Writing the block clears the error state and returns the block to normal
use.
.SH RETURN VALUE
.PP
On success, \f[B]pmemblk_set_zero\f[]() and \f[B]pmemblk_set_error\f[]()
return 0.
On error, they return \-1 and set \f[I]errno\f[] appropriately.
.SH SEE ALSO
.PP
\f[B]libpmemblk\f[](7) and \f[B]\f[]
pmdk-1.8/doc/libpmemblk/pmemblk_errormsg.3 0000664 0000000 0000000 00000000026 13615011243 017325 0 ustar root root .so man7/libpmemblk.7
pmdk-1.8/doc/libpmemblk/.gitignore 0000664 0000000 0000000 00000000142 13615011243 015661 0 ustar root root libpmemblk.7
pmemblk_bsize.3
pmemblk_create.3
pmemblk_ctl_get.3
pmemblk_read.3
pmemblk_set_zero.3
pmdk-1.8/doc/libpmemblk/pmemblk_ctl_get.3.md 0000664 0000000 0000000 00000012623 13615011243 017513 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMBLK_CTL_GET, 3)
collection: libpmemblk
header: PMDK
date: pmemblk API version 1.1
...
[comment]: <> (Copyright 2018-2019, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmemblk_ctl_get.3 -- man page for libpmemblk CTL)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[CTL NAMESPACE](#ctl-namespace)
[CTL EXTERNAL CONFIGURATION](#ctl-external-configuration)
[SEE ALSO](#see-also)
# NAME #
_UW(pmemblk_ctl_get),
_UW(pmemblk_ctl_set),
_UW(pmemblk_ctl_exec)
- Query and modify libpmemblk internal behavior (EXPERIMENTAL)
# SYNOPSIS #
```c
#include
_UWFUNCR2(int, pmemblk_ctl_get, PMEMblkpool *pbp, *name, void *arg,
=q= (EXPERIMENTAL)=e=)
_UWFUNCR2(int, pmemblk_ctl_set, PMEMblkpool *pbp, *name, void *arg,
=q= (EXPERIMENTAL)=e=)
_UWFUNCR2(int, pmemblk_ctl_exec, PMEMblkpool *pbp, *name, void *arg,
=q= (EXPERIMENTAL)=e=)
```
_UNICODE()
# DESCRIPTION #
The _UW(pmemblk_ctl_get), _UW(pmemblk_ctl_set) and _UW(pmemblk_ctl_exec)
functions provide a uniform interface for querying and modifying the internal
behavior of **libpmemblk**(7) through the control (CTL) namespace.
The *name* argument specifies an entry point as defined in the CTL namespace
specification. The entry point description specifies whether the extra *arg* is
required. Those two parameters together create a CTL query. The functions and
the entry points are thread-safe unless
indicated otherwise below. If there are special conditions for calling an entry
point, they are explicitly stated in its description. The functions propagate
the return value of the entry point. If either *name* or *arg* is invalid, -1
is returned.
If the provided ctl query is valid, the CTL functions will always return 0
on success and -1 on failure, unless otherwise specified in the entry point
description.
See more in **pmem_ctl**(5) man page.
# CTL NAMESPACE #
prefault.at_create | rw | global | int | int | - | boolean
If set, every page of the pool will be touched and written to when the pool
is created, in order to trigger page allocation and minimize the performance
impact of pagefaults. Affects only the _UW(pmemblk_create) function.
Always returns 0.
prefault.at_open | rw | global | int | int | - | boolean
If set, every page of the pool will be touched and written to when the pool
is opened, in order to trigger page allocation and minimize the performance
impact of pagefaults. Affects only the _UW(pmemblk_open) function.
Always returns 0.
sds.at_create | rw | global | int | int | - | boolean
If set, force-enables or force-disables SDS feature during pool creation.
Affects only the _UW(pmemblk_create) function. See **pmempool_feature_query**(3)
for information about SDS (SHUTDOWN_STATE) feature.
Always returns 0.
copy_on_write.at_open | rw | global | int | int | - | boolean
If set, pool is mapped in such a way that modifications don't reach the
underlying medium. From the user's perspective this means that when the pool
is closed all changes are reverted. This feature is not supported for pools
located on Device DAX.
Always returns 0.
# CTL EXTERNAL CONFIGURATION #
In addition to direct function call, each write entry point can also be set
using two alternative methods.
The first method is to load a configuration directly from the **PMEMBLK_CONF**
environment variable.
The second method of loading an external configuration is to set the
**PMEMBLK_CONF_FILE** environment variable to point to a file that contains
a sequence of ctl queries.
See more in **pmem_ctl**(5) man page.
# SEE ALSO #
**libpmemblk**(7), **pmem_ctl**(5) and ****
pmdk-1.8/doc/libpmemblk/pmemblk_read.3 0000644 0000000 0000000 00000005670 13615011416 016412 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMBLK_READ" "3" "2020-01-31" "PMDK - pmemblk API version 1.1" "PMDK Programmer's Manual"
.hy
.\" Copyright 2017-2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmemblk_read\f[](), \f[B]pmemblk_write\f[]() \- read or write a
block from a block memory pool
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\
int\ pmemblk_read(PMEMblkpool\ *pbp,\ void\ *buf,\ long\ long\ blockno);
int\ pmemblk_write(PMEMblkpool\ *pbp,\ const\ void\ *buf,\ long\ long\ blockno);
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]pmemblk_read\f[]() function reads the block with block number
\f[I]blockno\f[] from memory pool \f[I]pbp\f[] into the buffer
\f[I]buf\f[].
Reading a block that has never been written by \f[B]pmemblk_write\f[]()
will return a block of zeroes.
.PP
The \f[B]pmemblk_write\f[]() function writes a block from \f[I]buf\f[]
to block number \f[I]blockno\f[] in the memory pool \f[I]pbp\f[].
The write is atomic with respect to other reads and writes.
In addition, the write cannot be torn by program failure or system
crash; on recovery the block is guaranteed to contain either the old
data or the new data, never a mixture of both.
.SH RETURN VALUE
.PP
On success, the \f[B]pmemblk_read\f[]() and \f[B]pmemblk_write\f[]()
functions return 0.
On error, they return \-1 and set \f[I]errno\f[] appropriately.
.SH SEE ALSO
.PP
\f[B]libpmemblk\f[](7) and \f[B]\f[]
pmdk-1.8/doc/libpmemblk/pmemblk_set_zero.3.md 0000664 0000000 0000000 00000006357 13615011243 017733 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMBLK_SET_ZERO, 3)
collection: libpmemblk
header: PMDK
date: pmemblk API version 1.1
...
[comment]: <> (Copyright 2017-2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmemblk_set_zero.3 -- man page for block management functions)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[RETURN VALUE](#return-value)
[SEE ALSO](#see-also)
# NAME #
**pmemblk_set_zero**(), **pmemblk_set_error**() - block management functions
# SYNOPSIS #
```c
#include
int pmemblk_set_zero(PMEMblkpool *pbp, long long blockno);
int pmemblk_set_error(PMEMblkpool *pbp, long long blockno);
```
# DESCRIPTION #
The **pmemblk_set_zero**() function writes zeros to block number *blockno* in
persistent memory resident array of blocks *pbp*. Using this function is faster
than actually writing a block of zeros since **libpmemblk**(7) uses metadata to
indicate the block should read back as zero.
The **pmemblk_set_error**() function sets the error state for block number
*blockno* in persistent memory resident array of blocks *pbp*.
A block in the error state returns *errno* **EIO** when read.
Writing the block clears the error state and returns the block to normal use.
# RETURN VALUE #
On success, **pmemblk_set_zero**() and **pmemblk_set_error**() return 0.
On error, they return -1 and set *errno* appropriately.
# SEE ALSO #
**libpmemblk**(7) and ****
pmdk-1.8/doc/libpmemblk/pmemblk_set_funcs.3 0000664 0000000 0000000 00000000026 13615011243 017456 0 ustar root root .so man7/libpmemblk.7
pmdk-1.8/doc/libpmemblk/pmemblk_bsize.3 0000644 0000000 0000000 00000005634 13615011416 016613 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMBLK_BSIZE" "3" "2020-01-31" "PMDK - pmemblk API version 1.1" "PMDK Programmer's Manual"
.hy
.\" Copyright 2017-2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmemblk_bsize\f[](), \f[B]pmemblk_nblock\f[]() \- check number of
available blocks or usable space in block memory pool
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\
size_t\ pmemblk_bsize(PMEMblkpool\ *pbp);
size_t\ pmemblk_nblock(PMEMblkpool\ *pbp);
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]pmemblk_bsize\f[]() function returns the block size of the
specified block memory pool, that is, the value which was passed as
\f[I]bsize\f[] to \f[B]pmemblk_create\f[]().
\f[I]pbp\f[] must be a block memory pool handle as returned by
\f[B]pmemblk_open\f[](3) or \f[B]pmemblk_create\f[](3).
.PP
The \f[B]pmemblk_nblock\f[]() function returns the usable space in the
block memory pool.
\f[I]pbp\f[] must be a block memory pool handle as returned by
\f[B]pmemblk_open\f[](3) or \f[B]pmemblk_create\f[](3).
.SH RETURN VALUE
.PP
The \f[B]pmemblk_bsize\f[]() function returns the block size of the
specified block memory pool.
.PP
The \f[B]pmemblk_nblock\f[]() function returns the usable space in the
block memory pool, expressed as the number of blocks available.
.SH SEE ALSO
.PP
\f[B]pmemblk_create\f[](3), \f[B]pmemblk_open\f[](3),
\f[B]libpmemblk\f[](7) and \f[B]\f[]
pmdk-1.8/doc/libpmemblk/pmemblk_ctl_set.3 0000664 0000000 0000000 00000000026 13615011243 017122 0 ustar root root .so pmemblk_ctl_get.3
pmdk-1.8/doc/libpmemblk/pmemblk_close.3 0000664 0000000 0000000 00000000025 13615011243 016571 0 ustar root root .so pmemblk_create.3
pmdk-1.8/doc/libpmemblk/pmemblk_ctl_get.3 0000644 0000000 0000000 00000012066 13615011416 017115 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEMBLK_CTL_GET" "3" "2020-01-31" "PMDK - pmemblk API version 1.1" "PMDK Programmer's Manual"
.hy
.\" Copyright 2018-2019, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmemblk_ctl_get\f[](), \f[B]pmemblk_ctl_set\f[](),
\f[B]pmemblk_ctl_exec\f[]() \- Query and modify libpmemblk internal
behavior (EXPERIMENTAL)
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\
int\ pmemblk_ctl_get(PMEMblkpool\ *pbp,\ const\ char\ *name,\ void\ *arg);\ (EXPERIMENTAL)
int\ pmemblk_ctl_set(PMEMblkpool\ *pbp,\ const\ char\ *name,\ void\ *arg);\ (EXPERIMENTAL)
int\ pmemblk_ctl_exec(PMEMblkpool\ *pbp,\ const\ char\ *name,\ void\ *arg);\ (EXPERIMENTAL)
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]pmemblk_ctl_get\f[](), \f[B]pmemblk_ctl_set\f[]() and
\f[B]pmemblk_ctl_exec\f[]() functions provide a uniform interface for
querying and modifying the internal behavior of \f[B]libpmemblk\f[](7)
through the control (CTL) namespace.
.PP
The \f[I]name\f[] argument specifies an entry point as defined in the
CTL namespace specification.
The entry point description specifies whether the extra \f[I]arg\f[] is
required.
Those two parameters together create a CTL query.
The functions and the entry points are thread\-safe unless indicated
otherwise below.
If there are special conditions for calling an entry point, they are
explicitly stated in its description.
The functions propagate the return value of the entry point.
If either \f[I]name\f[] or \f[I]arg\f[] is invalid, \-1 is returned.
.PP
If the provided ctl query is valid, the CTL functions will always return
0 on success and \-1 on failure, unless otherwise specified in the entry
point description.
.PP
See more in \f[B]pmem_ctl\f[](5) man page.
.SH CTL NAMESPACE
.PP
prefault.at_create | rw | global | int | int | \- | boolean
.PP
If set, every page of the pool will be touched and written to when the
pool is created, in order to trigger page allocation and minimize the
performance impact of pagefaults.
Affects only the \f[B]pmemblk_create\f[]() function.
.PP
Always returns 0.
.PP
prefault.at_open | rw | global | int | int | \- | boolean
.PP
If set, every page of the pool will be touched and written to when the
pool is opened, in order to trigger page allocation and minimize the
performance impact of pagefaults.
Affects only the \f[B]pmemblk_open\f[]() function.
.PP
Always returns 0.
.PP
sds.at_create | rw | global | int | int | \- | boolean
.PP
If set, force\-enables or force\-disables SDS feature during pool
creation.
Affects only the \f[B]pmemblk_create\f[]() function.
See \f[B]pmempool_feature_query\f[](3) for information about SDS
(SHUTDOWN_STATE) feature.
.PP
Always returns 0.
.PP
copy_on_write.at_open | rw | global | int | int | \- | boolean
.PP
If set, pool is mapped in such a way that modifications don't reach the
underlying medium.
From the user's perspective this means that when the pool is closed all
changes are reverted.
This feature is not supported for pools located on Device DAX.
.PP
Always returns 0.
.SH CTL EXTERNAL CONFIGURATION
.PP
In addition to direct function call, each write entry point can also be
set using two alternative methods.
.PP
The first method is to load a configuration directly from the
\f[B]PMEMBLK_CONF\f[] environment variable.
.PP
The second method of loading an external configuration is to set the
\f[B]PMEMBLK_CONF_FILE\f[] environment variable to point to a file that
contains a sequence of ctl queries.
.PP
See more in \f[B]pmem_ctl\f[](5) man page.
.SH SEE ALSO
.PP
\f[B]libpmemblk\f[](7), \f[B]pmem_ctl\f[](5) and
\f[B]\f[]
pmdk-1.8/doc/libpmemblk/libpmemblk.7.md 0000664 0000000 0000000 00000031426 13615011243 016507 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(LIBPMEMBLK, 7)
collection: libpmemblk
header: PMDK
date: pmemblk API version 1.1
...
[comment]: <> (Copyright 2016-2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (libpmemblk.7 -- man page for libpmemblk)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[LIBRARY API VERSIONING](#library-api-versioning-1)
[MANAGING LIBRARY BEHAVIOR](#managing-library-behavior-1)
[DEBUGGING AND ERROR HANDLING](#debugging-and-error-handling)
[EXAMPLE](#example)
[BUGS](#bugs)
[ACKNOWLEDGEMENTS](#acknowledgements)
[SEE ALSO](#see-also)
# NAME #
**libpmemblk** - persistent memory resident array of blocks
# SYNOPSIS #
```c
#include
cc ... -lpmemblk -lpmem
```
_UNICODE()
##### Library API versioning: #####
```c
_UWFUNC(pmemblk_check_version, =q=
unsigned major_required,
unsigned minor_required=e=)
```
##### Managing library behavior: #####
```c
void pmemblk_set_funcs(
void *(*malloc_func)(size_t size),
void (*free_func)(void *ptr),
void *(*realloc_func)(void *ptr, size_t size),
char *(*strdup_func)(const char *s));
```
##### Error handling: #####
```c
_UWFUNC(pmemblk_errormsg, void)
```
##### Other library functions: #####
A description of other **libpmemblk** functions can be found on the following
manual pages:
**pmemblk_bsize**(3), **pmemblk_create**(3),
**pmemblk_ctl_exec**(3), **pmemblk_ctl_get**(3), **pmemblk_ctl_set**(3),
**pmemblk_read**(3), **pmemblk_set_zero**(3),
# DESCRIPTION #
**libpmemblk**
provides an array of blocks in *persistent memory* (pmem) such that updates
to a single block are atomic. This library is intended for applications
using direct access storage (DAX), which is storage that supports load/store
access without paging blocks from a block storage device. Some types of
*non-volatile memory DIMMs* (NVDIMMs) provide this type of byte addressable
access to storage. A *persistent memory aware file system* is typically used
to expose the direct access to applications. Memory mapping a file from this
type of file system results in the load/store, non-paged access to pmem.
**libpmemblk** builds on this type of memory mapped file.
This library is for applications that need a potentially large array of blocks,
all the same size, where any given block is updated atomically (the update
cannot be *torn* by program interruption such as power failures). This library
builds on the low-level pmem support provided by **libpmem**(7), handling the
transactional update of the blocks, flushing to persistence, and recovery for
the application. **libpmemblk** is one of a collection of persistent memory
libraries available, the others are:
+ **libpmemobj**(7), a general use persistent memory API, providing memory
allocation and transactional operations on variable-sized objects.
+ **libpmemlog**(7), providing a pmem-resident log file.
+ **libpmem**(7), low-level persistent memory support.
Under normal usage, **libpmemblk** will never print messages or intentionally
cause the process to exit. The only exception to this is the debugging
information, when enabled, as described under **DEBUGGING AND ERROR HANDLING**
below.
To use the atomic block arrays supplied by **libpmemblk**, a *memory pool*
is first created using the _UW(pmemblk_create) function described
in **pmemblk_create**(3). The other **libpmemblk** functions operate on
the resulting block memory pool using the opaque handle, of type
*PMEMblkpool\**, that is returned by _UW(pmemblk_create) or _UW(pmemblk_open).
Internally, **libpmemblk** will use either
**pmem_persist**(3) or **msync**(2) when it needs to flush changes, depending
on whether the memory pool appears to be persistent memory or a regular file
(see the **pmem_is_pmem**(3) function in **libpmem**(7) for more information).
There is no need for applications to flush changes directly when using the
block memory API provided by **libpmemblk**.
# CAVEATS #
**libpmemblk** relies on the library destructor being called from the main
thread. For this reason, all functions that might trigger destruction (e.g.
**dlclose**(3)) should be called in the main thread. Otherwise some of the
resources associated with that thread might not be cleaned up properly.
# LIBRARY API VERSIONING #
This section describes how the library API is versioned,
allowing applications to work with an evolving API.
The _UW(pmemblk_check_version) function is used to determine whether the
installed **libpmemblk** supports the version of the library API required
by an application. The easiest way to do this is for the application to
supply the compile-time version information, supplied by defines in
**\**, like this:
```c
reason = _U(pmemblk_check_version)(PMEMBLK_MAJOR_VERSION,
PMEMBLK_MINOR_VERSION);
if (reason != NULL) {
/* version check failed, reason string tells you why */
}
```
Any mismatch in the major version number is considered a failure, but a library
with a newer minor version number will pass this check since increasing minor
versions imply backwards compatibility.
An application can also check specifically for the existence of an interface
by checking for the version where that interface was introduced. These versions
are documented in this man page as follows: unless otherwise specified, all
interfaces described here are available in version 1.0 of the library.
Interfaces added after version 1.0 will contain the text *introduced in
version x.y* in the section of this manual describing the feature.
When the version check performed by _UW(pmemblk_check_version) is successful,
the return value is NULL. Otherwise the return value is a static string
describing the reason for failing the version check. The string returned by
_UW(pmemblk_check_version) must not be modified or freed.
# MANAGING LIBRARY BEHAVIOR #
The **pmemblk_set_funcs**() function allows an application to override memory
allocation calls used internally by **libpmemblk**.
Passing in NULL for any of the handlers will cause
the **libpmemblk** default function to be used.
The library does not make heavy use of the system malloc functions,
but it does allocate approximately 4-8 kilobytes for each memory pool in use.
# DEBUGGING AND ERROR HANDLING #
The _UW(pmemblk_errormsg) function returns a pointer to a static buffer
containing the last error message logged for the current thread. If *errno* was
set, the error message may include a description of the corresponding error
code, as returned by **strerror**(3). The error message buffer is thread-local;
errors encountered in one thread do not affect its value in other threads. The
buffer is never cleared by any library function; its content is significant
only when the return value of the immediately preceding call to a
**libpmemblk** function indicated an error, or if *errno* was set. The
application must not modify or free the error message string, but it may be
modified by subsequent calls to other library functions.
Two versions of **libpmemblk** are typically available on a development system.
The normal version, accessed when a program is linked using the **-lpmemblk**
option, is optimized for performance. That version skips checks that impact
performance and never logs any trace information or performs any run-time
assertions. If an error is detected in a call to **libpmemblk**,
the error message describing the failure may be retrieved with
_UW(pmemblk_errormsg) as described above.
A second version of **libpmemblk**, accessed when a program uses the libraries
under _DEBUGLIBPATH(), contains run-time assertions and trace points. The
typical way to access the debug version is to set the **LD_LIBRARY_PATH**
environment variable to _LDLIBPATH(). Debugging output is
controlled using the following environment variables. These variables have
no effect on the non-debug version of the library.
+ **PMEMBLK_LOG_LEVEL**
The value of **PMEMBLK_LOG_LEVEL** enables trace points in the debug version
of the library, as follows:
+ **0** - This is the default level when **PMEMBLK_LOG_LEVEL** is not set.
No log messages are emitted at this level.
+ **1** - Additional details on any errors detected are logged,
in addition to returning the *errno*-based errors as usual.
The same information may be retrieved using _UW(pmemblk_errormsg).
+ **2** - A trace of basic operations is logged.
+ **3** - Enables a very verbose amount of function call tracing
in the library.
+ **4** - Enables voluminous and fairly obscure tracing information
that is likely only useful to the **libpmemblk** developers.
Unless **PMEMBLK_LOG_FILE** is set, debugging output is written to *stderr*.
+ **PMEMBLK_LOG_FILE**
Specifies the name of a file
where all logging information should be written. If the last character in the
name is "-", the *PID* of the current process will be appended to the file name
when the log file is created. If **PMEMBLK_LOG_FILE** is not set, the logging
output is written to *stderr*.
See also **libpmem**(7) for information on other environment variables
that may affect **libpmemblk** behavior.
# EXAMPLE #
The following example illustrates how the **libpmemblk** API is used.
```c
#include
#include
#include
#include
#include
#include
/* size of the pmemblk pool -- 1 GB */
#define POOL_SIZE ((size_t)(1 << 30))
/* size of each element in the pmem pool */
#define ELEMENT_SIZE 1024
int
main(int argc, char *argv[])
{
const char path[] = "/pmem-fs/myfile";
PMEMblkpool *pbp;
size_t nelements;
char buf[ELEMENT_SIZE];
/* create the pmemblk pool or open it if it already exists */
pbp = _U(pmemblk_create)(path, ELEMENT_SIZE, POOL_SIZE, 0666);
if (pbp == NULL)
pbp = _U(pmemblk_open)(path, ELEMENT_SIZE);
if (pbp == NULL) {
perror(path);
exit(1);
}
/* how many elements fit into the file? */
nelements = pmemblk_nblock(pbp);
printf("file holds %zu elements", nelements);
/* store a block at index 5 */
strcpy(buf, "hello, world");
if (pmemblk_write(pbp, buf, 5) < 0) {
perror("pmemblk_write");
exit(1);
}
/* read the block at index 10 (reads as zeros initially) */
if (pmemblk_read(pbp, buf, 10) < 0) {
perror("pmemblk_read");
exit(1);
}
/* zero out the block at index 5 */
if (pmemblk_set_zero(pbp, 5) < 0) {
perror("pmemblk_set_zero");
exit(1);
}
/* ... */
pmemblk_close(pbp);
}
```
See for more examples using the **libpmemblk** API.
# BUGS #
Unlike **libpmemobj**(7), data replication is not supported in **libpmemblk**.
Thus, specifying replica sections in pool set files is not allowed.
# ACKNOWLEDGEMENTS #
**libpmemblk** builds on the persistent memory programming model recommended
by the SNIA NVM Programming Technical Work Group:
# SEE ALSO #
**msync**(2), **dlclose**(3), **pmemblk_bsize**(3), **pmemblk_create**(3),
**pmemblk_ctl_exec**(3), **pmemblk_ctl_get**(3), **pmemblk_ctl_set**(3),
**pmemblk_read**(3), **pmemblk_set_zero**(3), **pmem_is_pmem**(3),
**pmem_persist**(3), **strerror**(3), **libpmem**(7),
**libpmemlog**(7), **libpmemobj**(7) and ****
pmdk-1.8/doc/libpmemblk/pmemblk_bsize.3.md 0000664 0000000 0000000 00000006476 13615011243 017217 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMBLK_BSIZE, 3)
collection: libpmemblk
header: PMDK
date: pmemblk API version 1.1
...
[comment]: <> (Copyright 2017-2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmemblk_bsize.3 -- man page for functions that check number of available blocks or usable space in block memory pool)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[RETURN VALUE](#return-value)
[SEE ALSO](#see-also)
# NAME #
**pmemblk_bsize**(), **pmemblk_nblock**() - check number of available blocks or
usable space in block memory pool
# SYNOPSIS #
```c
#include
size_t pmemblk_bsize(PMEMblkpool *pbp);
size_t pmemblk_nblock(PMEMblkpool *pbp);
```
# DESCRIPTION #
The **pmemblk_bsize**() function returns the block size of the specified
block memory pool, that is, the value which was passed as *bsize* to
_UW(pmemblk_create). *pbp* must be a block memory pool handle as returned by
**pmemblk_open**(3) or **pmemblk_create**(3).
The **pmemblk_nblock**() function returns the usable space in the block memory
pool. *pbp* must be a block memory pool handle as returned by
**pmemblk_open**(3) or **pmemblk_create**(3).
# RETURN VALUE #
The **pmemblk_bsize**() function returns the block size of the specified block
memory pool.
The **pmemblk_nblock**() function returns the usable space in the block memory
pool, expressed as the number of blocks available.
# SEE ALSO #
**pmemblk_create**(3), **pmemblk_open**(3),
**libpmemblk**(7) and ****
pmdk-1.8/doc/libpmemblk/pmemblk_read.3.md 0000664 0000000 0000000 00000006442 13615011243 017007 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMBLK_READ, 3)
collection: libpmemblk
header: PMDK
date: pmemblk API version 1.1
...
[comment]: <> (Copyright 2017-2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmemblk_read.3 -- man page for libpmemblk read and write functions)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[RETURN VALUE](#return-value)
[SEE ALSO](#see-also)
# NAME #
**pmemblk_read**(), **pmemblk_write**() - read or write a block from a block
memory pool
# SYNOPSIS #
```c
#include
int pmemblk_read(PMEMblkpool *pbp, void *buf, long long blockno);
int pmemblk_write(PMEMblkpool *pbp, const void *buf, long long blockno);
```
# DESCRIPTION #
The **pmemblk_read**() function reads the block with block number *blockno*
from memory pool *pbp* into the buffer *buf*. Reading a block that has never
been written by **pmemblk_write**() will return a block of zeroes.
The **pmemblk_write**() function writes a block from *buf* to block number
*blockno* in the memory pool *pbp*. The write is atomic with respect to other
reads and writes. In addition, the write cannot be torn by program failure or
system crash; on recovery the block is guaranteed to contain either the old
data or the new data, never a mixture of both.
# RETURN VALUE #
On success, the **pmemblk_read**() and **pmemblk_write**() functions return 0.
On error, they return -1 and set *errno* appropriately.
# SEE ALSO #
**libpmemblk**(7) and ****
pmdk-1.8/doc/libpmemblk/pmemblk_create.3.md 0000664 0000000 0000000 00000021211 13615011243 017326 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEMBLK_CREATE, 3)
collection: libpmemblk
header: PMDK
date: pmemblk API version 1.1
...
[comment]: <> (Copyright 2017-2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmemblk_create.3 -- man page for libpmemblk create, open, close and validate functions)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[RETURN VALUE](#return-value)
[SEE ALSO](#see-also)
# NAME #
_UW(pmemblk_create), _UW(pmemblk_open),
**pmemblk_close**(), _UW(pmemblk_check)
- create, open, close and validate block pool
# SYNOPSIS #
```c
#include
_UWFUNCR1(PMEMblkpool, *pmemblk_create, *path, =q=size_t bsize,
size_t poolsize, mode_t mode=e=)
_UWFUNCR1(PMEMblkpool, *pmemblk_open, *path, size_t bsize)
void pmemblk_close(PMEMblkpool *pbp);
_UWFUNCR1(int, pmemblk_check, *path, size_t bsize)
```
_UNICODE()
# DESCRIPTION #
The _UW(pmemblk_create) function creates a block memory pool with the given
total *poolsize*, divided into as many elements of size *bsize* as will fit in
the pool. Since the transactional nature of a block memory pool requires some
space overhead in the memory pool, the resulting number of available blocks is
less than *poolsize*/*bsize*, and is made available to the caller via the
**pmemblk_nblock**(3) function. Given the specifics of the implementation, the
number of available blocks for the user cannot be less than 256. This
translates to at least 512 internal blocks. *path* specifies the name of the
memory pool file to be created. *mode* specifies the permissions to use when
creating the file, as described by **creat**(2). The memory pool file is fully
allocated to the size *poolsize* using **posix_fallocate**(3). The caller may
choose to take responsibility for creating the memory pool file by creating it
before calling _UW(pmemblk_create), and then specifying *poolsize* as zero. In
this case _UW(pmemblk_create) will take the pool size from the size of the
existing file, and will verify that the file appears to be empty by searching
for any non-zero data in the pool header at the beginning of the file. The net
pool size of a pool file is equal to the file size. The minimum net pool size
allowed by the library for a block pool is defined in **\** as
**PMEMBLK_MIN_POOL**. *bsize* can be any non-zero value; however,
**libpmemblk** will silently round up
the given size to **PMEMBLK_MIN_BLK**, as defined in **\**.
Depending on the configuration of the system, the available non-volatile
memory space may be divided into multiple memory devices. In such case, the
maximum size of the pmemblk memory pool could be limited by the capacity of a
single memory device. **libpmemblk**(7) allows building a persistent memory
resident array spanning multiple memory devices by creation of persistent
memory pools consisting of multiple files, where each part of such a *pool set*
may be stored on a different memory device or pmem-aware filesystem.
Creation of all the parts of the pool set can be done with _UW(pmemblk_create);
however, the recommended method for creating pool sets is by using the
**pmempool**(1) utility.
When creating a pool set consisting of multiple files, the *path* argument
passed to _UW(pmemblk_create) must point to the special *set* file that defines
the pool layout and the location of all the parts of the pool set. The
*poolsize* argument must be 0. The meaning of the *mode* argument
does not change, except that the same *mode* is used for creation of all the
parts of the pool set.
For more information on pool set format, see **poolset**(5).
The _UW(pmemblk_open) function opens an existing block memory pool.
As with _UW(pmemblk_create), *path* must identify either an existing
block memory pool file, or the *set* file used to create a pool set.
The application must have permission to open the file and memory map the
file or pool set with read/write permissions. If *bsize* is non-zero,
_UW(pmemblk_open) will verify that the given block size matches the block
size used when the pool was created. Otherwise, _UW(pmemblk_open) will open
the pool without verifying the block size. The *bsize* can be determined
using the **pmemblk_bsize**(3) function.
Be aware that if the pool contains bad blocks inside, opening can be aborted
by the SIGBUS signal, because currently the pool is not checked against
bad blocks during opening. It can be turned on by setting the CHECK_BAD_BLOCKS
compat feature. For details see description of this feature
in **pmempool-feature**(1).
The **pmemblk_close**() function closes the memory pool
indicated by *pbp* and deletes the memory pool handle.
The block memory pool itself lives on in the file that contains it and may be
re-opened at a later time using _UW(pmemblk_open) as described above.
The _UW(pmemblk_check) function performs a consistency check of the file
indicated by *path*, and returns 1 if the memory pool is found to be
consistent. If the pool is found not to be consistent, further use of the
file with **libpmemblk** will result in undefined behavior. The debug version
of **libpmemblk** will provide additional details on inconsistencies when
**PMEMBLK_LOG_LEVEL** is at least 1, as described in the **DEBUGGING AND ERROR
HANDLING** section in **libpmemblk**(7). _UW(pmemblk_check) opens the given
*path* read-only so it never makes any changes to the file. This function is
not supported on Device DAX.
# RETURN VALUE #
On success, _UW(pmemblk_create) returns a *PMEMblkpool\** handle to the block
memory pool. On error, it returns NULL and sets *errno* appropriately.
On success, _UW(pmemblk_open) returns a *PMEMblkpool\** handle that can be
used with most of the functions in **libpmemblk**(7). On error, it returns
NULL and sets *errno* appropriately. Possible errors include:
+ failure to open *path*
+ *path* specifies a *set* file and any of the pool set files cannot be opened
+ *path* specifies a *set* file and the actual size of any file does not
match the corresponding part size defined in the *set* file
+ *bsize* is non-zero and does not match the block size given when the pool
was created. *errno* is set to **EINVAL** in this case.
The **pmemblk_close**() function returns no value.
_UW(pmemblk_check) returns 1 if the memory pool is found to be consistent.
If the check is successfully performed but the pool is found to be inconsistent,
_UW(pmemblk_check) returns 0. This includes the case where *bsize* is non-zero
and does not match the block size given when the pool was created. If the
consistency check cannot be performed, _UW(pmemblk_check) returns -1 and sets
*errno* appropriately.
# CAVEATS #
Not all file systems support **posix_fallocate**(3). _UW(pmemblk_create) will
fail if the underlying file system does not support **posix_fallocate**(3).
# SEE ALSO #
**pmempool**(1), **creat**(2), **pmemblk_nblock**(3),
**posix_fallocate**(3), **poolset**(5),
**libpmemblk**(7) and ****
pmdk-1.8/doc/daxio/ 0000775 0000000 0000000 00000000000 13615011420 012657 5 ustar root root pmdk-1.8/doc/daxio/daxio.1 0000644 0000000 0000000 00000010757 13615011420 014055 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "DAXIO" "1" "2020-01-31" "PMDK - daxio version 1.4" "PMDK Programmer's Manual"
.hy
.\" Copyright 2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]daxio\f[] \- Perform I/O on Device DAX devices or zero a Device DAX
device
.SH SYNOPSIS
.IP
.nf
\f[C]
$\ daxio\ []
\f[]
.fi
.SH DESCRIPTION
.PP
The daxio utility performs I/O on Device DAX devices or zero a Device
DAX device.
Since the standard I/O APIs (read/write) cannot be used with Device DAX,
data transfer is performed on a memory\-mapped device.
The \f[B]daxio\f[] may be used to dump Device DAX data to a file,
restore data from a backup copy, move/copy data to another device or to
erase data from a device.
.PP
There must be at least one Device DAX device involved either as the
input or output.
If input or output is not specified, it will default to stdin or stdout
respectively.
.PP
No length specified will default to input file/device length or to the
output file/device length, if input is a special char file or stdin.
.PP
For a Device DAX device, \f[B]daxio\f[] will attempt to clear bad blocks
within the range of writes before performing the I/O (it can be turned
off using the `\[en]clear\-bad\-blocks=no' option).
.SH OPTIONS
.PP
\f[C]\-i,\ \-\-input\f[] Input device or file to read from.
.PP
\f[C]\-o,\ \-\-output\f[] Output device or file to write to.
.PP
\f[C]\-z,\ \-\-zero\f[] Zero the output device for \f[I]len\f[] size, or
the entire device if no length was provided.
The output device must be a Device DAX device.
.PP
\f[C]\-b,\ \-\-clear\-bad\-blocks=\f[] Clear bad blocks within
the range of writes before performing the I/O (default: yes).
.PP
\f[C]\-l,\ \-\-len\f[] The length in bytes to perform the I/O.
To make passing in size easier for kibi, mebi, gibi, and tebi bytes,
\f[I]len\f[] may include unit suffix.
The \f[I]len\f[] format must be compliant with the format specified in
IEC 80000\-13, IEEE 1541 or the Metric Interchange Format.
These standards accept SI units with obligatory B \- kB, MB, GB, \&...
(multiplier by 1000) suffixes, and IEC units with optional \[lq]iB\[rq]
\- KiB, MiB, GiB, \&..., K, M, G, \&... (multiplier by 1024) suffixes.
.PP
\f[C]\-s,\ \-\-seek\f[] The number of bytes to skip over on the output
before performing a write.
The same suffixes are accepted as for \f[I]len\f[].
.PP
\f[C]\-k,\ \-\-skip\f[] The number of bytes to skip over on the input
before performing a read.
The same suffixes are accepted as for \f[I]len\f[].
.PP
\f[C]\-V,\ \-\-version\f[]
.PP
Prints the version of \f[B]daxio\f[].
.PP
\f[C]\-h,\ \-\-help\f[]
.PP
Prints synopsis and list of options.
.SH EXAMPLE
.IP
.nf
\f[C]
#\ daxio\ \-\-zero\ /dev/dax1.0
#\ daxio\ \-\-input=/dev/dax1.0\ \-\-output=/home/myfile\ \-\-len=2M\ \-\-seek=4096
#\ cat\ /dev/zero\ |\ daxio\ \-\-output=/dev/dax1.0
#\ daxio\ \-\-input=/dev/zero\ \-\-output=/dev/dax1.0\ \-\-skip=4096
\f[]
.fi
.SH SEE ALSO
.PP
\f[B]daxctl\f[](1), \f[B]ndctl\f[](1) and \f[B]\f[]
pmdk-1.8/doc/daxio/.gitignore 0000664 0000000 0000000 00000000010 13615011243 014641 0 ustar root root daxio.1
pmdk-1.8/doc/daxio/daxio.1.md 0000664 0000000 0000000 00000011232 13615011243 014446 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(DAXIO, 1)
collection: daxio
header: PMDK
date: daxio version 1.4
...
[comment]: <> (Copyright 2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (daxio.1 -- man page for daxio)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[OPTIONS](#options)
[EXAMPLE](#example)
[SEE ALSO](#see-also)
# NAME #
**daxio** - Perform I/O on Device DAX devices or zero a Device DAX device
# SYNOPSIS #
```
$ daxio []
```
# DESCRIPTION #
The daxio utility performs I/O on Device DAX devices or zero
a Device DAX device. Since the standard I/O APIs (read/write) cannot be used
with Device DAX, data transfer is performed on a memory-mapped device.
The **daxio** may be used to dump Device DAX data to a file, restore data from
a backup copy, move/copy data to another device or to erase data from
a device.
There must be at least one Device DAX device involved either as the input
or output. If input or output is not specified, it will default to stdin
or stdout respectively.
No length specified will default to input file/device length or to the
output file/device length, if input is a special char file or stdin.
For a Device DAX device, **daxio** will attempt to clear bad blocks within
the range of writes before performing the I/O (it can be turned off using
the '--clear-bad-blocks=no' option).
# OPTIONS #
`-i, --input`
Input device or file to read from.
`-o, --output`
Output device or file to write to.
`-z, --zero`
Zero the output device for *len* size, or the entire device if no
length was provided. The output device must be a Device DAX device.
`-b, --clear-bad-blocks=`
Clear bad blocks within the range of writes before performing the I/O
(default: yes).
`-l, --len`
The length in bytes to perform the I/O. To make passing in size easier
for kibi, mebi, gibi, and tebi bytes, *len* may include unit suffix.
The *len* format must be compliant with the format specified in IEC 80000-13,
IEEE 1541 or the Metric Interchange Format. These standards accept SI units
with obligatory B - kB, MB, GB, ... (multiplier by 1000) suffixes,
and IEC units with optional "iB" - KiB, MiB, GiB, ..., K, M, G, ...
(multiplier by 1024) suffixes.
`-s, --seek`
The number of bytes to skip over on the output before performing a write.
The same suffixes are accepted as for *len*.
`-k, --skip`
The number of bytes to skip over on the input before performing a read.
The same suffixes are accepted as for *len*.
`-V, --version`
Prints the version of **daxio**.
`-h, --help`
Prints synopsis and list of options.
# EXAMPLE #
```
# daxio --zero /dev/dax1.0
# daxio --input=/dev/dax1.0 --output=/home/myfile --len=2M --seek=4096
# cat /dev/zero | daxio --output=/dev/dax1.0
# daxio --input=/dev/zero --output=/dev/dax1.0 --skip=4096
```
# SEE ALSO #
**daxctl**(1), **ndctl**(1)
and ****
pmdk-1.8/doc/librpmem/ 0000775 0000000 0000000 00000000000 13615011420 013362 5 ustar root root pmdk-1.8/doc/librpmem/librpmem.7 0000644 0000000 0000000 00000044770 13615011416 015300 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "LIBRPMEM" "7" "2020-01-31" "PMDK - rpmem API version 1.3" "PMDK Programmer's Manual"
.hy
.\" Copyright 2016-2019, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]librpmem\f[] \- remote persistent memory support library
(EXPERIMENTAL)
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\
cc\ ...\ \-lrpmem
\f[]
.fi
.SS Library API versioning:
.IP
.nf
\f[C]
const\ char\ *rpmem_check_version(
\ \ \ \ unsigned\ major_required,
\ \ \ \ unsigned\ minor_required);
\f[]
.fi
.SS Error handling:
.IP
.nf
\f[C]
const\ char\ *rpmem_errormsg(void);
\f[]
.fi
.SS Other library functions:
.PP
A description of other \f[B]librpmem\f[] functions can be found on the
following manual pages:
.IP \[bu] 2
\f[B]rpmem_create\f[](3), \f[B]rpmem_persist\f[](3)
.SH DESCRIPTION
.PP
\f[B]librpmem\f[] provides low\-level support for remote access to
\f[I]persistent memory\f[] (pmem) utilizing RDMA\-capable RNICs.
The library can be used to remotely replicate a memory region over the
RDMA protocol.
It utilizes an appropriate persistency mechanism based on the remote
node's platform capabilities.
\f[B]librpmem\f[] utilizes the \f[B]ssh\f[](1) client to authenticate a
user on the remote node, and for encryption of the connection's
out\-of\-band configuration data.
See \f[B]SSH\f[], below, for details.
.PP
The maximum replicated memory region size can not be bigger than the
maximum locked\-in\-memory address space limit.
See \f[B]memlock\f[] in \f[B]limits.conf\f[](5) for more details.
.PP
This library is for applications that use remote persistent memory
directly, without the help of any library\-supplied transactions or
memory allocation.
Higher\-level libraries that build on \f[B]libpmem\f[](7) are available
and are recommended for most applications, see:
.IP \[bu] 2
\f[B]libpmemobj\f[](7), a general use persistent memory API, providing
memory allocation and transactional operations on variable\-sized
objects.
.SH TARGET NODE ADDRESS FORMAT
.IP
.nf
\f[C]
[\@][:]
\f[]
.fi
.PP
The target node address is described by the \f[I]hostname\f[] which the
client connects to, with an optional \f[I]user\f[] name.
The user must be authorized to authenticate to the remote machine
without querying for password/passphrase.
The optional \f[I]port\f[] number is used to establish the SSH
connection.
The default port number is 22.
.SH REMOTE POOL ATTRIBUTES
.PP
The \f[I]rpmem_pool_attr\f[] structure describes a remote pool and is
stored in remote pool's metadata.
This structure must be passed to the \f[B]rpmem_create\f[](3) function
by caller when creating a pool on remote node.
When opening the pool using \f[B]rpmem_open\f[](3) function the
appropriate fields are read from pool's metadata and returned back to
the caller.
.IP
.nf
\f[C]
#define\ RPMEM_POOL_HDR_SIG_LEN\ \ \ \ 8
#define\ RPMEM_POOL_HDR_UUID_LEN\ \ \ 16
#define\ RPMEM_POOL_USER_FLAGS_LEN\ 16
struct\ rpmem_pool_attr\ {
\ \ \ \ char\ signature[RPMEM_POOL_HDR_SIG_LEN];
\ \ \ \ uint32_t\ major;
\ \ \ \ uint32_t\ compat_features;
\ \ \ \ uint32_t\ incompat_features;
\ \ \ \ uint32_t\ ro_compat_features;
\ \ \ \ unsigned\ char\ poolset_uuid[RPMEM_POOL_HDR_UUID_LEN];
\ \ \ \ unsigned\ char\ uuid[RPMEM_POOL_HDR_UUID_LEN];
\ \ \ \ unsigned\ char\ next_uuid[RPMEM_POOL_HDR_UUID_LEN];
\ \ \ \ unsigned\ char\ prev_uuid[RPMEM_POOL_HDR_UUID_LEN];
\ \ \ \ unsigned\ char\ user_flags[RPMEM_POOL_USER_FLAGS_LEN];
};
\f[]
.fi
.PP
The \f[I]signature\f[] field is an 8\-byte field which describes the
pool's on\-media format.
.PP
The \f[I]major\f[] field is a major version number of the pool's
on\-media format.
.PP
The \f[I]compat_features\f[] field is a mask describing compatibility of
pool's on\-media format optional features.
.PP
The \f[I]incompat_features\f[] field is a mask describing compatibility
of pool's on\-media format required features.
.PP
The \f[I]ro_compat_features\f[] field is a mask describing compatibility
of pool's on\-media format features.
If these features are not available, the pool shall be opened in
read\-only mode.
.PP
The \f[I]poolset_uuid\f[] field is an UUID of the pool which the remote
pool is associated with.
.PP
The \f[I]uuid\f[] field is an UUID of a first part of the remote pool.
This field can be used to connect the remote pool with other pools in a
list.
.PP
The \f[I]next_uuid\f[] and \f[I]prev_uuid\f[] fields are UUIDs of next
and previous replicas respectively.
These fields can be used to connect the remote pool with other pools in
a list.
.PP
The \f[I]user_flags\f[] field is a 16\-byte user\-defined flags.
.SH SSH
.PP
\f[B]librpmem\f[] utilizes the \f[B]ssh\f[](1) client to login and
execute the \f[B]rpmemd\f[](1) process on the remote node.
By default, \f[B]ssh\f[](1) is executed with the \f[B]\-4\f[] option,
which forces using \f[B]IPv4\f[] addressing.
.PP
For debugging purposes, both the ssh client and the commands executed on
the remote node may be overridden by setting the \f[B]RPMEM_SSH\f[] and
\f[B]RPMEM_CMD\f[] environment variables, respectively.
See \f[B]ENVIRONMENT\f[] for details.
.SH FORK
.PP
The \f[B]ssh\f[](1) client is executed by \f[B]rpmem_open\f[](3) and
\f[B]rpmem_create\f[](3) after forking a child process using
\f[B]fork\f[](2).
The application must take this into account when using \f[B]wait\f[](2)
and \f[B]waitpid\f[](2), which may return the \f[I]PID\f[] of the
\f[B]ssh\f[](1) process executed by \f[B]librpmem\f[].
.PP
If \f[B]fork\f[](2) support is not enabled in \f[B]libibverbs\f[],
\f[B]rpmem_open\f[](3) and \f[B]rpmem_create\f[](3) will fail.
By default, \f[B]fabric\f[](7) initializes \f[B]libibverbs\f[] with
\f[B]fork\f[](2) support by calling the \f[B]ibv_fork_init\f[](3)
function.
See \f[B]fi_verbs\f[](7) for more details.
.SH CAVEATS
.PP
\f[B]librpmem\f[] relies on the library destructor being called from the
main thread.
For this reason, all functions that might trigger destruction (e.g.
\f[B]dlclose\f[](3)) should be called in the main thread.
Otherwise some of the resources associated with that thread might not be
cleaned up properly.
.PP
\f[B]librpmem\f[] registers a pool as a single memory region.
A Chelsio T4 and T5 hardware can not handle a memory region greater than
or equal to 8GB due to a hardware bug.
So \f[I]pool_size\f[] value for \f[B]rpmem_create\f[](3) and
\f[B]rpmem_open\f[](3) using this hardware can not be greater than or
equal to 8GB.
.SH LIBRARY API VERSIONING
.PP
This section describes how the library API is versioned, allowing
applications to work with an evolving API.
.PP
The \f[B]rpmem_check_version\f[]() function is used to see if the
installed \f[B]librpmem\f[] supports the version of the library API
required by an application.
The easiest way to do this is for the application to supply the
compile\-time version information, supplied by defines in
\f[B]\f[], like this:
.IP
.nf
\f[C]
reason\ =\ rpmem_check_version(RPMEM_MAJOR_VERSION,
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ RPMEM_MINOR_VERSION);
if\ (reason\ !=\ NULL)\ {
\ \ \ \ /*\ version\ check\ failed,\ reason\ string\ tells\ you\ why\ */
}
\f[]
.fi
.PP
Any mismatch in the major version number is considered a failure, but a
library with a newer minor version number will pass this check since
increasing minor versions imply backwards compatibility.
.PP
An application can also check specifically for the existence of an
interface by checking for the version where that interface was
introduced.
These versions are documented in this man page as follows: unless
otherwise specified, all interfaces described here are available in
version 1.0 of the library.
Interfaces added after version 1.0 will contain the text \f[I]introduced
in version x.y\f[] in the section of this manual describing the feature.
.PP
When the version check performed by \f[B]rpmem_check_version\f[]() is
successful, the return value is NULL.
Otherwise the return value is a static string describing the reason for
failing the version check.
The string returned by \f[B]rpmem_check_version\f[]() must not be
modified or freed.
.SH ENVIRONMENT
.PP
\f[B]librpmem\f[] can change its default behavior based on the following
environment variables.
These are largely intended for testing and are not normally required.
.IP \[bu] 2
\f[B]RPMEM_SSH\f[]=\f[I]ssh_client\f[]
.PP
Setting this environment variable overrides the default \f[B]ssh\f[](1)
client command name.
.IP \[bu] 2
\f[B]RPMEM_CMD\f[]=\f[I]cmd\f[]
.PP
Setting this environment variable overrides the default command executed
on the remote node using either \f[B]ssh\f[](1) or the alternative
remote shell command specified by \f[B]RPMEM_SSH\f[].
.PP
\f[B]RPMEM_CMD\f[] can contain multiple commands separated by a vertical
bar (\f[C]|\f[]).
Each consecutive command is executed on the remote node in order read
from a pool set file.
This environment variable is read when the library is initialized, so
\f[B]RPMEM_CMD\f[] must be set prior to application launch (or prior to
\f[B]dlopen\f[](3) if \f[B]librpmem\f[] is being dynamically loaded).
.IP \[bu] 2
\f[B]RPMEM_ENABLE_SOCKETS\f[]=0|1
.PP
Setting this variable to 1 enables using \f[B]fi_sockets\f[](7) provider
for in\-band RDMA connection.
The \f[I]sockets\f[] provider does not support IPv6.
It is required to disable IPv6 system wide if
\f[B]RPMEM_ENABLE_SOCKETS\f[] == 1 and \f[I]target\f[] == localhost (or
any other loopback interface address) and \f[B]SSH_CONNECTION\f[]
variable (see \f[B]ssh\f[](1) for more details) contains IPv6 address
after ssh to loopback interface.
By default the \f[I]sockets\f[] provider is disabled.
.IP \[bu] 2
\f[B]RPMEM_ENABLE_VERBS\f[]=0|1
.PP
Setting this variable to 0 disables using \f[B]fi_verbs\f[](7) provider
for in\-band RDMA connection.
The \f[I]verbs\f[] provider is enabled by default.
.IP \[bu] 2
\f[B]RPMEM_MAX_NLANES\f[]=\f[I]num\f[]
.PP
Limit the maximum number of lanes to \f[I]num\f[].
See \f[B]LANES\f[], in \f[B]rpmem_create\f[](3), for details.
.IP \[bu] 2
\f[B]RPMEM_WORK_QUEUE_SIZE\f[]=\f[I]size\f[]
.PP
Suggest the work queue size.
The effective work queue size can be greater than suggested if
\f[B]librpmem\f[] requires it or it can be smaller if underlying
hardware does not support the suggested size.
The work queue size affects the performance of communication to the
remote node.
\f[B]rpmem_flush\f[](3) operations can be added to the work queue up to
the size of this queue.
When work queue is full any subsequent call has to wait till the work
queue will be drained.
\f[B]rpmem_drain\f[](3) and \f[B]rpmem_persist\f[](3) among other things
also drain the work queue.
.SH DEBUGGING AND ERROR HANDLING
.PP
If an error is detected during the call to a \f[B]librpmem\f[] function,
the application may retrieve an error message describing the reason for
the failure from \f[B]rpmem_errormsg\f[]().
This function returns a pointer to a static buffer containing the last
error message logged for the current thread.
If \f[I]errno\f[] was set, the error message may include a description
of the corresponding error code as returned by \f[B]strerror\f[](3).
The error message buffer is thread\-local; errors encountered in one
thread do not affect its value in other threads.
The buffer is never cleared by any library function; its content is
significant only when the return value of the immediately preceding call
to a \f[B]librpmem\f[] function indicated an error, or if \f[I]errno\f[]
was set.
The application must not modify or free the error message string, but it
may be modified by subsequent calls to other library functions.
.PP
Two versions of \f[B]librpmem\f[] are typically available on a
development system.
The normal version, accessed when a program is linked using the
\f[B]\-lrpmem\f[] option, is optimized for performance.
That version skips checks that impact performance and never logs any
trace information or performs any run\-time assertions.
.PP
A second version of \f[B]librpmem\f[], accessed when a program uses the
libraries under \f[B]/usr/lib/pmdk_debug\f[], contains run\-time
assertions and trace points.
The typical way to access the debug version is to set the environment
variable \f[B]LD_LIBRARY_PATH\f[] to \f[B]/usr/lib/pmdk_debug\f[] or
\f[B]/usr/lib64/pmdk_debug\f[], as appropriate.
Debugging output is controlled using the following environment
variables.
These variables have no effect on the non\-debug version of the library.
.IP \[bu] 2
\f[B]RPMEM_LOG_LEVEL\f[]
.PP
The value of \f[B]RPMEM_LOG_LEVEL\f[] enables trace points in the debug
version of the library, as follows:
.IP \[bu] 2
\f[B]0\f[] \- This is the default level when \f[B]RPMEM_LOG_LEVEL\f[] is
not set.
No log messages are emitted at this level.
.IP \[bu] 2
\f[B]1\f[] \- Additional details on any errors detected are logged (in
addition to returning the \f[I]errno\f[]\-based errors as usual).
The same information may be retrieved using \f[B]rpmem_errormsg\f[]().
.IP \[bu] 2
\f[B]2\f[] \- A trace of basic operations is logged.
.IP \[bu] 2
\f[B]3\f[] \- Enables a very verbose amount of function call tracing in
the library.
.IP \[bu] 2
\f[B]4\f[] \- Enables voluminous and fairly obscure tracing information
that is likely only useful to the \f[B]librpmem\f[] developers.
.PP
Unless \f[B]RPMEM_LOG_FILE\f[] is set, debugging output is written to
\f[I]stderr\f[].
.IP \[bu] 2
\f[B]RPMEM_LOG_FILE\f[]
.PP
Specifies the name of a file where all logging information should be
written.
If the last character in the name is \[lq]\-\[rq], the \f[I]PID\f[] of
the current process will be appended to the file name when the log file
is created.
If \f[B]RPMEM_LOG_FILE\f[] is not set, logging output is written to
\f[I]stderr\f[].
.SH EXAMPLE
.PP
The following example uses \f[B]librpmem\f[] to create a remote pool on
given target node identified by given pool set name.
The associated local memory pool is zeroed and the data is made
persistent on remote node.
Upon success the remote pool is closed.
.IP
.nf
\f[C]
#include\
#include\
#include\
#include\
#include\
#include\
#define\ POOL_SIGNATURE\ \ "MANPAGE"
#define\ POOL_SIZE\ \ \ (32\ *\ 1024\ *\ 1024)
#define\ NLANES\ \ \ \ \ \ 4
#define\ DATA_OFF\ \ \ \ 4096
#define\ DATA_SIZE\ \ \ (POOL_SIZE\ \-\ DATA_OFF)
static\ void
parse_args(int\ argc,\ char\ *argv[],\ const\ char\ **target,\ const\ char\ **poolset)
{
\ \ \ \ if\ (argc\ <\ 3)\ {
\ \ \ \ \ \ \ \ fprintf(stderr,\ "usage:\\t%s\ \ \\n",\ argv[0]);
\ \ \ \ \ \ \ \ exit(1);
\ \ \ \ }
\ \ \ \ *target\ =\ argv[1];
\ \ \ \ *poolset\ =\ argv[2];
}
static\ void\ *
alloc_memory()
{
\ \ \ \ long\ pagesize\ =\ sysconf(_SC_PAGESIZE);
\ \ \ \ if\ (pagesize\ <\ 0)\ {
\ \ \ \ \ \ \ \ perror("sysconf");
\ \ \ \ \ \ \ \ exit(1);
\ \ \ \ }
\ \ \ \ /*\ allocate\ a\ page\ size\ aligned\ local\ memory\ pool\ */
\ \ \ \ void\ *mem;
\ \ \ \ int\ ret\ =\ posix_memalign(&mem,\ pagesize,\ POOL_SIZE);
\ \ \ \ if\ (ret)\ {
\ \ \ \ \ \ \ \ fprintf(stderr,\ "posix_memalign:\ %s\\n",\ strerror(ret));
\ \ \ \ \ \ \ \ exit(1);
\ \ \ \ }
\ \ \ \ assert(mem\ !=\ NULL);
\ \ \ \ return\ mem;
}
int
main(int\ argc,\ char\ *argv[])
{
\ \ \ \ const\ char\ *target,\ *poolset;
\ \ \ \ parse_args(argc,\ argv,\ &target,\ &poolset);
\ \ \ \ unsigned\ nlanes\ =\ NLANES;
\ \ \ \ void\ *pool\ =\ alloc_memory();
\ \ \ \ int\ ret;
\ \ \ \ /*\ fill\ pool_attributes\ */
\ \ \ \ struct\ rpmem_pool_attr\ pool_attr;
\ \ \ \ memset(&pool_attr,\ 0,\ sizeof(pool_attr));
\ \ \ \ strncpy(pool_attr.signature,\ POOL_SIGNATURE,\ RPMEM_POOL_HDR_SIG_LEN);
\ \ \ \ /*\ create\ a\ remote\ pool\ */
\ \ \ \ RPMEMpool\ *rpp\ =\ rpmem_create(target,\ poolset,\ pool,\ POOL_SIZE,
\ \ \ \ \ \ \ \ \ \ \ \ &nlanes,\ &pool_attr);
\ \ \ \ if\ (!rpp)\ {
\ \ \ \ \ \ \ \ fprintf(stderr,\ "rpmem_create:\ %s\\n",\ rpmem_errormsg());
\ \ \ \ \ \ \ \ return\ 1;
\ \ \ \ }
\ \ \ \ /*\ store\ data\ on\ local\ pool\ */
\ \ \ \ memset(pool,\ 0,\ POOL_SIZE);
\ \ \ \ /*\ make\ local\ data\ persistent\ on\ remote\ node\ */
\ \ \ \ ret\ =\ rpmem_persist(rpp,\ DATA_OFF,\ DATA_SIZE,\ 0,\ 0);
\ \ \ \ if\ (ret)\ {
\ \ \ \ \ \ \ \ fprintf(stderr,\ "rpmem_persist:\ %s\\n",\ rpmem_errormsg());
\ \ \ \ \ \ \ \ return\ 1;
\ \ \ \ }
\ \ \ \ /*\ close\ the\ remote\ pool\ */
\ \ \ \ ret\ =\ rpmem_close(rpp);
\ \ \ \ if\ (ret)\ {
\ \ \ \ \ \ \ \ fprintf(stderr,\ "rpmem_close:\ %s\\n",\ rpmem_errormsg());
\ \ \ \ \ \ \ \ return\ 1;
\ \ \ \ }
\ \ \ \ free(pool);
\ \ \ \ return\ 0;
}
\f[]
.fi
.SH NOTE
.PP
The \f[B]librpmem\f[] API is experimental and may be subject to change
in the future.
However, using the remote replication in \f[B]libpmemobj\f[](7) is safe
and backward compatibility will be preserved.
.SH ACKNOWLEDGEMENTS
.PP
\f[B]librpmem\f[] builds on the persistent memory programming model
recommended by the SNIA NVM Programming Technical Work Group:
.SH SEE ALSO
.PP
\f[B]rpmemd\f[](1), \f[B]ssh\f[](1), \f[B]fork\f[](2),
\f[B]dlclose\f[](3), \f[B]dlopen\f[](3), \f[B]ibv_fork_init\f[](3),
\f[B]rpmem_create\f[](3), \f[B]rpmem_drain\f[](3),
\f[B]rpmem_flush\f[](3), \f[B]rpmem_open\f[](3),
\f[B]rpmem_persist\f[](3), \f[B]strerror\f[](3),
\f[B]limits.conf\f[](5), \f[B]fabric\f[](7), \f[B]fi_sockets\f[](7),
\f[B]fi_verbs\f[](7), \f[B]libpmem\f[](7), \f[B]libpmemblk\f[](7),
\f[B]libpmemlog\f[](7), \f[B]libpmemobj\f[](7) and
\f[B]\f[]
pmdk-1.8/doc/librpmem/rpmem_check_version.3 0000664 0000000 0000000 00000000024 13615011243 017467 0 ustar root root .so man7/librpmem.7
pmdk-1.8/doc/librpmem/rpmem_create.3.md 0000664 0000000 0000000 00000023400 13615011243 016512 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(RPMEM_CREATE, 3)
collection: librpmem
header: PMDK
date: rpmem API version 1.3
...
[comment]: <> (Copyright 2017-2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (rpmem_create.3 -- man page for most commonly used librpmem functions)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[RETURN VALUE](#return-value)
[NOTES](#notes)
[SEE ALSO](#see-also)
# NAME #
**rpmem_create**(), **rpmem_open**(),
**rpmem_set_attr**(), **rpmem_close**(), **rpmem_remove**()
- most commonly used functions for remote access to *persistent memory*
# SYNOPSIS #
```c
#include
RPMEMpool *rpmem_create(const char *target, const char *pool_set_name,
void *pool_addr, size_t pool_size, unsigned *nlanes,
const struct rpmem_pool_attr *create_attr);
RPMEMpool *rpmem_open(const char *target, const char *pool_set_name,
void *pool_addr, size_t pool_size, unsigned *nlanes,
struct rpmem_pool_attr *open_attr);
int rpmem_set_attr(RPMEMpool *rpp, const struct rpmem_pool_attr *attr);
int rpmem_close(RPMEMpool *rpp);
int rpmem_remove(const char *target, const char *pool_set_name, int flags);
```
# DESCRIPTION #
The **rpmem_create**() function creates a remote pool on a given *target* node,
using pool *set* file *pool_set_name* to map the remote pool. *pool_set_name*
is a relative path in the root config directory on the *target* node.
For pool set file format and options see **poolset**(5).
*pool_addr* is a pointer to the associated local memory pool with size
*pool_size*. Both *pool_addr* and *pool_size* must be aligned to the system's
page size (see **sysconf**(3)). The size of the remote pool must be at least
*pool_size*. See **REMOTE POOL SIZE**, below, for details.
*nlanes* points to the maximum number of lanes which the caller is requesting.
Upon successful creation of the remote pool, \**nlanes* is set to the
maximum number of lanes supported by both the local and remote nodes.
See **LANES**, below, for details.
The *create_attr* structure contains the attributes used for creating the
remote pool. If the *create_attr* structure is not NULL, a pool with internal
metadata is created. The metadata is stored in the first 4096
bytes of the pool and can be read when opening the remote pool with
**rpmem_open**(). To prevent user from overwriting the pool metadata, this
region is not accessible to the user via **rpmem_persist**().
If *create_attr* is NULL or zeroed, remote pool set file must contain
the *NOHDRS* option. In that case the remote pool is created without internal
metadata in it and the entire pool space is available to the user.
See **rpmem_persist**(3) for details.
The **rpmem_open**() function opens the existing remote pool with *set* file
*pool_set_name* on remote node *target*. *pool_set_name* is a relative path
in the root config directory on the *target* node. *pool_addr* is a pointer to
the associated local memory pool of size *pool_size*.
Both *pool_addr* and *pool_size* must be aligned to the system's page
size (see **sysconf**(3)). The size of the remote pool must be at least
*pool_size*. See **REMOTE POOL SIZE**, below, for details.
*nlanes* points to the maximum number of lanes which the caller is requesting.
Upon successful opening of the remote pool, \**nlanes* is set to the
maximum number of lanes supported by both the local and remote nodes.
See **LANES**, below, for details.
The **rpmem_set_attr**() function overwrites the pool's attributes.
The *attr* structure contains the attributes used for overwriting the remote
pool attributes that were passed to **rpmem_create**() at pool creation.
If *attr* is NULL, a zeroed structure with attributes will be used.
New attributes are stored in the pool's metadata.
The **rpmem_close**() function closes the remote pool *rpp*. All resources
are released on both the local and remote nodes. The remote pool itself
persists on the remote node and may be re-opened at a later time using
**rpmem_open**().
The **rpmem_remove**() function removes the remote pool with *set* file name
*pool_set_name* from node *target*. The *pool_set_name* is a relative path in
the root config directory on the *target* node. By default only the pool part
files are removed; the pool *set* file is left untouched. If the pool is not
consistent, the **rpmem_remove**() function fails.
The *flags* argument determines the behavior of **rpmem_remove**(). *flags* may
be either 0 or the bitwise OR of one or more of the following flags:
+ **RPMEM_REMOVE_FORCE** - Ignore errors when opening an inconsistent pool.
The pool *set* file must still be in appropriate format for the pool to be
removed.
+ **RPMEM_REMOVE_POOL_SET** - Remove the pool *set* file after removing the
pool described by this pool set.
# RETURN VALUE #
On success, **rpmem_create**() returns an opaque handle to the remote pool
for use in subsequent **librpmem** calls. If any error prevents
the remote pool from being created, **rpmem_create**() returns
NULL and sets *errno* appropriately.
On success, **rpmem_open**() returns an opaque handle to the remote
pool for subsequent **librpmem** calls. If the *open_attr* argument
is not NULL, the remote pool attributes are returned in the provided structure.
If the remote pool was created without internal metadata, zeroes are returned
in the *open_attr* structure on successful call to **rpmem_open**().
If any error prevents the remote pool from being opened, **rpmem_open**()
returns NULL and sets *errno* appropriately.
On success, **rpmem_set_attr**() returns 0. On error, it returns -1 and sets
*errno* appropriately.
On success, **rpmem_close**() returns 0. On error, it returns a non-zero value
and sets *errno* appropriately.
On success, **rpmem_remove**() returns 0. On error, it returns a non-zero value
and sets *errno* appropriately.
# NOTES #
## REMOTE POOL SIZE ##
The size of a remote pool depends on the configuration in the pool set file
on the remote node (see **poolset**(5)). If no pool set options is used in
the remote pool set file, the remote pool size is the sum of the sizes of all
part files, decreased by 4096 bytes per part file. 4096 bytes of each part file
are utilized for storing internal metadata.
If the *SINGLEHDR* option is used in the remote pool set file, the remote pool
size is the sum of sizes of all part files, decreased once by 4096 bytes.
In this case only the first part contains internal metadata.
If a remote pool set file contains the *NOHDRS* option, the remote pool size
is the sum of sizes of all its part files. In this case none of the parts
contains internal metadata. For other consequences of using the *SINGLEHDR* and
*NOHDRS* options see **rpmem_persist**(3).
**RPMEM_MIN_PART** and **RPMEM_MIN_POOL** in **\** define
the minimum size allowed by **librpmem** for a part file and a remote pool,
respectively.
## LANES ##
The term *lane* means an isolated path of execution. The underlying hardware
utilized by both local and remote nodes may have limited resources that
restrict the maximum number of parallel **rpmem_persist**(3) operations.
The maximum number of supported lanes is returned by the **rpmem_open**() and
**rpmem_create**() function calls. The caller passes the maximum number of
lanes requested in \**nlanes*. If the pool is successfully created or opened,
\**nlanes* is updated to reflect the minimum of the number of lanes requested
by the caller and the maximum number of lanes supported by underlying hardware.
The application is obligated to use at most the returned number of
lanes in parallel.
**rpmem_persist**(3) does not provide any locking mechanism; thus any
serialization of calls must be performed by the application if required.
Each lane requires a separate connection, represented by a file descriptor.
If the system runs out of free file descriptors during **rpmem_create**() or
**rpmem_open**(), these functions will fail. See **nofile** in
**limits.conf**(5) for more details.
# SEE ALSO #
**rpmem_persist**(3), **sysconf**(3), **limits.conf**(5),
**libpmemobj**(7), **librpmem**(7) and ****
pmdk-1.8/doc/librpmem/rpmem_create.3 0000644 0000000 0000000 00000024047 13615011420 016116 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "RPMEM_CREATE" "3" "2020-01-31" "PMDK - rpmem API version 1.3" "PMDK Programmer's Manual"
.hy
.\" Copyright 2017-2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]rpmem_create\f[](), \f[B]rpmem_open\f[](),
\f[B]rpmem_set_attr\f[](), \f[B]rpmem_close\f[](),
\f[B]rpmem_remove\f[]() \- most commonly used functions for remote
access to \f[I]persistent memory\f[]
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\
RPMEMpool\ *rpmem_create(const\ char\ *target,\ const\ char\ *pool_set_name,
\ \ \ \ void\ *pool_addr,\ size_t\ pool_size,\ unsigned\ *nlanes,
\ \ \ \ const\ struct\ rpmem_pool_attr\ *create_attr);
RPMEMpool\ *rpmem_open(const\ char\ *target,\ const\ char\ *pool_set_name,
\ \ \ \ void\ *pool_addr,\ size_t\ pool_size,\ unsigned\ *nlanes,
\ \ \ \ struct\ rpmem_pool_attr\ *open_attr);
int\ rpmem_set_attr(RPMEMpool\ *rpp,\ const\ struct\ rpmem_pool_attr\ *attr);
int\ rpmem_close(RPMEMpool\ *rpp);
int\ rpmem_remove(const\ char\ *target,\ const\ char\ *pool_set_name,\ int\ flags);
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]rpmem_create\f[]() function creates a remote pool on a given
\f[I]target\f[] node, using pool \f[I]set\f[] file
\f[I]pool_set_name\f[] to map the remote pool.
\f[I]pool_set_name\f[] is a relative path in the root config directory
on the \f[I]target\f[] node.
For pool set file format and options see \f[B]poolset\f[](5).
\f[I]pool_addr\f[] is a pointer to the associated local memory pool with
size \f[I]pool_size\f[].
Both \f[I]pool_addr\f[] and \f[I]pool_size\f[] must be aligned to the
system's page size (see \f[B]sysconf\f[](3)).
The size of the remote pool must be at least \f[I]pool_size\f[].
See \f[B]REMOTE POOL SIZE\f[], below, for details.
\f[I]nlanes\f[] points to the maximum number of lanes which the caller
is requesting.
Upon successful creation of the remote pool, *\f[I]nlanes\f[] is set to
the maximum number of lanes supported by both the local and remote
nodes.
See \f[B]LANES\f[], below, for details.
The \f[I]create_attr\f[] structure contains the attributes used for
creating the remote pool.
If the \f[I]create_attr\f[] structure is not NULL, a pool with internal
metadata is created.
The metadata is stored in the first 4096 bytes of the pool and can be
read when opening the remote pool with \f[B]rpmem_open\f[]().
To prevent user from overwriting the pool metadata, this region is not
accessible to the user via \f[B]rpmem_persist\f[]().
If \f[I]create_attr\f[] is NULL or zeroed, remote pool set file must
contain the \f[I]NOHDRS\f[] option.
In that case the remote pool is created without internal metadata in it
and the entire pool space is available to the user.
See \f[B]rpmem_persist\f[](3) for details.
.PP
The \f[B]rpmem_open\f[]() function opens the existing remote pool with
\f[I]set\f[] file \f[I]pool_set_name\f[] on remote node \f[I]target\f[].
\f[I]pool_set_name\f[] is a relative path in the root config directory
on the \f[I]target\f[] node.
\f[I]pool_addr\f[] is a pointer to the associated local memory pool of
size \f[I]pool_size\f[].
Both \f[I]pool_addr\f[] and \f[I]pool_size\f[] must be aligned to the
system's page size (see \f[B]sysconf\f[](3)).
The size of the remote pool must be at least \f[I]pool_size\f[].
See \f[B]REMOTE POOL SIZE\f[], below, for details.
\f[I]nlanes\f[] points to the maximum number of lanes which the caller
is requesting.
Upon successful opening of the remote pool, *\f[I]nlanes\f[] is set to
the maximum number of lanes supported by both the local and remote
nodes.
See \f[B]LANES\f[], below, for details.
.PP
The \f[B]rpmem_set_attr\f[]() function overwrites the pool's attributes.
The \f[I]attr\f[] structure contains the attributes used for overwriting
the remote pool attributes that were passed to \f[B]rpmem_create\f[]()
at pool creation.
If \f[I]attr\f[] is NULL, a zeroed structure with attributes will be
used.
New attributes are stored in the pool's metadata.
.PP
The \f[B]rpmem_close\f[]() function closes the remote pool \f[I]rpp\f[].
All resources are released on both the local and remote nodes.
The remote pool itself persists on the remote node and may be re\-opened
at a later time using \f[B]rpmem_open\f[]().
.PP
The \f[B]rpmem_remove\f[]() function removes the remote pool with
\f[I]set\f[] file name \f[I]pool_set_name\f[] from node \f[I]target\f[].
The \f[I]pool_set_name\f[] is a relative path in the root config
directory on the \f[I]target\f[] node.
By default only the pool part files are removed; the pool \f[I]set\f[]
file is left untouched.
If the pool is not consistent, the \f[B]rpmem_remove\f[]() function
fails.
The \f[I]flags\f[] argument determines the behavior of
\f[B]rpmem_remove\f[]().
\f[I]flags\f[] may be either 0 or the bitwise OR of one or more of the
following flags:
.IP \[bu] 2
\f[B]RPMEM_REMOVE_FORCE\f[] \- Ignore errors when opening an
inconsistent pool.
The pool \f[I]set\f[] file must still be in appropriate format for the
pool to be removed.
.IP \[bu] 2
\f[B]RPMEM_REMOVE_POOL_SET\f[] \- Remove the pool \f[I]set\f[] file
after removing the pool described by this pool set.
.SH RETURN VALUE
.PP
On success, \f[B]rpmem_create\f[]() returns an opaque handle to the
remote pool for use in subsequent \f[B]librpmem\f[] calls.
If any error prevents the remote pool from being created,
\f[B]rpmem_create\f[]() returns NULL and sets \f[I]errno\f[]
appropriately.
.PP
On success, \f[B]rpmem_open\f[]() returns an opaque handle to the remote
pool for subsequent \f[B]librpmem\f[] calls.
If the \f[I]open_attr\f[] argument is not NULL, the remote pool
attributes are returned in the provided structure.
If the remote pool was created without internal metadata, zeroes are
returned in the \f[I]open_attr\f[] structure on successful call to
\f[B]rpmem_open\f[]().
If any error prevents the remote pool from being opened,
\f[B]rpmem_open\f[]() returns NULL and sets \f[I]errno\f[]
appropriately.
.PP
On success, \f[B]rpmem_set_attr\f[]() returns 0.
On error, it returns \-1 and sets \f[I]errno\f[] appropriately.
.PP
On success, \f[B]rpmem_close\f[]() returns 0.
On error, it returns a non\-zero value and sets \f[I]errno\f[]
appropriately.
.PP
On success, \f[B]rpmem_remove\f[]() returns 0.
On error, it returns a non\-zero value and sets \f[I]errno\f[]
appropriately.
.SH NOTES
.SS REMOTE POOL SIZE
.PP
The size of a remote pool depends on the configuration in the pool set
file on the remote node (see \f[B]poolset\f[](5)).
If no pool set options is used in the remote pool set file, the remote
pool size is the sum of the sizes of all part files, decreased by 4096
bytes per part file.
4096 bytes of each part file are utilized for storing internal metadata.
If the \f[I]SINGLEHDR\f[] option is used in the remote pool set file,
the remote pool size is the sum of sizes of all part files, decreased
once by 4096 bytes.
In this case only the first part contains internal metadata.
If a remote pool set file contains the \f[I]NOHDRS\f[] option, the
remote pool size is the sum of sizes of all its part files.
In this case none of the parts contains internal metadata.
For other consequences of using the \f[I]SINGLEHDR\f[] and
\f[I]NOHDRS\f[] options see \f[B]rpmem_persist\f[](3).
\f[B]RPMEM_MIN_PART\f[] and \f[B]RPMEM_MIN_POOL\f[] in
\f[B]\f[] define the minimum size allowed by
\f[B]librpmem\f[] for a part file and a remote pool, respectively.
.SS LANES
.PP
The term \f[I]lane\f[] means an isolated path of execution.
The underlying hardware utilized by both local and remote nodes may have
limited resources that restrict the maximum number of parallel
\f[B]rpmem_persist\f[](3) operations.
The maximum number of supported lanes is returned by the
\f[B]rpmem_open\f[]() and \f[B]rpmem_create\f[]() function calls.
The caller passes the maximum number of lanes requested in
*\f[I]nlanes\f[].
If the pool is successfully created or opened, *\f[I]nlanes\f[] is
updated to reflect the minimum of the number of lanes requested by the
caller and the maximum number of lanes supported by underlying hardware.
The application is obligated to use at most the returned number of lanes
in parallel.
.PP
\f[B]rpmem_persist\f[](3) does not provide any locking mechanism; thus
any serialization of calls must be performed by the application if
required.
.PP
Each lane requires a separate connection, represented by a file
descriptor.
If the system runs out of free file descriptors during
\f[B]rpmem_create\f[]() or \f[B]rpmem_open\f[](), these functions will
fail.
See \f[B]nofile\f[] in \f[B]limits.conf\f[](5) for more details.
.SH SEE ALSO
.PP
\f[B]rpmem_persist\f[](3), \f[B]sysconf\f[](3), \f[B]limits.conf\f[](5),
\f[B]libpmemobj\f[](7), \f[B]librpmem\f[](7) and
\f[B]\f[]
pmdk-1.8/doc/librpmem/rpmem_set_attr.3 0000664 0000000 0000000 00000000023 13615011243 016471 0 ustar root root .so rpmem_create.3
pmdk-1.8/doc/librpmem/rpmem_errormsg.3 0000664 0000000 0000000 00000000024 13615011243 016505 0 ustar root root .so man7/librpmem.7
pmdk-1.8/doc/librpmem/rpmem_flush.3 0000664 0000000 0000000 00000000024 13615011243 015766 0 ustar root root .so rpmem_persist.3
pmdk-1.8/doc/librpmem/rpmem_persist.3.md 0000664 0000000 0000000 00000016417 13615011243 016752 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(RPMEM_PERSIST, 3)
collection: librpmem
header: PMDK
date: rpmem API version 1.3
...
[comment]: <> (Copyright 2017-2018, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (rpmem_persist.3 -- man page for rpmem persist, flush, drain and read functions)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[RETURN VALUE](#return-value)
[CAVEATS](#caveats)
[SEE ALSO](#see-also)
# NAME #
**rpmem_persist**(), **rpmem_deep_persist**(), **rpmem_flush**(),
**rpmem_drain**(), **rpmem_read**()
- functions to copy and read remote pools
# SYNOPSIS #
```c
#include
int rpmem_persist(RPMEMpool *rpp, size_t offset,
size_t length, unsigned lane, unsigned flags);
int rpmem_deep_persist(RPMEMpool *rpp, size_t offset,
size_t length, unsigned lane);
int rpmem_flush(RPMEMpool *rpp, size_t offset,
size_t length, unsigned lane, unsigned flags);
int rpmem_drain(RPMEMpool *rpp, unsigned lane, unsigned flags);
int rpmem_read(RPMEMpool *rpp, void *buff, size_t offset,
size_t length, unsigned lane);
```
# DESCRIPTION #
The **rpmem_persist**() function copies data of given *length* at given
*offset* from the associated local memory pool and makes sure the data is
persistent on the remote node before the function returns. The remote node
is identified by the *rpp* handle which must be returned from either
**rpmem_open**(3) or **rpmem_create**(3). The *offset* is relative
to the *pool_addr* specified in the **rpmem_open**(3) or **rpmem_create**(3)
call. If the remote pool was created using **rpmem_create**() with non-NULL
*create_attr* argument, *offset* has to be greater or equal to 4096.
In that case the first 4096 bytes of the pool is used for storing the pool
metadata and cannot be overwritten.
If the pool was created with NULL *create_attr* argument, the pool metadata
is not stored with the pool and *offset* can be any nonnegative number.
The *offset* and *length* combined must not exceed the
*pool_size* passed to **rpmem_open**(3) or **rpmem_create**(3).
The **rpmem_persist**() operation is performed using the given *lane* number.
The lane must be less than the value returned by **rpmem_open**(3) or
**rpmem_create**(3) through the *nlanes* argument (so it can take a value
from 0 to *nlanes* - 1). The *flags* argument can be 0 or RPMEM_PERSIST_RELAXED
which means the persist operation will be done without any guarantees regarding
atomicity of memory transfer.
The **rpmem_deep_persist**() function works in the same way as
**rpmem_persist**(3) function, but additionally it flushes the data to the
lowest possible persistency domain available from software.
Please see **pmem_deep_persist**(3) for details.
The **rpmem_flush**() and **rpmem_drain**() functions are two halves of the
single **rpmem_persist**(). The **rpmem_persist**() copies data and makes it
persistent in the one shot, where **rpmem_flush**() and **rpmem_drain**() split
this operation into two stages. The **rpmem_flush**() copies data of given
*length* at a given *offset* from the associated local memory pool to the
remote node. The **rpmem_drain**() makes sure the data copied in all preceding
**rpmem_flush**() calls is persistent on the remote node before the function
returns. Data copied using **rpmem_flush**() can not be considered persistent
on the remote node before return from following **rpmem_drain**().
Single **rpmem_drain**() confirms persistence on the remote node of data copied
by all **rpmem_flush**() functions called before it and using the same *lane*.
The last **rpmem_flush**() + **rpmem_drain**() can be replaced with
**rpmem_persist**() at no cost.
The *flags* argument for **rpmem_flush**() can be 0 or RPMEM_FLUSH_RELAXED
which means the flush operation will be done without any guarantees regarding
atomicity of memory transfer. The *flags* argument for **rpmem_drain**() must be 0.
The **rpmem_flush**() function performance is affected by **RPMEM_WORK_QUEUE_SIZE**
environment variable (see **librpmem**(7) for more details).
The **rpmem_read**() function reads *length* bytes of data from a remote pool
at *offset* and copies it to the buffer *buff*. The operation is performed on
the specified *lane*. The lane must be less than the value returned by
**rpmem_open**(3) or **rpmem_create**(3) through the *nlanes* argument
(so it can take a value from 0 to *nlanes* - 1). The *rpp* must point to a
remote pool opened or created previously by **rpmem_open**(3) or
**rpmem_create**(3).
# RETURN VALUE #
The **rpmem_persist**() function returns 0 if the entire memory area was
made persistent on the remote node. Otherwise it returns a non-zero value
and sets *errno* appropriately.
The **rpmem_flush**() function returns 0 if duplication of the memory area to
the remote node was initialized successfully. Otherwise, it returns a non-zero
value and sets *errno* appropriately.
The **rpmem_drain**() function returns 0 if the memory areas duplicated by all
**rpmem_flush**() calls preceding the **rpmem_drain**() are made persistent
on the remote node. Otherwise, it returns a non-zero value and sets *errno*
appropriately.
The **rpmem_read**() function returns 0 if the data was read entirely.
Otherwise it returns a non-zero value and sets *errno* appropriately.
# CAVEATS #
Ordering of **rpmem_flush**() and **rpmem_persist**() operations which are using
different *lane* values is not guaranteed.
# SEE ALSO #
**rpmem_create**(3), **rpmem_open**(3), **rpmem_persist**(3),
**sysconf**(3), **limits.conf**(5), **libpmemobj**(7)
and ****
pmdk-1.8/doc/librpmem/rpmem_deep_persist.3 0000664 0000000 0000000 00000000024 13615011243 017333 0 ustar root root .so rpmem_persist.3
pmdk-1.8/doc/librpmem/librpmem.7.md 0000664 0000000 0000000 00000042376 13615011243 015677 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(LIBRPMEM, 7)
collection: librpmem
header: PMDK
date: rpmem API version 1.3
...
[comment]: <> (Copyright 2016-2019, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (librpmem.7 -- man page for librpmem)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[TARGET NODE ADDRESS FORMAT](#target-node-address-format)
[REMOTE POOL ATTRIBUTES](#remote-pool-attributes)
[SSH](#ssh)
[FORK](#fork)
[CAVEATS](#caveats)
[LIBRARY API VERSIONING](#library-api-versioning-1)
[ENVIRONMENT](#environment)
[DEBUGGING AND ERROR HANDLING](#debugging-and-error-handling)
[EXAMPLE](#example)
[ACKNOWLEDGEMENTS](#acknowledgements)
[SEE ALSO](#see-also)
# NAME #
**librpmem** - remote persistent memory support library (EXPERIMENTAL)
# SYNOPSIS #
```c
#include
cc ... -lrpmem
```
##### Library API versioning: #####
```c
const char *rpmem_check_version(
unsigned major_required,
unsigned minor_required);
```
##### Error handling: #####
```c
const char *rpmem_errormsg(void);
```
##### Other library functions: #####
A description of other **librpmem** functions can be found on the following
manual pages:
+ **rpmem_create**(3), **rpmem_persist**(3)
# DESCRIPTION #
**librpmem** provides low-level support for remote access to
*persistent memory* (pmem) utilizing RDMA-capable RNICs. The library can be
used to remotely replicate a memory region over the RDMA protocol. It utilizes
an appropriate persistency mechanism based on the remote node's platform
capabilities. **librpmem** utilizes the **ssh**(1) client to authenticate
a user on the remote node, and for encryption of the connection's out-of-band
configuration data. See **SSH**, below, for details.
The maximum replicated memory region size can not be bigger than the maximum
locked-in-memory address space limit. See **memlock** in **limits.conf**(5)
for more details.
This library is for applications that use remote persistent memory directly,
without the help of any library-supplied transactions or memory
allocation. Higher-level libraries that build on **libpmem**(7) are
available and are recommended for most applications, see:
+ **libpmemobj**(7), a general use persistent memory API, providing memory
allocation and transactional operations on variable-sized objects.
# TARGET NODE ADDRESS FORMAT #
```
[@][:]
```
The target node address is described by the *hostname* which the client
connects to, with an optional *user* name. The user must be authorized
to authenticate to the remote machine without querying for password/passphrase.
The optional *port* number is used to establish the SSH connection. The default
port number is 22.
# REMOTE POOL ATTRIBUTES #
The *rpmem_pool_attr* structure describes a remote pool and is stored in remote
pool's metadata. This structure must be passed to the **rpmem_create**(3)
function by caller when creating a pool on remote node. When opening the pool
using **rpmem_open**(3) function the appropriate fields are read from pool's
metadata and returned back to the caller.
```c
#define RPMEM_POOL_HDR_SIG_LEN 8
#define RPMEM_POOL_HDR_UUID_LEN 16
#define RPMEM_POOL_USER_FLAGS_LEN 16
struct rpmem_pool_attr {
char signature[RPMEM_POOL_HDR_SIG_LEN];
uint32_t major;
uint32_t compat_features;
uint32_t incompat_features;
uint32_t ro_compat_features;
unsigned char poolset_uuid[RPMEM_POOL_HDR_UUID_LEN];
unsigned char uuid[RPMEM_POOL_HDR_UUID_LEN];
unsigned char next_uuid[RPMEM_POOL_HDR_UUID_LEN];
unsigned char prev_uuid[RPMEM_POOL_HDR_UUID_LEN];
unsigned char user_flags[RPMEM_POOL_USER_FLAGS_LEN];
};
```
The *signature* field is an 8-byte field which describes the pool's on-media
format.
The *major* field is a major version number of the pool's on-media format.
The *compat_features* field is a mask describing compatibility of pool's
on-media format optional features.
The *incompat_features* field is a mask describing compatibility of pool's
on-media format required features.
The *ro_compat_features* field is a mask describing compatibility of pool's
on-media format features. If these features are not available,
the pool shall be opened in read-only mode.
The *poolset_uuid* field is an UUID of the pool which the remote pool is
associated with.
The *uuid* field is an UUID of a first part of the remote pool. This field can
be used to connect the remote pool with other pools in a list.
The *next_uuid* and *prev_uuid* fields are UUIDs of next and previous replicas
respectively. These fields can be used to connect the remote pool with other
pools in a list.
The *user_flags* field is a 16-byte user-defined flags.
# SSH #
**librpmem** utilizes the **ssh**(1) client to login and execute the
**rpmemd**(1) process on the remote node. By default, **ssh**(1)
is executed with the **-4** option, which forces using **IPv4** addressing.
For debugging purposes, both the ssh client and the commands executed
on the remote node may be overridden by setting the **RPMEM_SSH** and
**RPMEM_CMD** environment variables, respectively. See **ENVIRONMENT**
for details.
# FORK #
The **ssh**(1) client is executed
by **rpmem_open**(3) and **rpmem_create**(3) after forking a child process
using **fork**(2). The application must take this into account when
using **wait**(2) and **waitpid**(2), which may return the *PID* of
the **ssh**(1) process executed by **librpmem**.
If **fork**(2) support is not enabled in **libibverbs**,
**rpmem_open**(3) and **rpmem_create**(3) will fail.
By default, **fabric**(7) initializes **libibverbs** with **fork**(2) support
by calling the **ibv_fork_init**(3) function. See **fi_verbs**(7) for more
details.
# CAVEATS #
**librpmem** relies on the library destructor being called from the main thread.
For this reason, all functions that might trigger destruction (e.g.
**dlclose**(3)) should be called in the main thread. Otherwise some of the
resources associated with that thread might not be cleaned up properly.
**librpmem** registers a pool as a single memory region. A Chelsio T4 and T5
hardware can not handle a memory region greater than or equal to 8GB due to
a hardware bug. So *pool_size* value for **rpmem_create**(3) and **rpmem_open**(3)
using this hardware can not be greater than or equal to 8GB.
# LIBRARY API VERSIONING #
This section describes how the library API is versioned,
allowing applications to work with an evolving API.
The **rpmem_check_version**() function is used to see if the installed
**librpmem** supports the version of the library API required by an
application. The easiest way to do this is for the application to supply
the compile-time version information, supplied by defines in
**\**, like this:
```c
reason = rpmem_check_version(RPMEM_MAJOR_VERSION,
RPMEM_MINOR_VERSION);
if (reason != NULL) {
/* version check failed, reason string tells you why */
}
```
Any mismatch in the major version number is considered a failure, but a
library with a newer minor version number will pass this check since
increasing minor versions imply backwards compatibility.
An application can also check specifically for the existence of an
interface by checking for the version where that interface was
introduced. These versions are documented in this man page as follows:
unless otherwise specified, all interfaces described here are available
in version 1.0 of the library. Interfaces added after version 1.0 will
contain the text *introduced in version x.y* in the section of this
manual describing the feature.
When the version check performed by **rpmem_check_version**() is
successful, the return value is NULL. Otherwise the return value is a
static string describing the reason for failing the version check. The
string returned by **rpmem_check_version**() must not be modified or
freed.
# ENVIRONMENT #
**librpmem** can change its default behavior based on the following
environment variables. These are largely intended for testing and are
not normally required.
+ **RPMEM_SSH**=*ssh_client*
Setting this environment variable overrides the default **ssh**(1) client
command name.
+ **RPMEM_CMD**=*cmd*
Setting this environment variable overrides the default command executed on
the remote node using either **ssh**(1) or the alternative remote shell command
specified by **RPMEM_SSH**.
**RPMEM_CMD** can contain multiple commands separated by a vertical bar (`|`).
Each consecutive command is executed on the remote node in order read from a
pool set file. This environment variable is read when the library is
initialized, so **RPMEM_CMD** must be set prior to application launch (or
prior to **dlopen**(3) if **librpmem** is being dynamically loaded).
+ **RPMEM_ENABLE_SOCKETS**=0\|1
Setting this variable to 1 enables using **fi_sockets**(7) provider for
in-band RDMA connection. The *sockets* provider does not support IPv6.
It is required to disable IPv6 system wide if **RPMEM_ENABLE_SOCKETS** == 1 and
*target* == localhost (or any other loopback interface address) and
**SSH_CONNECTION** variable (see **ssh**(1) for more details) contains IPv6
address after ssh to loopback interface. By default the *sockets* provider is
disabled.
* **RPMEM_ENABLE_VERBS**=0\|1
Setting this variable to 0 disables using **fi_verbs**(7) provider for
in-band RDMA connection. The *verbs* provider is enabled by default.
* **RPMEM_MAX_NLANES**=*num*
Limit the maximum number of lanes to *num*. See **LANES**, in **rpmem_create**(3), for details.
* **RPMEM_WORK_QUEUE_SIZE**=*size*
Suggest the work queue size. The effective work queue size can be greater than
suggested if **librpmem** requires it or it can be smaller if underlying hardware
does not support the suggested size. The work queue size affects the performance
of communication to the remote node.
**rpmem_flush**(3) operations can be added to the work queue up to the size of
this queue. When work queue is full any subsequent call has to wait till the work
queue will be drained. **rpmem_drain**(3) and **rpmem_persist**(3) among other
things also drain the work queue.
# DEBUGGING AND ERROR HANDLING #
If an error is detected during the call to a **librpmem** function, the
application may retrieve an error message describing the reason for the failure
from **rpmem_errormsg**(). This function returns a pointer to a static buffer
containing the last error message logged for the current thread. If *errno*
was set, the error message may include a description of the corresponding
error code as returned by **strerror**(3). The error message buffer is
thread-local; errors encountered in one thread do not affect its value in
other threads. The buffer is never cleared by any library function; its
content is significant only when the return value of the immediately preceding
call to a **librpmem** function indicated an error, or if *errno* was set.
The application must not modify or free the error message string, but it may
be modified by subsequent calls to other library functions.
Two versions of **librpmem** are typically available on a development
system. The normal version, accessed when a program is linked using the
**-lrpmem** option, is optimized for performance. That version skips checks
that impact performance and never logs any trace information or performs any
run-time assertions.
A second version of **librpmem**, accessed when a program uses the libraries
under _DEBUGLIBPATH(), contains run-time assertions and trace points. The
typical way to access the debug version is to set the environment variable
**LD_LIBRARY_PATH** to _LDLIBPATH(). Debugging output is
controlled using the following environment variables. These variables have
no effect on the non-debug version of the library.
+ **RPMEM_LOG_LEVEL**
The value of **RPMEM_LOG_LEVEL** enables trace points in the debug version
of the library, as follows:
+ **0** - This is the default level when **RPMEM_LOG_LEVEL** is not set.
No log messages are emitted at this level.
+ **1** - Additional details on any errors detected are logged
(in addition to returning the *errno*-based errors as usual).
The same information may be retrieved using **rpmem_errormsg**().
+ **2** - A trace of basic operations is logged.
+ **3** - Enables a very verbose amount of function call
tracing in the library.
+ **4** - Enables voluminous and fairly obscure tracing information
that is likely only useful to the **librpmem** developers.
Unless **RPMEM_LOG_FILE** is set, debugging output is written to *stderr*.
+ **RPMEM_LOG_FILE**
Specifies the name of a file where all logging information should be written.
If the last character in the name is "-", the *PID* of the current process will
be appended to the file name when the log file is created. If
**RPMEM_LOG_FILE** is not set, logging output is written to *stderr*.
# EXAMPLE #
The following example uses **librpmem** to create a remote pool on given
target node identified by given pool set name. The associated local memory
pool is zeroed and the data is made persistent on remote node. Upon success
the remote pool is closed.
```c
#include
#include
#include
#include
#include
#include
#define POOL_SIGNATURE "MANPAGE"
#define POOL_SIZE (32 * 1024 * 1024)
#define NLANES 4
#define DATA_OFF 4096
#define DATA_SIZE (POOL_SIZE - DATA_OFF)
static void
parse_args(int argc, char *argv[], const char **target, const char **poolset)
{
if (argc < 3) {
fprintf(stderr, "usage:\t%s \n", argv[0]);
exit(1);
}
*target = argv[1];
*poolset = argv[2];
}
static void *
alloc_memory()
{
long pagesize = sysconf(_SC_PAGESIZE);
if (pagesize < 0) {
perror("sysconf");
exit(1);
}
/* allocate a page size aligned local memory pool */
void *mem;
int ret = posix_memalign(&mem, pagesize, POOL_SIZE);
if (ret) {
fprintf(stderr, "posix_memalign: %s\n", strerror(ret));
exit(1);
}
assert(mem != NULL);
return mem;
}
int
main(int argc, char *argv[])
{
const char *target, *poolset;
parse_args(argc, argv, &target, &poolset);
unsigned nlanes = NLANES;
void *pool = alloc_memory();
int ret;
/* fill pool_attributes */
struct rpmem_pool_attr pool_attr;
memset(&pool_attr, 0, sizeof(pool_attr));
strncpy(pool_attr.signature, POOL_SIGNATURE, RPMEM_POOL_HDR_SIG_LEN);
/* create a remote pool */
RPMEMpool *rpp = rpmem_create(target, poolset, pool, POOL_SIZE,
&nlanes, &pool_attr);
if (!rpp) {
fprintf(stderr, "rpmem_create: %s\n", rpmem_errormsg());
return 1;
}
/* store data on local pool */
memset(pool, 0, POOL_SIZE);
/* make local data persistent on remote node */
ret = rpmem_persist(rpp, DATA_OFF, DATA_SIZE, 0, 0);
if (ret) {
fprintf(stderr, "rpmem_persist: %s\n", rpmem_errormsg());
return 1;
}
/* close the remote pool */
ret = rpmem_close(rpp);
if (ret) {
fprintf(stderr, "rpmem_close: %s\n", rpmem_errormsg());
return 1;
}
free(pool);
return 0;
}
```
# NOTE #
The **librpmem** API is experimental and may be subject to change in the future.
However, using the remote replication in **libpmemobj**(7) is safe and backward
compatibility will be preserved.
# ACKNOWLEDGEMENTS #
**librpmem** builds on the persistent memory programming model
recommended by the SNIA NVM Programming Technical Work Group:
# SEE ALSO #
**rpmemd**(1), **ssh**(1), **fork**(2), **dlclose**(3), **dlopen**(3),
**ibv_fork_init**(3), **rpmem_create**(3), **rpmem_drain**(3), **rpmem_flush**(3),
**rpmem_open**(3), **rpmem_persist**(3), **strerror**(3), **limits.conf**(5),
**fabric**(7), **fi_sockets**(7), **fi_verbs**(7), **libpmem**(7), **libpmemblk**(7),
**libpmemlog**(7), **libpmemobj**(7)
and ****
pmdk-1.8/doc/librpmem/.gitignore 0000664 0000000 0000000 00000000052 13615011243 015352 0 ustar root root librpmem.7
rpmem_create.3
rpmem_persist.3
pmdk-1.8/doc/librpmem/rpmem_persist.3 0000644 0000000 0000000 00000016610 13615011420 016341 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "RPMEM_PERSIST" "3" "2020-01-31" "PMDK - rpmem API version 1.3" "PMDK Programmer's Manual"
.hy
.\" Copyright 2017-2018, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]rpmem_persist\f[](), \f[B]rpmem_deep_persist\f[](),
\f[B]rpmem_flush\f[](), \f[B]rpmem_drain\f[](), \f[B]rpmem_read\f[]() \-
functions to copy and read remote pools
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\
int\ rpmem_persist(RPMEMpool\ *rpp,\ size_t\ offset,
\ \ \ \ size_t\ length,\ unsigned\ lane,\ unsigned\ flags);
int\ rpmem_deep_persist(RPMEMpool\ *rpp,\ size_t\ offset,
\ \ \ \ size_t\ length,\ unsigned\ lane);
int\ rpmem_flush(RPMEMpool\ *rpp,\ size_t\ offset,
\ \ \ \ size_t\ length,\ unsigned\ lane,\ unsigned\ flags);
int\ rpmem_drain(RPMEMpool\ *rpp,\ unsigned\ lane,\ unsigned\ flags);
int\ rpmem_read(RPMEMpool\ *rpp,\ void\ *buff,\ size_t\ offset,
\ \ \ \ size_t\ length,\ unsigned\ lane);
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[B]rpmem_persist\f[]() function copies data of given
\f[I]length\f[] at given \f[I]offset\f[] from the associated local
memory pool and makes sure the data is persistent on the remote node
before the function returns.
The remote node is identified by the \f[I]rpp\f[] handle which must be
returned from either \f[B]rpmem_open\f[](3) or \f[B]rpmem_create\f[](3).
The \f[I]offset\f[] is relative to the \f[I]pool_addr\f[] specified in
the \f[B]rpmem_open\f[](3) or \f[B]rpmem_create\f[](3) call.
If the remote pool was created using \f[B]rpmem_create\f[]() with
non\-NULL \f[I]create_attr\f[] argument, \f[I]offset\f[] has to be
greater or equal to 4096.
In that case the first 4096 bytes of the pool is used for storing the
pool metadata and cannot be overwritten.
If the pool was created with NULL \f[I]create_attr\f[] argument, the
pool metadata is not stored with the pool and \f[I]offset\f[] can be any
nonnegative number.
The \f[I]offset\f[] and \f[I]length\f[] combined must not exceed the
\f[I]pool_size\f[] passed to \f[B]rpmem_open\f[](3) or
\f[B]rpmem_create\f[](3).
The \f[B]rpmem_persist\f[]() operation is performed using the given
\f[I]lane\f[] number.
The lane must be less than the value returned by \f[B]rpmem_open\f[](3)
or \f[B]rpmem_create\f[](3) through the \f[I]nlanes\f[] argument (so it
can take a value from 0 to \f[I]nlanes\f[] \- 1).
The \f[I]flags\f[] argument can be 0 or RPMEM_PERSIST_RELAXED which
means the persist operation will be done without any guarantees
regarding atomicity of memory transfer.
.PP
The \f[B]rpmem_deep_persist\f[]() function works in the same way as
\f[B]rpmem_persist\f[](3) function, but additionally it flushes the data
to the lowest possible persistency domain available from software.
Please see \f[B]pmem_deep_persist\f[](3) for details.
.PP
The \f[B]rpmem_flush\f[]() and \f[B]rpmem_drain\f[]() functions are two
halves of the single \f[B]rpmem_persist\f[]().
The \f[B]rpmem_persist\f[]() copies data and makes it persistent in the
one shot, where \f[B]rpmem_flush\f[]() and \f[B]rpmem_drain\f[]() split
this operation into two stages.
The \f[B]rpmem_flush\f[]() copies data of given \f[I]length\f[] at a
given \f[I]offset\f[] from the associated local memory pool to the
remote node.
The \f[B]rpmem_drain\f[]() makes sure the data copied in all preceding
\f[B]rpmem_flush\f[]() calls is persistent on the remote node before the
function returns.
Data copied using \f[B]rpmem_flush\f[]() can not be considered
persistent on the remote node before return from following
\f[B]rpmem_drain\f[]().
Single \f[B]rpmem_drain\f[]() confirms persistence on the remote node of
data copied by all \f[B]rpmem_flush\f[]() functions called before it and
using the same \f[I]lane\f[].
The last \f[B]rpmem_flush\f[]() + \f[B]rpmem_drain\f[]() can be replaced
with \f[B]rpmem_persist\f[]() at no cost.
.PP
The \f[I]flags\f[] argument for \f[B]rpmem_flush\f[]() can be 0 or
RPMEM_FLUSH_RELAXED which means the flush operation will be done without
any guarantees regarding atomicity of memory transfer.
The \f[I]flags\f[] argument for \f[B]rpmem_drain\f[]() must be 0.
.PP
The \f[B]rpmem_flush\f[]() function performance is affected by
\f[B]RPMEM_WORK_QUEUE_SIZE\f[] environment variable (see
\f[B]librpmem\f[](7) for more details).
.PP
The \f[B]rpmem_read\f[]() function reads \f[I]length\f[] bytes of data
from a remote pool at \f[I]offset\f[] and copies it to the buffer
\f[I]buff\f[].
The operation is performed on the specified \f[I]lane\f[].
The lane must be less than the value returned by \f[B]rpmem_open\f[](3)
or \f[B]rpmem_create\f[](3) through the \f[I]nlanes\f[] argument (so it
can take a value from 0 to \f[I]nlanes\f[] \- 1).
The \f[I]rpp\f[] must point to a remote pool opened or created
previously by \f[B]rpmem_open\f[](3) or \f[B]rpmem_create\f[](3).
.SH RETURN VALUE
.PP
The \f[B]rpmem_persist\f[]() function returns 0 if the entire memory
area was made persistent on the remote node.
Otherwise it returns a non\-zero value and sets \f[I]errno\f[]
appropriately.
.PP
The \f[B]rpmem_flush\f[]() function returns 0 if duplication of the
memory area to the remote node was initialized successfully.
Otherwise, it returns a non\-zero value and sets \f[I]errno\f[]
appropriately.
.PP
The \f[B]rpmem_drain\f[]() function returns 0 if the memory areas
duplicated by all \f[B]rpmem_flush\f[]() calls preceding the
\f[B]rpmem_drain\f[]() are made persistent on the remote node.
Otherwise, it returns a non\-zero value and sets \f[I]errno\f[]
appropriately.
.PP
The \f[B]rpmem_read\f[]() function returns 0 if the data was read
entirely.
Otherwise it returns a non\-zero value and sets \f[I]errno\f[]
appropriately.
.SH CAVEATS
.PP
Ordering of \f[B]rpmem_flush\f[]() and \f[B]rpmem_persist\f[]()
operations which are using different \f[I]lane\f[] values is not
guaranteed.
.SH SEE ALSO
.PP
\f[B]rpmem_create\f[](3), \f[B]rpmem_open\f[](3),
\f[B]rpmem_persist\f[](3), \f[B]sysconf\f[](3), \f[B]limits.conf\f[](5),
\f[B]libpmemobj\f[](7) and \f[B]\f[]
pmdk-1.8/doc/librpmem/rpmem_open.3 0000664 0000000 0000000 00000000023 13615011243 015605 0 ustar root root .so rpmem_create.3
pmdk-1.8/doc/librpmem/rpmem_close.3 0000664 0000000 0000000 00000000023 13615011243 015751 0 ustar root root .so rpmem_create.3
pmdk-1.8/doc/librpmem/rpmem_read.3 0000664 0000000 0000000 00000000024 13615011243 015560 0 ustar root root .so rpmem_persist.3
pmdk-1.8/doc/librpmem/rpmem_remove.3 0000664 0000000 0000000 00000000021 13615011243 016137 0 ustar root root .so rpmem_open.3
pmdk-1.8/doc/librpmem/rpmem_drain.3 0000664 0000000 0000000 00000000024 13615011243 015742 0 ustar root root .so rpmem_persist.3
pmdk-1.8/doc/libpmem2/ 0000775 0000000 0000000 00000000000 13615011420 013262 5 ustar root root pmdk-1.8/doc/libpmem2/pmem2_errormsg.3.md 0000664 0000000 0000000 00000006517 13615011243 016721 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEM2_ERRORMSG, 3)
collection: libpmem2
header: PMDK
date: pmem2 API version 1.0
...
[comment]: <> (Copyright 2019, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmem2_errormsg.3 -- man page for error handling in libpmem2
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[RETURN VALUE](#return-value)
[SEE ALSO](#see-also)
# NAME #
_UW(pmem2_errormsg) - returns last error message
# SYNOPSIS #
```c
#include
_UWFUNC(pmem2_errormsg, void)
```
_UNICODE()
# DESCRIPTION #
If an error is detected during the call to a **libpmem2**(7) function, the
application may retrieve an error message describing the reason of the failure
from _UW(pmem2_errormsg). The error message buffer is thread-local;
errors encountered in one thread do not affect its value in
other threads. The buffer is never cleared by any library function; its
content is significant only when the return value of the immediately preceding
call to a **libpmem2**(7) function indicated an error.
The application must not modify or free the error message string.
Subsequent calls to other library functions may modify the previous message.
# RETURN VALUE #
The _UW(pmem2_errormsg) function returns a pointer to a static buffer
containing the last error message logged for the current thread. If *errno*
was set, the error message may include a description of the corresponding
error code as returned by **strerror**(3).
# SEE ALSO #
**strerror**(3), **libpmem2**(7) and ****
pmdk-1.8/doc/libpmem2/pmem2_mapping.3.md 0000664 0000000 0000000 00000004732 13615011243 016511 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEM2_MAPPING, 3)
collection: libpmem2
header: PMDK
date: pmem2 API version 1.0
...
[comment]: <> (Copyright 2019, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmem2_mapping.3 -- man page for libpmem2 mapping operations
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[RETURN VALUE](#return-value)
[SEE ALSO](#see-also)
# NAME #
**pmem2_map**() - create mapping on the file
# SYNOPSIS #
```c
#include
int pmem2_map(const struct pmem2_config *cfg, struct pmem2_map **map_ptr);
```
# DESCRIPTION #
# RETURN VALUE #
# SEE ALSO #
**libpmem2**(7) and ****
pmdk-1.8/doc/libpmem2/pmem2_config_set_handle.3 0000664 0000000 0000000 00000000023 13615011243 020077 0 ustar root root .so pmem2_config.3
pmdk-1.8/doc/libpmem2/pmem2_config.3.md 0000664 0000000 0000000 00000005276 13615011243 016327 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(PMEM2_CONFIG, 3)
collection: libpmem2
header: PMDK
date: pmem2 API version 1.0
...
[comment]: <> (Copyright 2019, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (pmem2_config.3 -- man page for libpmem2 config API
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[RETURN VALUE](#return-value)
[SEE ALSO](#see-also)
# NAME #
**pmem2_config_new**(), **pmem2_config_delete**(),
**pmem2_config_set_fd**(), **pmem2_config_set_handle**()
# SYNOPSIS #
```c
#include
int pmem2_config_new(struct pmem2_config **cfg);
int pmem2_config_delete(struct pmem2_config **cfg);
int pmem2_config_set_fd(struct pmem2_config *cfg, int fd);
int pmem2_config_set_handle(struct pmem2_config *cfg, HANDLE handle); (XXX: WINDOWS ONLY)
```
# DESCRIPTION #
# RETURN VALUE #
# SEE ALSO #
**libpmem2**(7) and ****
pmdk-1.8/doc/libpmem2/libpmem2.7.md 0000664 0000000 0000000 00000011040 13615011243 015457 0 ustar root root ---
layout: manual
Content-Style: 'text/css'
title: _MP(LIBPMEM2, 7)
collection: libpmem2
header: PMDK
date: pmem2 API version 1.0
...
[comment]: <> (Copyright 2019, Intel Corporation)
[comment]: <> (Redistribution and use in source and binary forms, with or without)
[comment]: <> (modification, are permitted provided that the following conditions)
[comment]: <> (are met:)
[comment]: <> ( * Redistributions of source code must retain the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer.)
[comment]: <> ( * Redistributions in binary form must reproduce the above copyright)
[comment]: <> ( notice, this list of conditions and the following disclaimer in)
[comment]: <> ( the documentation and/or other materials provided with the)
[comment]: <> ( distribution.)
[comment]: <> ( * Neither the name of the copyright holder nor the names of its)
[comment]: <> ( contributors may be used to endorse or promote products derived)
[comment]: <> ( from this software without specific prior written permission.)
[comment]: <> (THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)
[comment]: <> ("AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR)
[comment]: <> (A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT)
[comment]: <> (OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,)
[comment]: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT)
[comment]: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,)
[comment]: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY)
[comment]: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT)
[comment]: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE)
[comment]: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
[comment]: <> (libpmem2.7 -- man page for libpmem2)
[NAME](#name)
[SYNOPSIS](#synopsis)
[DESCRIPTION](#description)
[CAVEATS](#caveats)
[ENVIRONMENT](#environment)
[DEBUGGING](#debugging)
[EXAMPLE](#example)
[ACKNOWLEDGEMENTS](#acknowledgements)
[SEE ALSO](#see-also)
# NAME #
**libpmem2** - persistent memory support library (EXPERIMENTAL)
# SYNOPSIS #
```c
#include
cc ... -lpmem2
```
# DESCRIPTION #
# CAVEATS #
# ENVIRONMENT #
# DEBUGGING #
Two versions of **libpmem2** are typically available on a development
system. The normal version, accessed when a program is linked using the
**-lpmem2** option, is optimized for performance. That version skips checks
that impact performance and never logs any trace information or performs any
run-time assertions.
A second version of **libpmem2**, accessed when a program uses the libraries
under _DEBUGLIBPATH(), contains run-time assertions and trace points. The
typical way to access the debug version is to set the environment variable
**LD_LIBRARY_PATH** to _LDLIBPATH(). Debugging output is
controlled using the following environment variables. These variables have
no effect on the non-debug version of the library.
+ **PMEM2_LOG_LEVEL**
The value of **PMEM2_LOG_LEVEL** enables trace points in the debug version
of the library, as follows:
+ **0** - This is the default level when **PMEM2_LOG_LEVEL** is not set.
No log messages are emitted at this level.
+ **1** - Additional details on any errors detected are logged, in addition
to returning the *errno*-based errors as usual. The same information
may be retrieved using _UW(pmem2_errormsg).
+ **2** - A trace of basic operations is logged.
+ **3** - Enables a very verbose amount of function call tracing in the
library.
+ **4** - Enables voluminous and fairly obscure tracing
information that is likely only useful to the **libpmem2** developers.
Unless **PMEM2_LOG_FILE** is set, debugging output is written to *stderr*.
+ **PMEM2_LOG_FILE**
Specifies the name of a file where
all logging information should be written. If the last character in the name
is "-", the *PID* of the current process will be appended to the file name when
the log file is created. If **PMEM2_LOG_FILE** is not set, output is
written to *stderr*.
# EXAMPLE #
# ACKNOWLEDGEMENTS #
**libpmem2** builds on the persistent memory programming model recommended
by the SNIA NVM Programming Technical Work Group:
# SEE ALSO #
**libpmem**(7), **libpmemblk**(7), **libpmemlog**(7), **libpmemobj**(7)
and ****
pmdk-1.8/doc/libpmem2/.gitignore 0000664 0000000 0000000 00000000073 13615011243 015255 0 ustar root root libpmem2.7
pmem2_config.3
pmem2_errormsg.3
pmem2_mapping.3
pmdk-1.8/doc/libpmem2/pmem2_config_new.3 0000664 0000000 0000000 00000000023 13615011243 016562 0 ustar root root .so pmem2_config.3
pmdk-1.8/doc/libpmem2/pmem2_config_set_fd.3 0000664 0000000 0000000 00000000023 13615011243 017235 0 ustar root root .so pmem2_config.3
pmdk-1.8/doc/libpmem2/pmem2_config.3 0000644 0000000 0000000 00000004440 13615011420 015713 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEM2_CONFIG" "3" "2020-01-31" "PMDK - pmem2 API version 1.0" "PMDK Programmer's Manual"
.hy
.\" Copyright 2019, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmem2_config_new\f[](), \f[B]pmem2_config_delete\f[](),
\f[B]pmem2_config_set_fd\f[](), \f[B]pmem2_config_set_handle\f[]()
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\
int\ pmem2_config_new(struct\ pmem2_config\ **cfg);
int\ pmem2_config_delete(struct\ pmem2_config\ **cfg);
int\ pmem2_config_set_fd(struct\ pmem2_config\ *cfg,\ int\ fd);
int\ pmem2_config_set_handle(struct\ pmem2_config\ *cfg,\ HANDLE\ handle);\ (XXX:\ WINDOWS\ ONLY)
\f[]
.fi
.SH DESCRIPTION
.SH RETURN VALUE
.SH SEE ALSO
.PP
\f[B]libpmem2\f[](7) and \f[B]\f[]
pmdk-1.8/doc/libpmem2/pmem2_errormsg.3 0000644 0000000 0000000 00000005660 13615011420 016313 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEM2_ERRORMSG" "3" "2020-01-31" "PMDK - pmem2 API version 1.0" "PMDK Programmer's Manual"
.hy
.\" Copyright 2019, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmem2_errormsg\f[]() \- returns last error message
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\
const\ char\ *pmem2_errormsg(void);
\f[]
.fi
.SH DESCRIPTION
.PP
If an error is detected during the call to a \f[B]libpmem2\f[](7)
function, the application may retrieve an error message describing the
reason of the failure from \f[B]pmem2_errormsg\f[]().
The error message buffer is thread\-local; errors encountered in one
thread do not affect its value in other threads.
The buffer is never cleared by any library function; its content is
significant only when the return value of the immediately preceding call
to a \f[B]libpmem2\f[](7) function indicated an error.
The application must not modify or free the error message string.
Subsequent calls to other library functions may modify the previous
message.
.SH RETURN VALUE
.PP
The \f[B]pmem2_errormsg\f[]() function returns a pointer to a static
buffer containing the last error message logged for the current thread.
If \f[I]errno\f[] was set, the error message may include a description
of the corresponding error code as returned by \f[B]strerror\f[](3).
.SH SEE ALSO
.PP
\f[B]strerror\f[](3), \f[B]libpmem2\f[](7) and
\f[B]\f[]
pmdk-1.8/doc/libpmem2/pmem2_mapping.3 0000644 0000000 0000000 00000004031 13615011420 016075 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "PMEM2_MAPPING" "3" "2020-01-31" "PMDK - pmem2 API version 1.0" "PMDK Programmer's Manual"
.hy
.\" Copyright 2019, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]pmem2_map\f[]() \- create mapping on the file
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\
int\ pmem2_map(const\ struct\ pmem2_config\ *cfg,\ struct\ pmem2_map\ **map_ptr);
\f[]
.fi
.SH DESCRIPTION
.SH RETURN VALUE
.SH SEE ALSO
.PP
\f[B]libpmem2\f[](7) and \f[B]\f[]
pmdk-1.8/doc/libpmem2/libpmem2.7 0000644 0000000 0000000 00000010461 13615011420 015061 0 ustar root root .\" Automatically generated by Pandoc 2.2.1
.\"
.TH "LIBPMEM2" "7" "2020-01-31" "PMDK - pmem2 API version 1.0" "PMDK Programmer's Manual"
.hy
.\" Copyright 2019, Intel Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\"
.\" * Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in
.\" the documentation and/or other materials provided with the
.\" distribution.
.\"
.\" * Neither the name of the copyright holder nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.SH NAME
.PP
\f[B]libpmem2\f[] \- persistent memory support library (EXPERIMENTAL)
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\
cc\ ...\ \-lpmem2
\f[]
.fi
.SH DESCRIPTION
.SH CAVEATS
.SH ENVIRONMENT
.SH DEBUGGING
.PP
Two versions of \f[B]libpmem2\f[] are typically available on a
development system.
The normal version, accessed when a program is linked using the
\f[B]\-lpmem2\f[] option, is optimized for performance.
That version skips checks that impact performance and never logs any
trace information or performs any run\-time assertions.
.PP
A second version of \f[B]libpmem2\f[], accessed when a program uses the
libraries under \f[B]/usr/lib/pmdk_debug\f[], contains run\-time
assertions and trace points.
The typical way to access the debug version is to set the environment
variable \f[B]LD_LIBRARY_PATH\f[] to \f[B]/usr/lib/pmdk_debug\f[] or
\f[B]/usr/lib64/pmdk_debug\f[], as appropriate.
Debugging output is controlled using the following environment
variables.
These variables have no effect on the non\-debug version of the library.
.IP \[bu] 2
\f[B]PMEM2_LOG_LEVEL\f[]
.PP
The value of \f[B]PMEM2_LOG_LEVEL\f[] enables trace points in the debug
version of the library, as follows:
.IP \[bu] 2
\f[B]0\f[] \- This is the default level when \f[B]PMEM2_LOG_LEVEL\f[] is
not set.
No log messages are emitted at this level.
.IP \[bu] 2
\f[B]1\f[] \- Additional details on any errors detected are logged, in
addition to returning the \f[I]errno\f[]\-based errors as usual.
The same information may be retrieved using \f[B]pmem2_errormsg\f[]().
.IP \[bu] 2
\f[B]2\f[] \- A trace of basic operations is logged.
.IP \[bu] 2
\f[B]3\f[] \- Enables a very verbose amount of function call tracing in
the library.
.IP \[bu] 2
\f[B]4\f[] \- Enables voluminous and fairly obscure tracing information
that is likely only useful to the \f[B]libpmem2\f[] developers.
.PP
Unless \f[B]PMEM2_LOG_FILE\f[] is set, debugging output is written to
\f[I]stderr\f[].
.IP \[bu] 2
\f[B]PMEM2_LOG_FILE\f[]
.PP
Specifies the name of a file where all logging information should be
written.
If the last character in the name is \[lq]\-\[rq], the \f[I]PID\f[] of
the current process will be appended to the file name when the log file
is created.
If \f[B]PMEM2_LOG_FILE\f[] is not set, output is written to
\f[I]stderr\f[].
.SH EXAMPLE
.SH ACKNOWLEDGEMENTS
.PP
\f[B]libpmem2\f[] builds on the persistent memory programming model
recommended by the SNIA NVM Programming Technical Work Group: