---
name: "rpma_flush"
section: "3"
platform: "linux"
package: "librpma-dev"
version: "1.3.0-2+b3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rpma_flush"
---

# rpma\_flush(3)

initiate the flush operation

## NAME

**rpma\_flush** - initiate the flush operation

## SYNOPSIS

```
      #include <librpma.h>
      struct rpma_conn;
      struct rpma_mr_remote;
      enum rpma_flush_type {
              RPMA_FLUSH_TYPE_PERSISTENT,
              RPMA_FLUSH_TYPE_VISIBILITY,
      };
      int rpma_flush(struct rpma_conn *conn,
                      struct rpma_mr_remote *dst, size_t dst_offset,
                      size_t len, enum rpma_flush_type type, int flags,
                      const void *op_context);
```

## DESCRIPTION

**rpma\_flush**() initiates the flush operation (finalizing a transfer of data to the remote memory). Possible types of **rpma\_flush**() operation:

- •

  RPMA\_FLUSH\_TYPE\_PERSISTENT - flush data down to the persistent domain

- •

  RPMA\_FLUSH\_TYPE\_VISIBILITY - flush data deep enough to make it visible on the remote node

The attribute flags set the completion notification indicator:

- •

  RPMA\_F\_COMPLETION\_ON\_ERROR - generate the completion on error

- •

  RPMA\_F\_COMPLETION\_ALWAYS - generate the completion regardless of result of the operation.

op\_context is returned in the wr\_id field of the completion (struct ibv\_wc).

## RETURN VALUE

The **rpma\_flush**() function returns 0 on success or a negative error code on failure.

## ERRORS

**rpma\_flush**() can fail with the following errors:

- •

  RPMA\_E\_INVAL - conn or dst is NULL

- •

  RPMA\_E\_INVAL - unknown type value

- •

  RPMA\_E\_INVAL - flags are not set

- •

  RPMA\_E\_PROVIDER - [**ibv\_post\_send**(3)](/ibv_post_send/3.md) failed

- •

  RPMA\_E\_NOSUPP - type is RPMA\_FLUSH\_TYPE\_PERSISTENT and the direct write to pmem is not supported

## SEE ALSO

[**rpma\_conn\_req\_connect**(3)](/rpma_conn_req_connect/3.md), [**rpma\_mr\_remote\_from\_descriptor**(3)](/rpma_mr_remote_from_descriptor/3.md), [**librpma**(7)](/librpma/7.md) and https://pmem.io/rpma/
