ublk-cpp v0.0
Loading...
Searching...
No Matches
helpers.hpp File Reference

Simple ublk helper functions. More...

#include "ublk/ublk_cmd.h"
#include <cassert>
#include <cstdint>

Go to the source code of this file.

Namespaces

namespace  ublk
 The main namespace of the ublk-cpp library.

Functions

uint16_t ublk::shmem_zc_index (uint64_t addr) noexcept
 Extract the buffer index from a shared memory zero-copy encoded address (UBLK_IO_F_SHMEM_ZC).
uint32_t ublk::shmem_zc_offset (uint64_t addr) noexcept
 Extract the byte offset within the buffer from a shared memory zero-copy encoded address (UBLK_IO_F_SHMEM_ZC).
uint64_t ublk::user_copy_pos (uint16_t q_id, uint16_t tag, uint32_t offset) noexcept
 Compute the byte position in /dev/ublkcN for user-space data copy (UBLK_F_USER_COPY).

Detailed Description

Simple ublk helper functions.

Definition in file helpers.hpp.