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

Low-level io_uring command senders for ublk control and I/O commands. More...

Go to the source code of this file.

Namespaces

namespace  ublk
 The main namespace of the ublk-cpp library.
namespace  ublk::raw
 Low-level io_uring command senders for ublk control and I/O commands.

Functions

template<typename Fd>
auto ublk::raw::get_queue_affinity (Fd fd, uint32_t dev_id, uint16_t q_id, void *data, uint16_t size, uint16_t dev_path_len) noexcept
 Unprivileged version of get_queue_affinity().
template<typename Fd>
auto ublk::raw::get_queue_affinity (Fd fd, uint32_t dev_id, uint16_t q_id, cpu_set_t *cpuset) noexcept
 Get the queue affinity for a specific ublk queue.
template<typename Fd>
auto ublk::raw::get_dev_info (Fd fd, uint32_t dev_id, void *data, uint16_t size, uint16_t dev_path_len) noexcept
 Unprivileged version of get_dev_info().
template<typename Fd>
auto ublk::raw::get_dev_info (Fd fd, uint32_t dev_id, ublksrv_ctrl_dev_info *info) noexcept
 Get the device information for a specific ublk device.
template<typename Fd>
auto ublk::raw::add_dev (Fd fd, ublksrv_ctrl_dev_info *info) noexcept
 Add a new ublk device.
template<typename Fd>
auto ublk::raw::del_dev (Fd fd, uint32_t dev_id, const char *dev_path, uint16_t dev_path_len) noexcept
 Unprivileged version of del_dev().
template<typename Fd>
auto ublk::raw::del_dev (Fd fd, uint32_t dev_id) noexcept
 Delete a ublk device.
template<typename Fd>
auto ublk::raw::start_dev (Fd fd, uint32_t dev_id, int32_t daemon_pid, const char *dev_path, uint16_t dev_path_len) noexcept
 Unprivileged version of start_dev().
template<typename Fd>
auto ublk::raw::start_dev (Fd fd, uint32_t dev_id, int32_t daemon_pid) noexcept
 Start a ublk device.
template<typename Fd>
auto ublk::raw::stop_dev (Fd fd, uint32_t dev_id, const char *dev_path, uint16_t dev_path_len) noexcept
 Unprivileged version of stop_dev().
template<typename Fd>
auto ublk::raw::stop_dev (Fd fd, uint32_t dev_id) noexcept
 Stop a ublk device.
template<typename Fd>
auto ublk::raw::set_params (Fd fd, uint32_t dev_id, const void *data, uint16_t size, uint16_t dev_path_len) noexcept
 Unprivileged version of set_params().
template<typename Fd>
auto ublk::raw::set_params (Fd fd, uint32_t dev_id, const ublk_params *params) noexcept
 Set the parameters of a ublk device.
template<typename Fd>
auto ublk::raw::get_params (Fd fd, uint32_t dev_id, void *data, uint16_t size, uint16_t dev_path_len) noexcept
 Unprivileged version of get_params().
template<typename Fd>
auto ublk::raw::get_params (Fd fd, uint32_t dev_id, ublk_params *params) noexcept
 Get the parameters of a ublk device.
template<typename Fd>
auto ublk::raw::start_user_recovery (Fd fd, uint32_t dev_id, const char *dev_path, uint16_t dev_path_len) noexcept
 Unprivileged version of start_user_recovery().
template<typename Fd>
auto ublk::raw::start_user_recovery (Fd fd, uint32_t dev_id) noexcept
 Start user recovery for a ublk device.
template<typename Fd>
auto ublk::raw::end_user_recovery (Fd fd, uint32_t dev_id, int32_t daemon_pid, const char *dev_path, uint16_t dev_path_len) noexcept
 Unprivileged version of end_user_recovery().
template<typename Fd>
auto ublk::raw::end_user_recovery (Fd fd, uint32_t dev_id, int32_t daemon_pid) noexcept
 End user recovery for a ublk device.
template<typename Fd>
auto ublk::raw::get_dev_info2 (Fd fd, uint32_t dev_id, void *data, uint16_t size, uint16_t dev_path_len) noexcept
 Get the device information of a ublk device, works both for privileged and unprivileged modes.
template<typename Fd>
auto ublk::raw::get_features (Fd fd, uint64_t *features) noexcept
 Get the feature flags supported by the ublk driver.
template<typename Fd>
auto ublk::raw::del_dev_async (Fd fd, uint32_t dev_id, const char *dev_path, uint16_t dev_path_len) noexcept
 Unprivileged version of del_dev_async().
template<typename Fd>
auto ublk::raw::del_dev_async (Fd fd, uint32_t dev_id) noexcept
 Delete a ublk device asynchronously.
template<typename Fd>
auto ublk::raw::update_size (Fd fd, uint32_t dev_id, uint64_t sectors, const char *dev_path, uint16_t dev_path_len) noexcept
 Unprivileged version of update_size().
template<typename Fd>
auto ublk::raw::update_size (Fd fd, uint32_t dev_id, uint64_t sectors) noexcept
 Update the size of a ublk device.
