io_uring_register_buffers(3) — Linux manual page

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | SEE ALSO | COLOPHON

io_uring_register_buffers(3) liburing Manualio_uring_register_buffers(3)

NAME         top

       io_uring_register_buffers - register buffers for fixed buffer
       operations

SYNOPSIS         top

       #include <liburing.h>

       int io_uring_register_buffers(struct io_uring *ring,
                                     const struct iovec *iovecs,
                                     unsigned nr_iovecs);

       int io_uring_register_buffers_tags(struct io_uring *ring,
                                          const struct iovec *iovecs,
                                          const __u64 *tags,
                                          unsigned nr);

       int io_uring_register_buffers_sparse(struct io_uring *ring,
                                            unsigned nr_iovecs);

       int io_uring_register_buffers_update_tag(struct io_uring *ring,
                                                unsigned off,
                                                const struct iovec *iovecs,
                                                const __u64 *tags,
                                                unsigned nr);

DESCRIPTION         top

       The io_uring_register_buffers(3) function registers nr_iovecs
       number of buffers defined by the array iovecs belonging to the
       ring.

       The io_uring_register_buffers_tags(3) function behaves the same
       as io_uring_register_buffers(3) function but additionally takes
       tags parameter. See IORING_REGISTER_BUFFERS2 for the resource
       tagging description.

       The io_uring_register_buffers_sparse(3) function registers
       nr_iovecs empty buffers belonging to the ring.  These buffers
       must be updated before use, using eg
       io_uring_register_buffers_update_tag(3).

       After the caller has registered the buffers, they can be used
       with one of the fixed buffers functions.

       Registered buffers is an optimization that is useful in
       conjunction with O_DIRECT reads and writes, where it maps the
       specified range into the kernel once when the buffer is
       registered rather than doing a map and unmap for each IO every
       time IO is performed to that region. Additionally, it also avoids
       manipulating the page reference counts for each IO.

       The io_uring_register_buffers_update_tag(3) function updates
       registered buffers with new ones, either turning a sparse entry
       into a real one, or replacing an existing entry. The off is
       offset on which to start the update nr number of buffers defined
       by the array iovecs belonging to the ring.  The tags points to an
       array of tags. See IORING_REGISTER_BUFFERS2 for the resource
       tagging description.

RETURN VALUE         top

       On success io_uring_register_buffers(3),
       io_uring_register_buffers_tags(3) and
       io_uring_register_buffers_sparse(3) return 0.
       io_uring_register_buffers_update_tag(3) return number of buffers
       updated.  On failure they return -errno.

SEE ALSO         top

       io_uring_register(2), io_uring_get_sqe(3),
       io_uring_unregister_buffers(3), io_uring_register_buf_ring(3),
       io_uring_prep_read_fixed(3), io_uring_prep_write_fixed(3)

COLOPHON         top

       This page is part of the liburing (A library for io_uring)
       project.  Information about the project can be found at 
       ⟨https://github.com/axboe/liburing⟩.  If you have a bug report for
       this manual page, send it to io-uring@vger.kernel.org.  This page
       was obtained from the project's upstream Git repository
       ⟨https://github.com/axboe/liburing⟩ on 2023-12-22.  (At that
       time, the date of the most recent commit that was found in the
       repository was 2023-12-19.)  If you discover any rendering
       problems in this HTML version of the page, or you believe there
       is a better or more up-to-date source for the page, or you have
       corrections or improvements to the information in this COLOPHON
       (which is not part of the original manual page), send a mail to
       man-pages@man7.org

liburing-2.1                November 15, 2021io_uring_register_buffers(3)

Pages that refer to this page: io_uring_prep_read_fixed(3)io_uring_prep_send_zc(3)io_uring_prep_send_zc_fixed(3)io_uring_prep_write_fixed(3)io_uring_register_buffers(3)io_uring_register_buffers_sparse(3)io_uring_register_buffers_tags(3)io_uring_register_buffers_update_tag(3)io_uring_sqe_set_flags(3)io_uring_unregister_buffers(3)