sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftargetubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h$Register entries with ``REGISTER``. h]h)}(h#Register entries with ``REGISTER``.h](hRegister entries with }(hjhhhNhNubh)}(h ``REGISTER``h]hREGISTER}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKLhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]bullet*uh1jhhhKIhjhhubh)}(hFor every request that has a payload, the kernel reports where the payload lives in ``struct fuse_uring_ent_in_out`` (part of ``struct fuse_uring_req_header``):h](hTFor every request that has a payload, the kernel reports where the payload lives in }(hjhhhNhNubh)}(h ``struct fuse_uring_ent_in_out``h]hstruct fuse_uring_ent_in_out}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh (part of }(hjhhhNhNubh)}(h ``struct fuse_uring_req_header``h]hstruct fuse_uring_req_header}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh):}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKNhjhhubj)}(hhh](j)}(h``offset`` Byte offset, within the pool region, for this request's payload buffer. The server adds this to the pool base address to locate the payload. h](j)}(h ``offset``h]h)}(hjh]hoffset}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhhhKThjubj3)}(hhh]h)}(hByte offset, within the pool region, for this request's payload buffer. The server adds this to the pool base address to locate the payload.h]hByte offset, within the pool region, for this request’s payload buffer. The server adds this to the pool base address to locate the payload.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKShj ubah}(h]h ]h"]h$]h&]uh1j2hjubeh}(h]h ]h"]h$]h&]uh1jhhhKThjubj)}(h9``payload_sz`` Number of payload bytes for this request. h](j)}(h``payload_sz``h]h)}(hj1 h]h payload_sz}(hj3 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj/ ubah}(h]h ]h"]h$]h&]uh1jhhhKWhj+ ubj3)}(hhh]h)}(h)Number of payload bytes for this request.h]h)Number of payload bytes for this request.}(hjI hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKWhjF ubah}(h]h ]h"]h$]h&]uh1j2hj+ ubeh}(h]h ]h"]h$]h&]uh1jhhhKWhjhhubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubh)}(hXTo use registered buffers, the server registers the pool region with io_uring and submits ``ADD_BUFPOOL`` with ``IORING_URING_CMD_FIXED`` set in ``sqe->uring_cmd_flags`` and the index of the registered bufpool in ``sqe->buf_index``. Every SQE the server submits afterwards must follow the same fixed-buffer protocol, carrying ``IORING_URING_CMD_FIXED`` and that same ``sqe->buf_index``. The same registered buffer can be reused for the server's backing-store I/O as well (e.g. ``IORING_OP_READ_FIXED`` / ``IORING_OP_WRITE_FIXED``).h](hZTo use registered buffers, the server registers the pool region with io_uring and submits }(hji hhhNhNubh)}(h``ADD_BUFPOOL``h]h ADD_BUFPOOL}(hjq hhhNhNubah}(h]h ]h"]h$]h&]uh1hhji ubh with }(hji hhhNhNubh)}(h``IORING_URING_CMD_FIXED``h]hIORING_URING_CMD_FIXED}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhji ubh set in }(hji hhhNhNubh)}(h``sqe->uring_cmd_flags``h]hsqe->uring_cmd_flags}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhji ubh, and the index of the registered bufpool in }(hji hhhNhNubh)}(h``sqe->buf_index``h]hsqe->buf_index}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhji ubh_. Every SQE the server submits afterwards must follow the same fixed-buffer protocol, carrying }(hji hhhNhNubh)}(h``IORING_URING_CMD_FIXED``h]hIORING_URING_CMD_FIXED}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhji ubh and that same }(hji hhhNhNubh)}(h``sqe->buf_index``h]hsqe->buf_index}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhji ubh^. The same registered buffer can be reused for the server’s backing-store I/O as well (e.g. }(hji hhhNhNubh)}(h``IORING_OP_READ_FIXED``h]hIORING_OP_READ_FIXED}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhji ubh / }(hji hhhNhNubh)}(h``IORING_OP_WRITE_FIXED``h]hIORING_OP_WRITE_FIXED}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhji ubh).}(hji hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKYhjhhubeh}(h]jah ]h"] buffer poolsah$]h&]uh1hhhhhhhhKF referencedKubh)}(hhh](h)}(h Zero-copyh]h Zero-copy}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKcubh)}(h Requirements:h]h Requirements:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKdhj hhubj)}(hhh](j)}(h2The server must be privileged (``CAP_SYS_ADMIN``).h]h)}(hj3 h](hThe server must be privileged (}(hj5 hhhNhNubh)}(h``CAP_SYS_ADMIN``h]h CAP_SYS_ADMIN}(hj< hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj5 ubh).}(hj5 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKfhj1 ubah}(h]h ]h"]h$]h&]uh1jhj. hhhhhNubj)}(hLA zero-copy queue: ``ADD_QUEUE`` with the ``FUSE_URING_ZERO_COPY`` flag set.h]h)}(hj\ h](hA zero-copy queue: }(hj^ hhhNhNubh)}(h ``ADD_QUEUE``h]h ADD_QUEUE}(hje hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj^ ubh with the }(hj^ hhhNhNubh)}(h``FUSE_URING_ZERO_COPY``h]hFUSE_URING_ZERO_COPY}(hjw hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj^ ubh flag set.}(hj^ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKghjZ ubah}(h]h ]h"]h$]h&]uh1jhj. hhhhhNubj)}(hA buffer pool: ``ADD_BUFPOOL``.h]h)}(hj h](hA buffer pool: }(hj hhhNhNubh)}(h``ADD_BUFPOOL``h]h ADD_BUFPOOL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhj ubah}(h]h ]h"]h$]h&]uh1jhj. hhhhhNubj)}(hX8For each entry, ``REGISTER`` with ``ent_zero_copy_buf_index`` set to the index this entry uses in the server's io_uring registered-buffer table. This is where the kernel registers the request's pages for the server to access (it is separate from the payload pool). On a non-zero-copy queue this field must be 0. h]h)}(hX7For each entry, ``REGISTER`` with ``ent_zero_copy_buf_index`` set to the index this entry uses in the server's io_uring registered-buffer table. This is where the kernel registers the request's pages for the server to access (it is separate from the payload pool). On a non-zero-copy queue this field must be 0.h](hFor each entry, }(hj hhhNhNubh)}(h ``REGISTER``h]hREGISTER}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh with }(hj hhhNhNubh)}(h``ent_zero_copy_buf_index``h]hent_zero_copy_buf_index}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh set to the index this entry uses in the server’s io_uring registered-buffer table. This is where the kernel registers the request’s pages for the server to access (it is separate from the payload pool). On a non-zero-copy queue this field must be 0.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKihj ubah}(h]h ]h"]h$]h&]uh1jhj. hhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhKfhj hhubh)}(huZero-copy is selected per open file. The server sets the open-file flag in the ``FUSE_OPEN`` / ``FUSE_CREATE`` reply:h](hOZero-copy is selected per open file. The server sets the open-file flag in the }(hj hhhNhNubh)}(h ``FUSE_OPEN``h]h FUSE_OPEN}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh / }(hj hhhNhNubh)}(h``FUSE_CREATE``h]h FUSE_CREATE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh reply:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKohj hhubj)}(hhh]j)}(hR``FOPEN_IO_URING_ZERO_COPY`` Reads/writes on this open file should use zero-copy. h](j)}(h``FOPEN_IO_URING_ZERO_COPY``h]h)}(hj; h]hFOPEN_IO_URING_ZERO_COPY}(hj= hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9 ubah}(h]h ]h"]h$]h&]uh1jhhhKshj5 ubj3)}(hhh]h)}(h4Reads/writes on this open file should use zero-copy.h]h4Reads/writes on this open file should use zero-copy.}(hjS hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshjP ubah}(h]h ]h"]h$]h&]uh1j2hj5 ubeh}(h]h ]h"]h$]h&]uh1jhhhKshj2 ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubh)}(hXVFor a request that is zero-copied, the kernel sets ``FUSE_URING_ENT_ZERO_COPY`` in ``fuse_uring_ent_in_out.flags`` and places the request's pages at the entry's ``ent_zero_copy_buf_index``. The server then issues ``IORING_OP_READ_FIXED`` / ``IORING_OP_WRITE_FIXED`` against that index to transfer the data directly to/from the client's pages.h](h3For a request that is zero-copied, the kernel sets }(hjs hhhNhNubh)}(h``FUSE_URING_ENT_ZERO_COPY``h]hFUSE_URING_ENT_ZERO_COPY}(hj{ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjs ubh in }(hjs hhhNhNubh)}(h``fuse_uring_ent_in_out.flags``h]hfuse_uring_ent_in_out.flags}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjs ubh3 and places the request’s pages at the entry’s }(hjs hhhNhNubh)}(h``ent_zero_copy_buf_index``h]hent_zero_copy_buf_index}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjs ubh. The server then issues }(hjs hhhNhNubh)}(h``IORING_OP_READ_FIXED``h]hIORING_OP_READ_FIXED}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjs ubh / }(hjs hhhNhNubh)}(h``IORING_OP_WRITE_FIXED``h]hIORING_OP_WRITE_FIXED}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjs ubhO against that index to transfer the data directly to/from the client’s pages.}(hjs hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKuhj hhubh)}(hFor such a request, ``payload_sz`` includes the zero-copied page bytes (transferred via the registered buffer at ``ent_zero_copy_buf_index``). Any non-page-backed args (e.g. op headers) are still copied through the pool payload buffer at ``offset``.h](hFor such a request, }(hj hhhNhNubh)}(h``payload_sz``h]h payload_sz}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhO includes the zero-copied page bytes (transferred via the registered buffer at }(hj hhhNhNubh)}(h``ent_zero_copy_buf_index``h]hent_zero_copy_buf_index}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhb). Any non-page-backed args (e.g. op headers) are still copied through the pool payload buffer at }(hj hhhNhNubh)}(h ``offset``h]hoffset}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK{hj hhubeh}(h]jah ]h"] zero-copyah$]h&]uh1hhhhhhhhKcj Kubeh}(h]%fuse-over-io-uring-uapi-documentationah ]h"]%fuse-over-io-uring uapi documentationah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjP error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourcehnj _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}( zero-copy](jjjne buffer pools]jsaurefids}nameids}(j+ j( j_j\jjj jj# ju nametypes}(j+ j_jj j# uh}(j( hj\hjjbjjjj u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.