template<typename Fd>
auto ublk::raw::quiesce_dev (Fd fd, uint32_t dev_id, uint64_t timeout_ms, const char *dev_path, uint16_t dev_path_len) noexcept
 Unprivileged version of quiesce_dev().
template<typename Fd>
auto ublk::raw::quiesce_dev (Fd fd, uint32_t dev_id, uint64_t timeout_ms) noexcept
 Quiesce a ublk device (UBLK_F_QUIESCE).
template<typename Fd>
auto ublk::raw::try_stop_dev (Fd fd, uint32_t dev_id, const char *dev_path, uint16_t dev_path_len) noexcept
 Unprivileged version of try_stop_dev().
template<typename Fd>
auto ublk::raw::try_stop_dev (Fd fd, uint32_t dev_id) noexcept
 Try to stop a ublk device if it has no openers (UBLK_F_SAFE_STOP_DEV).
template<typename Fd>
auto ublk::raw::register_shm_buf (Fd fd, uint32_t dev_id, const void *data, uint16_t size, uint16_t dev_path_len) noexcept
 Unprivileged version of register_shm_buf().
template<typename Fd>
auto ublk::raw::register_shm_buf (Fd fd, uint32_t dev_id, const ublk_shmem_buf_reg *reg) noexcept
 Register a shared memory buffer for zero-copy I/O on a ublk device (UBLK_F_SHMEM_ZC).
template<typename Fd>
auto ublk::raw::unregister_shm_buf (Fd fd, uint32_t dev_id, uint64_t buf_index, const char *dev_path, uint16_t dev_path_len) noexcept
 Unprivileged version of unregister_shm_buf().
template<typename Fd>
auto ublk::raw::unregister_shm_buf (Fd fd, uint32_t dev_id, uint64_t buf_index) noexcept
 Unregister a shared memory buffer from a ublk device.
template<typename Fd>
auto ublk::raw::fetch_req (Fd fd, uint16_t q_id, uint16_t tag, uint64_t buf_addr, uint64_t sqe_addr) noexcept
 Overload of fetch_req() with an explicit sqe->addr, used for automatic request buffer registration (UBLK_F_AUTO_BUF_REG).
template<typename Fd>
auto ublk::raw::fetch_req (Fd fd, uint16_t q_id, uint16_t tag, uint64_t buf_addr) noexcept
 Fetch an I/O request from a ublk queue.
template<typename Fd>
auto ublk::raw::commit_and_fetch_req (Fd fd, uint16_t q_id, uint16_t tag, int32_t result, uint64_t buf_addr, uint64_t sqe_addr) noexcept
 Overload of commit_and_fetch_req() with an explicit sqe->addr, used for automatic request buffer registration (UBLK_F_AUTO_BUF_REG).
template<typename Fd>
auto ublk::raw::commit_and_fetch_req (Fd fd, uint16_t q_id, uint16_t tag, int32_t result, uint64_t buf_addr) noexcept
 Commit the result of an I/O request to the driver and fetch the next request for the same queue.
template<typename Fd>
auto ublk::raw::need_get_data (Fd fd, uint16_t q_id, uint16_t tag, uint64_t buf_addr) noexcept
 Copy the data of a write request into the user buffer after the driver returns UBLK_IO_RES_NEED_GET_DATA.
template<typename Fd>
auto ublk::raw::register_io_buf (Fd fd, uint16_t q_id, uint16_t tag, uint64_t buf_index) noexcept
 Register the buffer of an in-flight request into the io_uring buffer table for zero-copy I/O (UBLK_F_SUPPORT_ZERO_COPY).
template<typename Fd>
auto ublk::raw::unregister_io_buf (Fd fd, uint16_t q_id, uint16_t tag, uint64_t buf_index) noexcept
 Unregister the buffer of an in-flight request from the io_uring buffer table after zero-copy I/O completes.
template<typename Fd>
auto ublk::raw::prep_io_cmds (Fd fd, uint16_t q_id, uint16_t flags, uint16_t nr_elem, uint8_t elem_bytes, const void *elems, uint32_t elems_len) noexcept
 Prepare a batch of I/O commands for a queue (UBLK_F_BATCH_IO).
template<typename Fd>
auto ublk::raw::commit_io_cmds (Fd fd, uint16_t q_id, uint16_t flags, uint16_t nr_elem, uint8_t elem_bytes, const void *elems, uint32_t elems_len) noexcept
 Commit a batch of completed I/O commands for a queue (UBLK_F_BATCH_IO).
template<typename Fd, typename MultiShotFunc>
auto ublk::raw::fetch_io_cmds (Fd fd, condy::ProvidedBufferQueue &buffers, uint16_t q_id, MultiShotFunc &&func) noexcept
 Fetch I/O commands in multishot style into a provided buffer queue (UBLK_F_BATCH_IO).

Detailed Description

Low-level io_uring command senders for ublk control and I/O commands.

Definition in file raw.hpp.