sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget0/translations/zh_CN/filesystems/iomap/operationsmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/zh_TW/filesystems/iomap/operationsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/it_IT/filesystems/iomap/operationsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/ja_JP/filesystems/iomap/operationsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/ko_KR/filesystems/iomap/operationsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/sp_SP/filesystems/iomap/operationsmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhJ/var/lib/git/docbuild/linux/Documentation/filesystems/iomap/operations.rsthKubhtarget)}(h.. _iomap_operations:h]h}(h]iomap-operationsah ]h"]iomap_operationsah$]h&]uh1hhKhhhhhhubh)}(hDumb style notes to maintain the author's sanity: Please try to start sentences on separate lines so that sentence changes don't bleed colors in diff. Heading decorations are documented in sphinx.rst.h]hDumb style notes to maintain the author's sanity: Please try to start sentences on separate lines so that sentence changes don't bleed colors in diff. Heading decorations are documented in sphinx.rst.}hhsbah}(h]h ]h"]h$]h&]hhuh1hhhhhhhhK ubhsection)}(hhh](htitle)}(hSupported File Operationsh]hSupported File Operations}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubhtopic)}(hTable of Contents h](h)}(hTable of Contentsh]hTable of Contents}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhKubh bullet_list)}(hhh](h list_item)}(hhh](h paragraph)}(hhh]h reference)}(hhh]h Buffered I/O}(hj hhhNhNubah}(h]id1ah ]h"]h$]h&]refid buffered-i-ouh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hhh](h)}(hhh]j)}(hhh]j )}(hhh]hliteral)}(h#``struct address_space_operations``h]hstruct address_space_operations}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hNhNhj)ubah}(h]id2ah ]h"]h$]h&]refidstruct-address-space-operationsuh1jhj&ubah}(h]h ]h"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&]uh1hhj ubh)}(hhh]j)}(hhh]j )}(hhh]j-)}(h``struct iomap_write_ops``h]hstruct iomap_write_ops}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hNhNhjWubah}(h]id3ah ]h"]h$]h&]refidstruct-iomap-write-opsuh1jhjTubah}(h]h ]h"]h$]h&]uh1jhjQubah}(h]h ]h"]h$]h&]uh1hhj ubh)}(hhh]j)}(hhh]j )}(hhh]hInternal per-Folio State}(hjhhhNhNubah}(h]id4ah ]h"]h$]h&]refidinternal-per-folio-stateuh1jhjubah}(h]h ]h"]h$]h&]uh1jhj}ubah}(h]h ]h"]h$]h&]uh1hhj ubh)}(hhh]j)}(hhh]j )}(hhh]hBuffered Readahead and Reads}(hjhhhNhNubah}(h]id5ah ]h"]h$]h&]refidbuffered-readahead-and-readsuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhj ubh)}(hhh](j)}(hhh]j )}(hhh]hBuffered Writes}(hjhhhNhNubah}(h]id6ah ]h"]h$]h&]refidbuffered-writesuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hhh](h)}(hhh]j)}(hhh]j )}(hhh]hmmap Write Faults}(hjhhhNhNubah}(h]id7ah ]h"]h$]h&]refidmmap-write-faultsuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]j)}(hhh]j )}(hhh]hBuffered Write Failures}(hjhhhNhNubah}(h]id8ah ]h"]h$]h&]refidbuffered-write-failuresuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]j)}(hhh]j )}(hhh]hZeroing for File Operations}(hj*hhhNhNubah}(h]id9ah ]h"]h$]h&]refidzeroing-for-file-operationsuh1jhj'ubah}(h]h ]h"]h$]h&]uh1jhj$ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]j)}(hhh]j )}(hhh]hUnsharing Reflinked File Data}(hjLhhhNhNubah}(h]id10ah ]h"]h$]h&]refidunsharing-reflinked-file-datauh1jhjIubah}(h]h ]h"]h$]h&]uh1jhjFubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhj ubh)}(hhh]j)}(hhh]j )}(hhh]h Truncation}(hjzhhhNhNubah}(h]id11ah ]h"]h$]h&]refid truncationuh1jhjwubah}(h]h ]h"]h$]h&]uh1jhjtubah}(h]h ]h"]h$]h&]uh1hhj ubh)}(hhh](j)}(hhh]j )}(hhh]hPagecache Writeback}(hjhhhNhNubah}(h]id12ah ]h"]h$]h&]refidpagecache-writebackuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hhh](h)}(hhh]j)}(hhh]j )}(hhh]j-)}(h``struct iomap_writeback_ops``h]hstruct iomap_writeback_ops}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hNhNhjubah}(h]id13ah ]h"]h$]h&]refidstruct-iomap-writeback-opsuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]j)}(hhh]j )}(hhh]hPagecache Writeback Completion}(hjhhhNhNubah}(h]id14ah ]h"]h$]h&]refidpagecache-writeback-completionuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhj ubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh](j)}(hhh]j )}(hhh]h Direct I/O}(hj!hhhNhNubah}(h]id15ah ]h"]h$]h&]refid direct-i-ouh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hhh](h)}(hhh]j)}(hhh]j )}(hhh]h Return Values}(hj@hhhNhNubah}(h]id16ah ]h"]h$]h&]refid return-valuesuh1jhj=ubah}(h]h ]h"]h$]h&]uh1jhj:ubah}(h]h ]h"]h$]h&]uh1hhj7ubh)}(hhh]j)}(hhh]j )}(hhh]h Direct Reads}(hjbhhhNhNubah}(h]id17ah ]h"]h$]h&]refid direct-readsuh1jhj_ubah}(h]h ]h"]h$]h&]uh1jhj\ubah}(h]h ]h"]h$]h&]uh1hhj7ubh)}(hhh]j)}(hhh]j )}(hhh]h Direct Writes}(hjhhhNhNubah}(h]id18ah ]h"]h$]h&]refid direct-writesuh1jhjubah}(h]h ]h"]h$]h&]uh1jhj~ubah}(h]h ]h"]h$]h&]uh1hhj7ubh)}(hhh]j)}(hhh]j )}(hhh]j-)}(h``struct iomap_dio_ops:``h]hstruct iomap_dio_ops:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hNhNhjubah}(h]id19ah ]h"]h$]h&]refidstruct-iomap-dio-opsuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhj7ubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh](j)}(hhh]j )}(hhh]hDAX I/O}(hjhhhNhNubah}(h]id20ah ]h"]h$]h&]refiddax-i-ouh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hhh](h)}(hhh]j)}(hhh]j )}(hhh]h fsdax Reads}(hjhhhNhNubah}(h]id21ah ]h"]h$]h&]refid fsdax-readsuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh](j)}(hhh]j )}(hhh]h fsdax Writes}(hjhhhNhNubah}(h]id22ah ]h"]h$]h&]refid fsdax-writesuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hhh]h)}(hhh]j)}(hhh]j )}(hhh]hfsdax mmap Faults}(hj>hhhNhNubah}(h]id23ah ]h"]h$]h&]refidfsdax-mmap-faultsuh1jhj;ubah}(h]h ]h"]h$]h&]uh1jhj8ubah}(h]h ]h"]h$]h&]uh1hhj5ubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]j)}(hhh]j )}(hhh]h*fsdax Truncation, fallocate, and Unsharing}(hjlhhhNhNubah}(h]id24ah ]h"]h$]h&]refid(fsdax-truncation-fallocate-and-unsharinguh1jhjiubah}(h]h ]h"]h$]h&]uh1jhjfubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]j)}(hhh]j )}(hhh]hfsdax Deduplication}(hjhhhNhNubah}(h]id25ah ]h"]h$]h&]refidfsdax-deduplicationuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh](j)}(hhh]j )}(hhh]h Seeking Files}(hjhhhNhNubah}(h]id26ah ]h"]h$]h&]refid seeking-filesuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hhh](h)}(hhh]j)}(hhh]j )}(hhh]h SEEK_DATA}(hjhhhNhNubah}(h]id27ah ]h"]h$]h&]refid seek-datauh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]j)}(hhh]j )}(hhh]h SEEK_HOLE}(hjhhhNhNubah}(h]id28ah ]h"]h$]h&]refid seek-holeuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh]j)}(hhh]j )}(hhh]hSwap File Activation}(hj+hhhNhNubah}(h]id29ah ]h"]h$]h&]refidswap-file-activationuh1jhj(ubah}(h]h ]h"]h$]h&]uh1jhj%ubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh](j)}(hhh]j )}(hhh]hFile Space Mapping Reporting}(hjMhhhNhNubah}(h]id30ah ]h"]h$]h&]refidfile-space-mapping-reportinguh1jhjJubah}(h]h ]h"]h$]h&]uh1jhjGubh)}(hhh](h)}(hhh]j)}(hhh]j )}(hhh]h FS_IOC_FIEMAP}(hjlhhhNhNubah}(h]id31ah ]h"]h$]h&]refid fs-ioc-fiemapuh1jhjiubah}(h]h ]h"]h$]h&]uh1jhjfubah}(h]h ]h"]h$]h&]uh1hhjcubh)}(hhh]j)}(hhh]j )}(hhh]hFIBMAP (deprecated)}(hjhhhNhNubah}(h]id32ah ]h"]h$]h&]refidfibmap-deprecateduh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhjcubeh}(h]h ]h"]h$]h&]uh1hhjGubeh}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhhhNhNubeh}(h]table-of-contentsah ](contentslocaleh"]table of contentsah$]h&]uh1hhhhKhhhhubj)}(hOBelow are a discussion of the high level file operations that iomap implements.h]hOBelow are a discussion of the high level file operations that iomap implements.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhhhhubh)}(hhh](h)}(h Buffered I/Oh]h Buffered I/O}(hjhhhNhNubah}(h]h ]h"]h$]h&]refidjuh1hhjhhhhhKubj)}(hBuffered I/O is the default file I/O path in Linux. File contents are cached in memory ("pagecache") to satisfy reads and writes. Dirty cache will be written back to disk at some point that can be forced via ``fsync`` and variants.h](hBuffered I/O is the default file I/O path in Linux. File contents are cached in memory (“pagecache”) to satisfy reads and writes. Dirty cache will be written back to disk at some point that can be forced via }(hjhhhNhNubj-)}(h ``fsync``h]hfsync}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh and variants.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj)}(hX\iomap implements nearly all the folio and pagecache management that filesystems have to implement themselves under the legacy I/O model. This means that the filesystem need not know the details of allocating, mapping, managing uptodate and dirty state, or writeback of pagecache folios. Under the legacy I/O model, this was managed very inefficiently with linked lists of buffer heads instead of the per-folio bitmaps that iomap uses. Unless the filesystem explicitly opts in to buffer heads, they will not be used, which makes buffered I/O much more efficient, and the pagecache maintainer much happier.h]hX\iomap implements nearly all the folio and pagecache management that filesystems have to implement themselves under the legacy I/O model. This means that the filesystem need not know the details of allocating, mapping, managing uptodate and dirty state, or writeback of pagecache folios. Under the legacy I/O model, this was managed very inefficiently with linked lists of buffer heads instead of the per-folio bitmaps that iomap uses. Unless the filesystem explicitly opts in to buffer heads, they will not be used, which makes buffered I/O much more efficient, and the pagecache maintainer much happier.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjhhubh)}(hhh](h)}(hj0h]j-)}(hj0h]hstruct address_space_operations}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubah}(h]h ]h"]h$]h&]jj>uh1hhjhhhhhK*ubj)}(heThe following iomap functions can be referenced directly from the address space operations structure:h]heThe following iomap functions can be referenced directly from the address space operations structure:}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK,hjhhubh block_quote)}(hq* ``iomap_dirty_folio`` * ``iomap_release_folio`` * ``iomap_invalidate_folio`` * ``iomap_is_partially_uptodate`` h]h)}(hhh](h)}(h``iomap_dirty_folio``h]j)}(hjFh]j-)}(hjFh]hiomap_dirty_folio}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjHubah}(h]h ]h"]h$]h&]uh1jhhhK/hjDubah}(h]h ]h"]h$]h&]uh1hhjAubh)}(h``iomap_release_folio``h]j)}(hjfh]j-)}(hjfh]hiomap_release_folio}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjhubah}(h]h ]h"]h$]h&]uh1jhhhK0hjdubah}(h]h ]h"]h$]h&]uh1hhjAubh)}(h``iomap_invalidate_folio``h]j)}(hjh]j-)}(hjh]hiomap_invalidate_folio}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubah}(h]h ]h"]h$]h&]uh1jhhhK1hjubah}(h]h ]h"]h$]h&]uh1hhjAubh)}(h ``iomap_is_partially_uptodate`` h]j)}(h``iomap_is_partially_uptodate``h]j-)}(hjh]hiomap_is_partially_uptodate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubah}(h]h ]h"]h$]h&]uh1jhhhK2hjubah}(h]h ]h"]h$]h&]uh1hhjAubeh}(h]h ]h"]h$]h&]bullet*uh1hhhhK/hj=ubah}(h]h ]h"]h$]h&]uh1j;hhhK/hjhhubj)}(h=The following address space operations can be wrapped easily:h]h=The following address space operations can be wrapped easily:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK4hjhhubj<)}(hQ* ``read_folio`` * ``readahead`` * ``writepages`` * ``bmap`` * ``swap_activate`` h]h)}(hhh](h)}(h``read_folio``h]j)}(hjh]j-)}(hjh]h read_folio}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubah}(h]h ]h"]h$]h&]uh1jhhhK6hjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(h ``readahead``h]j)}(hj h]j-)}(hj h]h readahead}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubah}(h]h ]h"]h$]h&]uh1jhhhK7hjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(h``writepages``h]j)}(hj*h]j-)}(hj*h]h writepages}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj,ubah}(h]h ]h"]h$]h&]uh1jhhhK8hj(ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(h``bmap``h]j)}(hjJh]j-)}(hjJh]hbmap}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjLubah}(h]h ]h"]h$]h&]uh1jhhhK9hjHubah}(h]h ]h"]h$]h&]uh1hhjubh)}(h``swap_activate`` h]j)}(h``swap_activate``h]j-)}(hjnh]h swap_activate}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjlubah}(h]h ]h"]h$]h&]uh1jhhhK:hjhubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jjuh1hhhhK6hjubah}(h]h ]h"]h$]h&]uh1j;hhhK6hjhhubeh}(h]jDah ]h"]struct address_space_operationsah$]h&]uh1hhjhhhhhK*ubh)}(hhh](h)}(hj\h]j-)}(hj\h]hstruct iomap_write_ops}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubah}(h]h ]h"]h$]h&]jjjuh1hhjhhhhhK=ubh literal_block)}(hXstruct iomap_write_ops { struct folio *(*get_folio)(struct iomap_iter *iter, loff_t pos, unsigned len); void (*put_folio)(struct inode *inode, loff_t pos, unsigned copied, struct folio *folio); bool (*iomap_valid)(struct inode *inode, const struct iomap *iomap); int (*read_folio_range)(const struct iomap_iter *iter, struct folio *folio, loff_t pos, size_t len); };h]hXstruct iomap_write_ops { struct folio *(*get_folio)(struct iomap_iter *iter, loff_t pos, unsigned len); void (*put_folio)(struct inode *inode, loff_t pos, unsigned copied, struct folio *folio); bool (*iomap_valid)(struct inode *inode, const struct iomap *iomap); int (*read_folio_range)(const struct iomap_iter *iter, struct folio *folio, loff_t pos, size_t len); };}hjsbah}(h]h ]h"]h$]h&]hhforcelanguagechighlight_args}uh1jhhhK?hjhhubj)}(hiomap calls these functions:h]hiomap calls these functions:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKKhjhhubj<)}(hX - ``get_folio``: Called to allocate and return an active reference to a locked folio prior to starting a write. If this function is not provided, iomap will call ``iomap_get_folio``. This could be used to `set up per-folio filesystem state `_ for a write. - ``put_folio``: Called to unlock and put a folio after a pagecache operation completes. If this function is not provided, iomap will ``folio_unlock`` and ``folio_put`` on its own. This could be used to `commit per-folio filesystem state `_ that was set up by ``->get_folio``. - ``iomap_valid``: The filesystem may not hold locks between ``->iomap_begin`` and ``->iomap_end`` because pagecache operations can take folio locks, fault on userspace pages, initiate writeback for memory reclamation, or engage in other time-consuming actions. If a file's space mapping data are mutable, it is possible that the mapping for a particular pagecache folio can `change in the time it takes `_ to allocate, install, and lock that folio. For the pagecache, races can happen if writeback doesn't take ``i_rwsem`` or ``invalidate_lock`` and updates mapping information. Races can also happen if the filesystem allows concurrent writes. For such files, the mapping *must* be revalidated after the folio lock has been taken so that iomap can manage the folio correctly. fsdax does not need this revalidation because there's no writeback and no support for unwritten extents. Filesystems subject to this kind of race must provide a ``->iomap_valid`` function to decide if the mapping is still valid. If the mapping is not valid, the mapping will be sampled again. To support making the validity decision, the filesystem's ``->iomap_begin`` function may set ``struct iomap::validity_cookie`` at the same time that it populates the other iomap fields. A simple validation cookie implementation is a sequence counter. If the filesystem bumps the sequence counter every time it modifies the inode's extent map, it can be placed in the ``struct iomap::validity_cookie`` during ``->iomap_begin``. If the value in the cookie is found to be different to the value the filesystem holds when the mapping is passed back to ``->iomap_valid``, then the iomap should considered stale and the validation failed. - ``read_folio_range``: Called to synchronously read in the range that will be written to. If this function is not provided, iomap will default to submitting a bio read request. h]h)}(hhh](h)}(hXG``get_folio``: Called to allocate and return an active reference to a locked folio prior to starting a write. If this function is not provided, iomap will call ``iomap_get_folio``. This could be used to `set up per-folio filesystem state `_ for a write. h]j)}(hXF``get_folio``: Called to allocate and return an active reference to a locked folio prior to starting a write. If this function is not provided, iomap will call ``iomap_get_folio``. This could be used to `set up per-folio filesystem state `_ for a write.h](j-)}(h ``get_folio``h]h get_folio}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh: Called to allocate and return an active reference to a locked folio prior to starting a write. If this function is not provided, iomap will call }(hjhhhNhNubj-)}(h``iomap_get_folio``h]hiomap_get_folio}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh. This could be used to }(hjhhhNhNubj )}(hn`set up per-folio filesystem state `_h]h!set up per-folio filesystem state}(hj hhhNhNubah}(h]h ]h"]h$]h&]name!set up per-folio filesystem staterefuriGhttps://lore.kernel.org/all/20190429220934.10415-5-agruenba@redhat.com/uh1jhjubh)}(hJ h]h}(h]!set-up-per-folio-filesystem-stateah ]h"]!set up per-folio filesystem stateah$]h&]refurijuh1h referencedKhjubh for a write.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKMhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hXS``put_folio``: Called to unlock and put a folio after a pagecache operation completes. If this function is not provided, iomap will ``folio_unlock`` and ``folio_put`` on its own. This could be used to `commit per-folio filesystem state `_ that was set up by ``->get_folio``. h]j)}(hXR``put_folio``: Called to unlock and put a folio after a pagecache operation completes. If this function is not provided, iomap will ``folio_unlock`` and ``folio_put`` on its own. This could be used to `commit per-folio filesystem state `_ that was set up by ``->get_folio``.h](j-)}(h ``put_folio``h]h put_folio}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj?ubhw: Called to unlock and put a folio after a pagecache operation completes. If this function is not provided, iomap will }(hj?hhhNhNubj-)}(h``folio_unlock``h]h folio_unlock}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj?ubh and }(hj?hhhNhNubj-)}(h ``folio_put``h]h folio_put}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj?ubh# on its own. This could be used to }(hj?hhhNhNubj )}(he`commit per-folio filesystem state `_h]h!commit per-folio filesystem state}(hjyhhhNhNubah}(h]h ]h"]h$]h&]name!commit per-folio filesystem statej>https://lore.kernel.org/all/20180619164137.13720-6-hch@lst.de/uh1jhj?ubh)}(hA h]h}(h]!commit-per-folio-filesystem-stateah ]h"]!commit per-folio filesystem stateah$]h&]refurijuh1hj*Khj?ubh that was set up by }(hj?hhhNhNubj-)}(h``->get_folio``h]h ->get_folio}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj?ubh.}(hj?hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKUhj;ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hX``iomap_valid``: The filesystem may not hold locks between ``->iomap_begin`` and ``->iomap_end`` because pagecache operations can take folio locks, fault on userspace pages, initiate writeback for memory reclamation, or engage in other time-consuming actions. If a file's space mapping data are mutable, it is possible that the mapping for a particular pagecache folio can `change in the time it takes `_ to allocate, install, and lock that folio. For the pagecache, races can happen if writeback doesn't take ``i_rwsem`` or ``invalidate_lock`` and updates mapping information. Races can also happen if the filesystem allows concurrent writes. For such files, the mapping *must* be revalidated after the folio lock has been taken so that iomap can manage the folio correctly. fsdax does not need this revalidation because there's no writeback and no support for unwritten extents. Filesystems subject to this kind of race must provide a ``->iomap_valid`` function to decide if the mapping is still valid. If the mapping is not valid, the mapping will be sampled again. To support making the validity decision, the filesystem's ``->iomap_begin`` function may set ``struct iomap::validity_cookie`` at the same time that it populates the other iomap fields. A simple validation cookie implementation is a sequence counter. If the filesystem bumps the sequence counter every time it modifies the inode's extent map, it can be placed in the ``struct iomap::validity_cookie`` during ``->iomap_begin``. If the value in the cookie is found to be different to the value the filesystem holds when the mapping is passed back to ``->iomap_valid``, then the iomap should considered stale and the validation failed. h](j)}(hX ``iomap_valid``: The filesystem may not hold locks between ``->iomap_begin`` and ``->iomap_end`` because pagecache operations can take folio locks, fault on userspace pages, initiate writeback for memory reclamation, or engage in other time-consuming actions. If a file's space mapping data are mutable, it is possible that the mapping for a particular pagecache folio can `change in the time it takes `_ to allocate, install, and lock that folio.h](j-)}(h``iomap_valid``h]h iomap_valid}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh,: The filesystem may not hold locks between }(hjhhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh and }(hjhhhNhNubj-)}(h``->iomap_end``h]h ->iomap_end}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhX because pagecache operations can take folio locks, fault on userspace pages, initiate writeback for memory reclamation, or engage in other time-consuming actions. If a file’s space mapping data are mutable, it is possible that the mapping for a particular pagecache folio can }(hjhhhNhNubj )}(hi`change in the time it takes `_h]hchange in the time it takes}(hjhhhNhNubah}(h]h ]h"]h$]h&]namechange in the time it takesjHhttps://lore.kernel.org/all/20221123055812.747923-8-david@fromorbit.com/uh1jhjubh)}(hK h]h}(h]change-in-the-time-it-takesah ]h"]change in the time it takesah$]h&]refurij uh1hj*Khjubh+ to allocate, install, and lock that folio.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhK]hjubj)}(hXGFor the pagecache, races can happen if writeback doesn't take ``i_rwsem`` or ``invalidate_lock`` and updates mapping information. Races can also happen if the filesystem allows concurrent writes. For such files, the mapping *must* be revalidated after the folio lock has been taken so that iomap can manage the folio correctly.h](h@For the pagecache, races can happen if writeback doesn’t take }(hj hhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hj' hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh or }(hj hhhNhNubj-)}(h``invalidate_lock``h]hinvalidate_lock}(hj9 hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh and updates mapping information. Races can also happen if the filesystem allows concurrent writes. For such files, the mapping }(hj hhhNhNubhemphasis)}(h*must*h]hmust}(hjM hhhNhNubah}(h]h ]h"]h$]h&]uh1jK hj ubha be revalidated after the folio lock has been taken so that iomap can manage the folio correctly.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKghjubj)}(hhfsdax does not need this revalidation because there's no writeback and no support for unwritten extents.h]hjfsdax does not need this revalidation because there’s no writeback and no support for unwritten extents.}(hje hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKmhjubj)}(hFilesystems subject to this kind of race must provide a ``->iomap_valid`` function to decide if the mapping is still valid. If the mapping is not valid, the mapping will be sampled again.h](h8Filesystems subject to this kind of race must provide a }(hjs hhhNhNubj-)}(h``->iomap_valid``h]h ->iomap_valid}(hj{ hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjs ubhr function to decide if the mapping is still valid. If the mapping is not valid, the mapping will be sampled again.}(hjs hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKphjubj)}(hXxTo support making the validity decision, the filesystem's ``->iomap_begin`` function may set ``struct iomap::validity_cookie`` at the same time that it populates the other iomap fields. A simple validation cookie implementation is a sequence counter. If the filesystem bumps the sequence counter every time it modifies the inode's extent map, it can be placed in the ``struct iomap::validity_cookie`` during ``->iomap_begin``. If the value in the cookie is found to be different to the value the filesystem holds when the mapping is passed back to ``->iomap_valid``, then the iomap should considered stale and the validation failed.h](hiomap_begin``h]h ->iomap_begin}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh function may set }(hj hhhNhNubj-)}(h!``struct iomap::validity_cookie``h]hstruct iomap::validity_cookie}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh at the same time that it populates the other iomap fields. A simple validation cookie implementation is a sequence counter. If the filesystem bumps the sequence counter every time it modifies the inode’s extent map, it can be placed in the }(hj hhhNhNubj-)}(h!``struct iomap::validity_cookie``h]hstruct iomap::validity_cookie}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh during }(hj hhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh{. If the value in the cookie is found to be different to the value the filesystem holds when the mapping is passed back to }(hj hhhNhNubj-)}(h``->iomap_valid``h]h ->iomap_valid}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubhC, then the iomap should considered stale and the validation failed.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKthjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(h``read_folio_range``: Called to synchronously read in the range that will be written to. If this function is not provided, iomap will default to submitting a bio read request. h]j)}(h``read_folio_range``: Called to synchronously read in the range that will be written to. If this function is not provided, iomap will default to submitting a bio read request.h](j-)}(h``read_folio_range``h]hread_folio_range}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh: Called to synchronously read in the range that will be written to. If this function is not provided, iomap will default to submitting a bio read request.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj ubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]j-uh1hhhhKMhjubah}(h]h ]h"]h$]h&]uh1j;hhhKMhjhhubj)}(hIThese ``struct kiocb`` flags are significant for buffered I/O with iomap:h](hThese }(hj4 hhhNhNubj-)}(h``struct kiocb``h]h struct kiocb}(hj< hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj4 ubh3 flags are significant for buffered I/O with iomap:}(hj4 hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj<)}(hc* ``IOCB_NOWAIT``: Turns on ``IOMAP_NOWAIT``. * ``IOCB_DONTCACHE``: Turns on ``IOMAP_DONTCACHE``. h]h)}(hhh](h)}(h,``IOCB_NOWAIT``: Turns on ``IOMAP_NOWAIT``. h]j)}(h+``IOCB_NOWAIT``: Turns on ``IOMAP_NOWAIT``.h](j-)}(h``IOCB_NOWAIT``h]h IOCB_NOWAIT}(hjc hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj_ ubh : Turns on }(hj_ hhhNhNubj-)}(h``IOMAP_NOWAIT``h]h IOMAP_NOWAIT}(hju hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj_ ubh.}(hj_ hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj[ ubah}(h]h ]h"]h$]h&]uh1hhjX ubh)}(h2``IOCB_DONTCACHE``: Turns on ``IOMAP_DONTCACHE``. h]j)}(h1``IOCB_DONTCACHE``: Turns on ``IOMAP_DONTCACHE``.h](j-)}(h``IOCB_DONTCACHE``h]hIOCB_DONTCACHE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh : Turns on }(hj hhhNhNubj-)}(h``IOMAP_DONTCACHE``h]hIOMAP_DONTCACHE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj ubah}(h]h ]h"]h$]h&]uh1hhjX ubeh}(h]h ]h"]h$]h&]jjuh1hhhhKhjT ubah}(h]h ]h"]h$]h&]uh1j;hhhKhjhhubeh}(h]jpah ]h"]struct iomap_write_opsah$]h&]uh1hhjhhhhhK=ubh)}(hhh](h)}(hInternal per-Folio Stateh]hInternal per-Folio State}(hj hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhj hhhhhKubj)}(hX?If the fsblock size matches the size of a pagecache folio, it is assumed that all disk I/O operations will operate on the entire folio. The uptodate (memory contents are at least as new as what's on disk) and dirty (memory contents are newer than what's on disk) status of the folio are all that's needed for this case.h]hXEIf the fsblock size matches the size of a pagecache folio, it is assumed that all disk I/O operations will operate on the entire folio. The uptodate (memory contents are at least as new as what’s on disk) and dirty (memory contents are newer than what’s on disk) status of the folio are all that’s needed for this case.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj hhubj)}(hX(If the fsblock size is less than the size of a pagecache folio, iomap tracks the per-fsblock uptodate and dirty state itself. This enables iomap to handle both "bs < ps" `filesystems `_ and large folios in the pagecache.h](hIf the fsblock size is less than the size of a pagecache folio, iomap tracks the per-fsblock uptodate and dirty state itself. This enables iomap to handle both “bs < ps” }(hj hhhNhNubj )}(h[`filesystems `_h]h filesystems}(hj hhhNhNubah}(h]h ]h"]h$]h&]name filesystemsjJhttps://lore.kernel.org/all/20230725122932.144426-1-ritesh.list@gmail.com/uh1jhj ubh)}(hM h]h}(h] filesystemsah ]h"] filesystemsah$]h&]refurij uh1hj*Khj ubh# and large folios in the pagecache.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubj)}(h3iomap internally tracks two state bits per fsblock:h]h3iomap internally tracks two state bits per fsblock:}(hj- hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj hhubj<)}(hX* ``uptodate``: iomap will try to keep folios fully up to date. If there are read(ahead) errors, those fsblocks will not be marked uptodate. The folio itself will be marked uptodate when all fsblocks within the folio are uptodate. * ``dirty``: iomap will set the per-block dirty state when programs write to the file. The folio itself will be marked dirty when any fsblock within the folio is dirty. h]h)}(hhh](h)}(h``uptodate``: iomap will try to keep folios fully up to date. If there are read(ahead) errors, those fsblocks will not be marked uptodate. The folio itself will be marked uptodate when all fsblocks within the folio are uptodate. h]j)}(h``uptodate``: iomap will try to keep folios fully up to date. If there are read(ahead) errors, those fsblocks will not be marked uptodate. The folio itself will be marked uptodate when all fsblocks within the folio are uptodate.h](j-)}(h ``uptodate``h]huptodate}(hjJ hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjF ubh: iomap will try to keep folios fully up to date. If there are read(ahead) errors, those fsblocks will not be marked uptodate. The folio itself will be marked uptodate when all fsblocks within the folio are uptodate.}(hjF hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhjB ubah}(h]h ]h"]h$]h&]uh1hhj? ubh)}(h``dirty``: iomap will set the per-block dirty state when programs write to the file. The folio itself will be marked dirty when any fsblock within the folio is dirty. h]j)}(h``dirty``: iomap will set the per-block dirty state when programs write to the file. The folio itself will be marked dirty when any fsblock within the folio is dirty.h](j-)}(h ``dirty``h]hdirty}(hjp hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjl ubh: iomap will set the per-block dirty state when programs write to the file. The folio itself will be marked dirty when any fsblock within the folio is dirty.}(hjl hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhjh ubah}(h]h ]h"]h$]h&]uh1hhj? ubeh}(h]h ]h"]h$]h&]jjuh1hhhhKhj; ubah}(h]h ]h"]h$]h&]uh1j;hhhKhj hhubj)}(hiomap also tracks the amount of read and write disk IOs that are in flight. This structure is much lighter weight than ``struct buffer_head`` because there is only one per folio, and the per-fsblock overhead is two bits vs. 104 bytes.h](hwiomap also tracks the amount of read and write disk IOs that are in flight. This structure is much lighter weight than }(hj hhhNhNubj-)}(h``struct buffer_head``h]hstruct buffer_head}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh] because there is only one per folio, and the per-fsblock overhead is two bits vs. 104 bytes.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubj)}(hFilesystems wishing to turn on large folios in the pagecache should call ``mapping_set_large_folios`` when initializing the incore inode.h](hIFilesystems wishing to turn on large folios in the pagecache should call }(hj hhhNhNubj-)}(h``mapping_set_large_folios``h]hmapping_set_large_folios}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh$ when initializing the incore inode.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubeh}(h]jah ]h"]internal per-folio stateah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hBuffered Readahead and Readsh]hBuffered Readahead and Reads}(hj hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhj hhhhhKubj)}(hX(The ``iomap_readahead`` function initiates readahead to the pagecache. The ``iomap_read_folio`` function reads one folio's worth of data into the pagecache. The ``flags`` argument to ``->iomap_begin`` will be set to zero. The pagecache takes whatever locks it needs before calling the filesystem.h](hThe }(hj hhhNhNubj-)}(h``iomap_readahead``h]hiomap_readahead}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh4 function initiates readahead to the pagecache. The }(hj hhhNhNubj-)}(h``iomap_read_folio``h]hiomap_read_folio}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubhD function reads one folio’s worth of data into the pagecache. The }(hj hhhNhNubj-)}(h ``flags``h]hflags}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh argument to }(hj hhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hj0 hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh` will be set to zero. The pagecache takes whatever locks it needs before calling the filesystem.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubeh}(h]jah ]h"]buffered readahead and readsah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hBuffered Writesh]hBuffered Writes}(hjR hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjO hhhhhKubj)}(hX'The ``iomap_file_buffered_write`` function writes an ``iocb`` to the pagecache. ``IOMAP_WRITE`` or ``IOMAP_WRITE`` | ``IOMAP_NOWAIT`` will be passed as the ``flags`` argument to ``->iomap_begin``. Callers commonly take ``i_rwsem`` in either shared or exclusive mode before calling this function.h](hThe }(hj` hhhNhNubj-)}(h``iomap_file_buffered_write``h]hiomap_file_buffered_write}(hjh hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj` ubh function writes an }(hj` hhhNhNubj-)}(h``iocb``h]hiocb}(hjz hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj` ubh to the pagecache. }(hj` hhhNhNubj-)}(h``IOMAP_WRITE``h]h IOMAP_WRITE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj` ubh or }(hj` hhhNhNubj-)}(h``IOMAP_WRITE``h]h IOMAP_WRITE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj` ubh | }(hj` hhhNhNubj-)}(h``IOMAP_NOWAIT``h]h IOMAP_NOWAIT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj` ubh will be passed as the }(hj` hhhNhNubj-)}(h ``flags``h]hflags}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj` ubh argument to }(hj` hhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj` ubh. Callers commonly take }(hj` hhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj` ubhA in either shared or exclusive mode before calling this function.}(hj` hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhjO hhubh)}(hhh](h)}(hmmap Write Faultsh]hmmap Write Faults}(hj hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhj hhhhhKubj)}(hX The ``iomap_page_mkwrite`` function handles a write fault to a folio in the pagecache. ``IOMAP_WRITE | IOMAP_FAULT`` will be passed as the ``flags`` argument to ``->iomap_begin``. Callers commonly take the mmap ``invalidate_lock`` in shared or exclusive mode before calling this function.h](hThe }(hj hhhNhNubj-)}(h``iomap_page_mkwrite``h]hiomap_page_mkwrite}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh= function handles a write fault to a folio in the pagecache. }(hj hhhNhNubj-)}(h``IOMAP_WRITE | IOMAP_FAULT``h]hIOMAP_WRITE | IOMAP_FAULT}(hj) hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh will be passed as the }(hj hhhNhNubj-)}(h ``flags``h]hflags}(hj; hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh argument to }(hj hhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hjM hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh!. Callers commonly take the mmap }(hj hhhNhNubj-)}(h``invalidate_lock``h]hinvalidate_lock}(hj_ hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh: in shared or exclusive mode before calling this function.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubeh}(h]jah ]h"]mmap write faultsah$]h&]uh1hhjO hhhhhKubh)}(hhh](h)}(hBuffered Write Failuresh]hBuffered Write Failures}(hj hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhj~ hhhhhKubj)}(hX;After a short write to the pagecache, the areas not written will not become marked dirty. The filesystem must arrange to `cancel `_ such `reservations `_ because writeback will not consume the reservation. The ``iomap_write_delalloc_release`` can be called from a ``->iomap_end`` function to find all the clean areas of the folios caching a fresh (``IOMAP_F_NEW``) delalloc mapping. It takes the ``invalidate_lock``.h](hyAfter a short write to the pagecache, the areas not written will not become marked dirty. The filesystem must arrange to }(hj hhhNhNubj )}(hT`cancel `_h]hcancel}(hj hhhNhNubah}(h]h ]h"]h$]h&]namecanceljHhttps://lore.kernel.org/all/20221123055812.747923-6-david@fromorbit.com/uh1jhj ubh)}(hK h]h}(h]cancelah ]h"]cancelah$]h&]refurij uh1hj*Khj ubh such }(hj hhhNhNubj )}(ha`reservations `_h]h reservations}(hj hhhNhNubah}(h]h ]h"]h$]h&]name reservationsjOhttps://lore.kernel.org/linux-xfs/20220817093627.GZ3600936@dread.disaster.area/uh1jhj ubh)}(hR h]h}(h] reservationsah ]h"] reservationsah$]h&]refurij uh1hj*Khj ubh9 because writeback will not consume the reservation. The }(hj hhhNhNubj-)}(h ``iomap_write_delalloc_release``h]hiomap_write_delalloc_release}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh can be called from a }(hj hhhNhNubj-)}(h``->iomap_end``h]h ->iomap_end}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubhE function to find all the clean areas of the folios caching a fresh (}(hj hhhNhNubj-)}(h``IOMAP_F_NEW``h]h IOMAP_F_NEW}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh!) delalloc mapping. It takes the }(hj hhhNhNubj-)}(h``invalidate_lock``h]hinvalidate_lock}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj~ hhubj)}(hX:The filesystem must supply a function ``punch`` to be called for each file range in this state. This function must *only* remove delayed allocation reservations, in case another thread racing with the current thread writes successfully to the same region and triggers writeback to flush the dirty data out to disk.h](h&The filesystem must supply a function }(hj)hhhNhNubj-)}(h ``punch``h]hpunch}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj)ubhD to be called for each file range in this state. This function must }(hj)hhhNhNubjL )}(h*only*h]honly}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jK hj)ubh remove delayed allocation reservations, in case another thread racing with the current thread writes successfully to the same region and triggers writeback to flush the dirty data out to disk.}(hj)hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhj~ hhubeh}(h]jah ]h"]buffered write failuresah$]h&]uh1hhjO hhhhhKubh)}(hhh](h)}(hZeroing for File Operationsh]hZeroing for File Operations}(hjehhhNhNubah}(h]h ]h"]h$]h&]jj3uh1hhjbhhhhhKubj)}(hXSFilesystems can call ``iomap_zero_range`` to perform zeroing of the pagecache for non-truncation file operations that are not aligned to the fsblock size. ``IOMAP_ZERO`` will be passed as the ``flags`` argument to ``->iomap_begin``. Callers typically hold ``i_rwsem`` and ``invalidate_lock`` in exclusive mode before calling this function.h](hFilesystems can call }(hjshhhNhNubj-)}(h``iomap_zero_range``h]hiomap_zero_range}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjsubhr to perform zeroing of the pagecache for non-truncation file operations that are not aligned to the fsblock size. }(hjshhhNhNubj-)}(h``IOMAP_ZERO``h]h IOMAP_ZERO}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjsubh will be passed as the }(hjshhhNhNubj-)}(h ``flags``h]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjsubh argument to }(hjshhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjsubh. Callers typically hold }(hjshhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjsubh and }(hjshhhNhNubj-)}(h``invalidate_lock``h]hinvalidate_lock}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjsubh0 in exclusive mode before calling this function.}(hjshhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhjbhhubeh}(h]j9ah ]h"]zeroing for file operationsah$]h&]uh1hhjO hhhhhKubh)}(hhh](h)}(hUnsharing Reflinked File Datah]hUnsharing Reflinked File Data}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjUuh1hhjhhhhhKubj)}(hXgFilesystems can call ``iomap_file_unshare`` to force a file sharing storage with another file to preemptively copy the shared data to newly allocate storage. ``IOMAP_WRITE | IOMAP_UNSHARE`` will be passed as the ``flags`` argument to ``->iomap_begin``. Callers typically hold ``i_rwsem`` and ``invalidate_lock`` in exclusive mode before calling this function.h](hFilesystems can call }(hjhhhNhNubj-)}(h``iomap_file_unshare``h]hiomap_file_unshare}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhs to force a file sharing storage with another file to preemptively copy the shared data to newly allocate storage. }(hjhhhNhNubj-)}(h``IOMAP_WRITE | IOMAP_UNSHARE``h]hIOMAP_WRITE | IOMAP_UNSHARE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh will be passed as the }(hjhhhNhNubj-)}(h ``flags``h]hflags}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh argument to }(hjhhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh. Callers typically hold }(hjhhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh and }(hjhhhNhNubj-)}(h``invalidate_lock``h]hinvalidate_lock}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh0 in exclusive mode before calling this function.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubeh}(h]j[ah ]h"]unsharing reflinked file dataah$]h&]uh1hhjO hhhhhKubeh}(h]jah ]h"]buffered writesah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h Truncationh]h Truncation}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjhhhhhKubj)}(hXFilesystems can call ``iomap_truncate_page`` to zero the bytes in the pagecache from EOF to the end of the fsblock during a file truncation operation. ``truncate_setsize`` or ``truncate_pagecache`` will take care of everything after the EOF block. ``IOMAP_ZERO`` will be passed as the ``flags`` argument to ``->iomap_begin``. Callers typically hold ``i_rwsem`` and ``invalidate_lock`` in exclusive mode before calling this function.h](hFilesystems can call }(hjhhhNhNubj-)}(h``iomap_truncate_page``h]hiomap_truncate_page}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhk to zero the bytes in the pagecache from EOF to the end of the fsblock during a file truncation operation. }(hjhhhNhNubj-)}(h``truncate_setsize``h]htruncate_setsize}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh or }(hjhhhNhNubj-)}(h``truncate_pagecache``h]htruncate_pagecache}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh3 will take care of everything after the EOF block. }(hjhhhNhNubj-)}(h``IOMAP_ZERO``h]h IOMAP_ZERO}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh will be passed as the }(hjhhhNhNubj-)}(h ``flags``h]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh argument to }(hjhhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh. Callers typically hold }(hjhhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh and }(hjhhhNhNubj-)}(h``invalidate_lock``h]hinvalidate_lock}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh0 in exclusive mode before calling this function.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubeh}(h]jah ]h"] truncationah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hPagecache Writebackh]hPagecache Writeback}(hjFhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjChhhhhMubj)}(hXFilesystems can call ``iomap_writepages`` to respond to a request to write dirty pagecache folios to disk. The ``mapping`` and ``wbc`` parameters should be passed unchanged. The ``wpc`` pointer should be allocated by the filesystem and must be initialized to zero.h](hFilesystems can call }(hjThhhNhNubj-)}(h``iomap_writepages``h]hiomap_writepages}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjTubhF to respond to a request to write dirty pagecache folios to disk. The }(hjThhhNhNubj-)}(h ``mapping``h]hmapping}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjTubh and }(hjThhhNhNubj-)}(h``wbc``h]hwbc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjTubh, parameters should be passed unchanged. The }(hjThhhNhNubj-)}(h``wpc``h]hwpc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjTubhO pointer should be allocated by the filesystem and must be initialized to zero.}(hjThhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhM hjChhubj)}(hThe pagecache will lock each folio before trying to schedule it for writeback. It does not lock ``i_rwsem`` or ``invalidate_lock``.h](h`The pagecache will lock each folio before trying to schedule it for writeback. It does not lock }(hjhhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh or }(hjhhhNhNubj-)}(h``invalidate_lock``h]hinvalidate_lock}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjChhubj)}(hX The dirty bit will be cleared for all folios run through the ``->writeback_range`` machinery described below even if the writeback fails. This is to prevent dirty folio clots when storage devices fail; an ``-EIO`` is recorded for userspace to collect via ``fsync``.h](h=The dirty bit will be cleared for all folios run through the }(hjhhhNhNubj-)}(h``->writeback_range``h]h->writeback_range}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh{ machinery described below even if the writeback fails. This is to prevent dirty folio clots when storage devices fail; an }(hjhhhNhNubj-)}(h``-EIO``h]h-EIO}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh* is recorded for userspace to collect via }(hjhhhNhNubj-)}(h ``fsync``h]hfsync}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjChhubj)}(h:The ``ops`` structure must be specified and is as follows:h](hThe }(hj hhhNhNubj-)}(h``ops``h]hops}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh/ structure must be specified and is as follows:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjChhubh)}(hhh](h)}(hjh]j-)}(hjh]hstruct iomap_writeback_ops}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjCubah}(h]h ]h"]h$]h&]jjuh1hhj@hhhhhMubj)}(hstruct iomap_writeback_ops { int (*writeback_range)(struct iomap_writepage_ctx *wpc, struct folio *folio, u64 pos, unsigned int len, u64 end_pos); int (*writeback_submit)(struct iomap_writepage_ctx *wpc, int error); };h]hstruct iomap_writeback_ops { int (*writeback_range)(struct iomap_writepage_ctx *wpc, struct folio *folio, u64 pos, unsigned int len, u64 end_pos); int (*writeback_submit)(struct iomap_writepage_ctx *wpc, int error); };}hjYsbah}(h]h ]h"]h$]h&]hhjjjj}uh1jhhhMhj@hhubj)}(hThe fields are as follows:h]hThe fields are as follows:}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM%hj@hhubj<)}(hXk- ``writeback_range``: Sets ``wpc->iomap`` to the space mapping of the file range (in bytes) given by ``offset`` and ``len``. iomap calls this function for each dirty fs block in each dirty folio, though it will `reuse mappings `_ for runs of contiguous dirty fsblocks within a folio. Do not return ``IOMAP_INLINE`` mappings here; the ``->iomap_end`` function must deal with persisting written data. Do not return ``IOMAP_DELALLOC`` mappings here; iomap currently requires mapping to allocated space. Filesystems can skip a potentially expensive mapping lookup if the mappings have not changed. This revalidation must be open-coded by the filesystem; it is unclear if ``iomap::validity_cookie`` can be reused for this purpose. If this methods fails to schedule I/O for any part of a dirty folio, it should throw away any reservations that may have been made for the write. The folio will be marked clean and an ``-EIO`` recorded in the pagecache. Filesystems can use this callback to `remove `_ delalloc reservations to avoid having delalloc reservations for clean pagecache. This function must be supplied by the filesystem. - ``writeback_submit``: Submit the previous built writeback context. Block based file systems should use the iomap_ioend_writeback_submit helper, other file system can implement their own. File systems can optionall to hook into writeback bio submission. This might include pre-write space accounting updates, or installing a custom ``->bi_end_io`` function for internal purposes, such as deferring the ioend completion to a workqueue to run metadata update transactions from process context before submitting the bio. This function must be supplied by the filesystem. h]h)}(hhh](h)}(hX``writeback_range``: Sets ``wpc->iomap`` to the space mapping of the file range (in bytes) given by ``offset`` and ``len``. iomap calls this function for each dirty fs block in each dirty folio, though it will `reuse mappings `_ for runs of contiguous dirty fsblocks within a folio. Do not return ``IOMAP_INLINE`` mappings here; the ``->iomap_end`` function must deal with persisting written data. Do not return ``IOMAP_DELALLOC`` mappings here; iomap currently requires mapping to allocated space. Filesystems can skip a potentially expensive mapping lookup if the mappings have not changed. This revalidation must be open-coded by the filesystem; it is unclear if ``iomap::validity_cookie`` can be reused for this purpose. If this methods fails to schedule I/O for any part of a dirty folio, it should throw away any reservations that may have been made for the write. The folio will be marked clean and an ``-EIO`` recorded in the pagecache. Filesystems can use this callback to `remove `_ delalloc reservations to avoid having delalloc reservations for clean pagecache. This function must be supplied by the filesystem. h](j)}(hX``writeback_range``: Sets ``wpc->iomap`` to the space mapping of the file range (in bytes) given by ``offset`` and ``len``. iomap calls this function for each dirty fs block in each dirty folio, though it will `reuse mappings `_ for runs of contiguous dirty fsblocks within a folio. Do not return ``IOMAP_INLINE`` mappings here; the ``->iomap_end`` function must deal with persisting written data. Do not return ``IOMAP_DELALLOC`` mappings here; iomap currently requires mapping to allocated space. Filesystems can skip a potentially expensive mapping lookup if the mappings have not changed. This revalidation must be open-coded by the filesystem; it is unclear if ``iomap::validity_cookie`` can be reused for this purpose.h](j-)}(h``writeback_range``h]hwriteback_range}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh: Sets }(hjhhhNhNubj-)}(h``wpc->iomap``h]h wpc->iomap}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh< to the space mapping of the file range (in bytes) given by }(hjhhhNhNubj-)}(h ``offset``h]hoffset}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh and }(hjhhhNhNubj-)}(h``len``h]hlen}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhX. iomap calls this function for each dirty fs block in each dirty folio, though it will }(hjhhhNhNubj )}(hT`reuse mappings `_h]hreuse mappings}(hjhhhNhNubah}(h]h ]h"]h$]h&]namereuse mappingsj@https://lore.kernel.org/all/20231207072710.176093-15-hch@lst.de/uh1jhjubh)}(hC h]h}(h]reuse-mappingsah ]h"]reuse mappingsah$]h&]refurijuh1hj*KhjubhE for runs of contiguous dirty fsblocks within a folio. Do not return }(hjhhhNhNubj-)}(h``IOMAP_INLINE``h]h IOMAP_INLINE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh mappings here; the }(hjhhhNhNubj-)}(h``->iomap_end``h]h ->iomap_end}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh@ function must deal with persisting written data. Do not return }(hjhhhNhNubj-)}(h``IOMAP_DELALLOC``h]hIOMAP_DELALLOC}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh mappings here; iomap currently requires mapping to allocated space. Filesystems can skip a potentially expensive mapping lookup if the mappings have not changed. This revalidation must be open-coded by the filesystem; it is unclear if }(hjhhhNhNubj-)}(h``iomap::validity_cookie``h]hiomap::validity_cookie}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh can be reused for this purpose.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhM'hj}ubj)}(hXIf this methods fails to schedule I/O for any part of a dirty folio, it should throw away any reservations that may have been made for the write. The folio will be marked clean and an ``-EIO`` recorded in the pagecache. Filesystems can use this callback to `remove `_ delalloc reservations to avoid having delalloc reservations for clean pagecache. This function must be supplied by the filesystem.h](hIf this methods fails to schedule I/O for any part of a dirty folio, it should throw away any reservations that may have been made for the write. The folio will be marked clean and an }(hj=hhhNhNubj-)}(h``-EIO``h]h-EIO}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj=ubhA recorded in the pagecache. Filesystems can use this callback to }(hj=hhhNhNubj )}(hT`remove `_h]hremove}(hjWhhhNhNubah}(h]h ]h"]h$]h&]nameremovejHhttps://lore.kernel.org/all/20201029163313.1766967-1-bfoster@redhat.com/uh1jhj=ubh)}(hK h]h}(h]removeah ]h"]removeah$]h&]refurijguh1hj*Khj=ubh delalloc reservations to avoid having delalloc reservations for clean pagecache. This function must be supplied by the filesystem.}(hj=hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhM7hj}ubeh}(h]h ]h"]h$]h&]uh1hhjzubh)}(hX7``writeback_submit``: Submit the previous built writeback context. Block based file systems should use the iomap_ioend_writeback_submit helper, other file system can implement their own. File systems can optionall to hook into writeback bio submission. This might include pre-write space accounting updates, or installing a custom ``->bi_end_io`` function for internal purposes, such as deferring the ioend completion to a workqueue to run metadata update transactions from process context before submitting the bio. This function must be supplied by the filesystem. h]j)}(hX6``writeback_submit``: Submit the previous built writeback context. Block based file systems should use the iomap_ioend_writeback_submit helper, other file system can implement their own. File systems can optionall to hook into writeback bio submission. This might include pre-write space accounting updates, or installing a custom ``->bi_end_io`` function for internal purposes, such as deferring the ioend completion to a workqueue to run metadata update transactions from process context before submitting the bio. This function must be supplied by the filesystem.h](j-)}(h``writeback_submit``h]hwriteback_submit}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhX7: Submit the previous built writeback context. Block based file systems should use the iomap_ioend_writeback_submit helper, other file system can implement their own. File systems can optionall to hook into writeback bio submission. This might include pre-write space accounting updates, or installing a custom }(hjhhhNhNubj-)}(h``->bi_end_io``h]h ->bi_end_io}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh function for internal purposes, such as deferring the ioend completion to a workqueue to run metadata update transactions from process context before submitting the bio. This function must be supplied by the filesystem.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMAhjubah}(h]h ]h"]h$]h&]uh1hhjzubeh}(h]h ]h"]h$]h&]jj- uh1hhhhM'hjvubah}(h]h ]h"]h$]h&]uh1j;hhhM'hj@hhubeh}(h]jah ]h"]struct iomap_writeback_opsah$]h&]uh1hhjChhhhhMubh)}(hhh](h)}(hPagecache Writeback Completionh]hPagecache Writeback Completion}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjhhhhhMLubj)}(hXTo handle the bookkeeping that must happen after disk I/O for writeback completes, iomap creates chains of ``struct iomap_ioend`` objects that wrap the ``bio`` that is used to write pagecache data to disk. By default, iomap finishes writeback ioends by clearing the writeback bit on the folios attached to the ``ioend``. If the write failed, it will also set the error bits on the folios and the address space. This can happen in interrupt or process context, depending on the storage device. Filesystems that need to update internal bookkeeping (e.g. unwritten extent conversions) should set their own bi_end_io on the bios submitted by ``->submit_writeback`` This function should call ``iomap_finish_ioends`` after finishing its own work (e.g. unwritten extent conversion).h](hkTo handle the bookkeeping that must happen after disk I/O for writeback completes, iomap creates chains of }(hjhhhNhNubj-)}(h``struct iomap_ioend``h]hstruct iomap_ioend}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh objects that wrap the }(hjhhhNhNubj-)}(h``bio``h]hbio}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh that is used to write pagecache data to disk. By default, iomap finishes writeback ioends by clearing the writeback bit on the folios attached to the }(hjhhhNhNubj-)}(h ``ioend``h]hioend}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhX?. If the write failed, it will also set the error bits on the folios and the address space. This can happen in interrupt or process context, depending on the storage device. Filesystems that need to update internal bookkeeping (e.g. unwritten extent conversions) should set their own bi_end_io on the bios submitted by }(hjhhhNhNubj-)}(h``->submit_writeback``h]h->submit_writeback}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh This function should call }(hjhhhNhNubj-)}(h``iomap_finish_ioends``h]hiomap_finish_ioends}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhA after finishing its own work (e.g. unwritten extent conversion).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMNhjhhubj)}(hXqSome filesystems may wish to `amortize the cost of running metadata transactions `_ for post-writeback updates by batching them. They may also require transactions to run from process context, which implies punting batches to a workqueue. iomap ioends contain a ``list_head`` to enable batching.h](hSome filesystems may wish to }(hjIhhhNhNubj )}(h`amortize the cost of running metadata transactions `_h]h2amortize the cost of running metadata transactions}(hjQhhhNhNubah}(h]h ]h"]h$]h&]name2amortize the cost of running metadata transactionsjHhttps://lore.kernel.org/all/20220120034733.221737-1-david@fromorbit.com/uh1jhjIubh)}(hK h]h}(h]2amortize-the-cost-of-running-metadata-transactionsah ]h"]2amortize the cost of running metadata transactionsah$]h&]refurijauh1hj*KhjIubh for post-writeback updates by batching them. They may also require transactions to run from process context, which implies punting batches to a workqueue. iomap ioends contain a }(hjIhhhNhNubj-)}(h ``list_head``h]h list_head}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjIubh to enable batching.}(hjIhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhM]hjhhubj)}(hMGiven a batch of ioends, iomap has a few helpers to assist with amortization:h]hMGiven a batch of ioends, iomap has a few helpers to assist with amortization:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMehjhhubj<)}(hX9* ``iomap_sort_ioends``: Sort all the ioends in the list by file offset. * ``iomap_ioend_try_merge``: Given an ioend that is not in any list and a separate list of sorted ioends, merge as many of the ioends from the head of the list into the given ioend. ioends can only be merged if the file range and storage addresses are contiguous; the unwritten and shared status are the same; and the write I/O outcome is the same. The merged ioends become their own list. * ``iomap_finish_ioends``: Finish an ioend that possibly has other ioends linked to it. h]h)}(hhh](h)}(hG``iomap_sort_ioends``: Sort all the ioends in the list by file offset. h]j)}(hF``iomap_sort_ioends``: Sort all the ioends in the list by file offset.h](j-)}(h``iomap_sort_ioends``h]hiomap_sort_ioends}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh1: Sort all the ioends in the list by file offset.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hX``iomap_ioend_try_merge``: Given an ioend that is not in any list and a separate list of sorted ioends, merge as many of the ioends from the head of the list into the given ioend. ioends can only be merged if the file range and storage addresses are contiguous; the unwritten and shared status are the same; and the write I/O outcome is the same. The merged ioends become their own list. h]j)}(hX``iomap_ioend_try_merge``: Given an ioend that is not in any list and a separate list of sorted ioends, merge as many of the ioends from the head of the list into the given ioend. ioends can only be merged if the file range and storage addresses are contiguous; the unwritten and shared status are the same; and the write I/O outcome is the same. The merged ioends become their own list.h](j-)}(h``iomap_ioend_try_merge``h]hiomap_ioend_try_merge}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhXj: Given an ioend that is not in any list and a separate list of sorted ioends, merge as many of the ioends from the head of the list into the given ioend. ioends can only be merged if the file range and storage addresses are contiguous; the unwritten and shared status are the same; and the write I/O outcome is the same. The merged ioends become their own list.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMkhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hV``iomap_finish_ioends``: Finish an ioend that possibly has other ioends linked to it. h]j)}(hU``iomap_finish_ioends``: Finish an ioend that possibly has other ioends linked to it.h](j-)}(h``iomap_finish_ioends``h]hiomap_finish_ioends}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh>: Finish an ioend that possibly has other ioends linked to it.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMshjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jjuh1hhhhMhhjubah}(h]h ]h"]h$]h&]uh1j;hhhMhhjhhubeh}(h]jah ]h"]pagecache writeback completionah$]h&]uh1hhjChhhhhMLubeh}(h]jah ]h"]pagecache writebackah$]h&]uh1hhjhhhhhMubeh}(h]jah ]h"] buffered i/oah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Direct I/Oh]h Direct I/O}(hj6hhhNhNubah}(h]h ]h"]h$]h&]jj*uh1hhj3hhhhhMwubj)}(hIn Linux, direct I/O is defined as file I/O that is issued directly to storage, bypassing the pagecache. The ``iomap_dio_rw`` function implements O_DIRECT (direct I/O) reads and writes for files.h](hmIn Linux, direct I/O is defined as file I/O that is issued directly to storage, bypassing the pagecache. The }(hjDhhhNhNubj-)}(h``iomap_dio_rw``h]h iomap_dio_rw}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjDubhF function implements O_DIRECT (direct I/O) reads and writes for files.}(hjDhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMyhj3hhubj)}(hXssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, const struct iomap_ops *ops, const struct iomap_dio_ops *dops, unsigned int dio_flags, void *private, size_t done_before);h]hXssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, const struct iomap_ops *ops, const struct iomap_dio_ops *dops, unsigned int dio_flags, void *private, size_t done_before);}hjdsbah}(h]h ]h"]h$]h&]hhjjjj}uh1jhhhM~hj3hhubj)}(hXThe filesystem can provide the ``dops`` parameter if it needs to perform extra work before or after the I/O is issued to storage. The ``done_before`` parameter tells the how much of the request has already been transferred. It is used to continue a request asynchronously when `part of the request `_ has already been completed synchronously.h](hThe filesystem can provide the }(hjshhhNhNubj-)}(h``dops``h]hdops}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjsubh_ parameter if it needs to perform extra work before or after the I/O is issued to storage. The }(hjshhhNhNubj-)}(h``done_before``h]h done_before}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjsubh parameter tells the how much of the request has already been transferred. It is used to continue a request asynchronously when }(hjshhhNhNubj )}(h`part of the request `_h]hpart of the request}(hjhhhNhNubah}(h]h ]h"]h$]h&]namepart of the requestjvhttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c03098d4b9ad76bca2966a8769dcfe59f7f85103uh1jhjsubh)}(hy h]h}(h]part-of-the-requestah ]h"]part of the requestah$]h&]refurijuh1hj*Khjsubh* has already been completed synchronously.}(hjshhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj3hhubj)}(hThe ``done_before`` parameter should be set if writes for the ``iocb`` have been initiated prior to the call. The direction of the I/O is determined from the ``iocb`` passed in.h](hThe }(hjhhhNhNubj-)}(h``done_before``h]h done_before}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh+ parameter should be set if writes for the }(hjhhhNhNubj-)}(h``iocb``h]hiocb}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhX have been initiated prior to the call. The direction of the I/O is determined from the }(hjhhhNhNubj-)}(h``iocb``h]hiocb}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh passed in.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj3hhubj)}(hQThe ``dio_flags`` argument can be set to any combination of the following values:h](hThe }(hj hhhNhNubj-)}(h ``dio_flags``h]h dio_flags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh@ argument can be set to any combination of the following values:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj3hhubj<)}(hXo* ``IOMAP_DIO_FORCE_WAIT``: Wait for the I/O to complete even if the kiocb is not synchronous. * ``IOMAP_DIO_OVERWRITE_ONLY``: Perform a pure overwrite for this range or fail with ``-EAGAIN``. This can be used by filesystems with complex unaligned I/O write paths to provide an optimised fast path for unaligned writes. If a pure overwrite can be performed, then serialisation against other I/Os to the same filesystem block(s) is unnecessary as there is no risk of stale data exposure or data loss. If a pure overwrite cannot be performed, then the filesystem can perform the serialisation steps needed to provide exclusive access to the unaligned I/O range so that it can perform allocation and sub-block zeroing safely. Filesystems can use this flag to try to reduce locking contention, but a lot of `detailed checking `_ is required to do it `correctly `_. * ``IOMAP_DIO_PARTIAL``: If a page fault occurs, return whatever progress has already been made. The caller may deal with the page fault and retry the operation. If the caller decides to retry the operation, it should pass the accumulated return values of all previous calls as the ``done_before`` parameter to the next call. h]h)}(hhh](h)}(h]``IOMAP_DIO_FORCE_WAIT``: Wait for the I/O to complete even if the kiocb is not synchronous. h]j)}(h\``IOMAP_DIO_FORCE_WAIT``: Wait for the I/O to complete even if the kiocb is not synchronous.h](j-)}(h``IOMAP_DIO_FORCE_WAIT``h]hIOMAP_DIO_FORCE_WAIT}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj6ubhD: Wait for the I/O to complete even if the kiocb is not synchronous.}(hj6hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj2ubah}(h]h ]h"]h$]h&]uh1hhj/ubh)}(hX``IOMAP_DIO_OVERWRITE_ONLY``: Perform a pure overwrite for this range or fail with ``-EAGAIN``. This can be used by filesystems with complex unaligned I/O write paths to provide an optimised fast path for unaligned writes. If a pure overwrite can be performed, then serialisation against other I/Os to the same filesystem block(s) is unnecessary as there is no risk of stale data exposure or data loss. If a pure overwrite cannot be performed, then the filesystem can perform the serialisation steps needed to provide exclusive access to the unaligned I/O range so that it can perform allocation and sub-block zeroing safely. Filesystems can use this flag to try to reduce locking contention, but a lot of `detailed checking `_ is required to do it `correctly `_. h]j)}(hX``IOMAP_DIO_OVERWRITE_ONLY``: Perform a pure overwrite for this range or fail with ``-EAGAIN``. This can be used by filesystems with complex unaligned I/O write paths to provide an optimised fast path for unaligned writes. If a pure overwrite can be performed, then serialisation against other I/Os to the same filesystem block(s) is unnecessary as there is no risk of stale data exposure or data loss. If a pure overwrite cannot be performed, then the filesystem can perform the serialisation steps needed to provide exclusive access to the unaligned I/O range so that it can perform allocation and sub-block zeroing safely. Filesystems can use this flag to try to reduce locking contention, but a lot of `detailed checking `_ is required to do it `correctly `_.h](j-)}(h``IOMAP_DIO_OVERWRITE_ONLY``h]hIOMAP_DIO_OVERWRITE_ONLY}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj\ubh7: Perform a pure overwrite for this range or fail with }(hj\hhhNhNubj-)}(h ``-EAGAIN``h]h-EAGAIN}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj\ubhXd. This can be used by filesystems with complex unaligned I/O write paths to provide an optimised fast path for unaligned writes. If a pure overwrite can be performed, then serialisation against other I/Os to the same filesystem block(s) is unnecessary as there is no risk of stale data exposure or data loss. If a pure overwrite cannot be performed, then the filesystem can perform the serialisation steps needed to provide exclusive access to the unaligned I/O range so that it can perform allocation and sub-block zeroing safely. Filesystems can use this flag to try to reduce locking contention, but a lot of }(hj\hhhNhNubj )}(he`detailed checking `_h]hdetailed checking}(hjhhhNhNubah}(h]h ]h"]h$]h&]namedetailed checkingjNhttps://lore.kernel.org/linux-ext4/20230314130759.642710-1-bfoster@redhat.com/uh1jhj\ubh)}(hQ h]h}(h]detailed-checkingah ]h"]detailed checkingah$]h&]refurijuh1hj*Khj\ubh is required to do it }(hj\hhhNhNubj )}(h]`correctly `_h]h correctly}(hjhhhNhNubah}(h]h ]h"]h$]h&]name correctlyjNhttps://lore.kernel.org/linux-ext4/20230810165559.946222-1-bfoster@redhat.com/uh1jhj\ubh)}(hQ h]h}(h] correctlyah ]h"] correctlyah$]h&]refurijuh1hj*Khj\ubh.}(hj\hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjXubah}(h]h ]h"]h$]h&]uh1hhj/ubh)}(hXD``IOMAP_DIO_PARTIAL``: If a page fault occurs, return whatever progress has already been made. The caller may deal with the page fault and retry the operation. If the caller decides to retry the operation, it should pass the accumulated return values of all previous calls as the ``done_before`` parameter to the next call. h]j)}(hXC``IOMAP_DIO_PARTIAL``: If a page fault occurs, return whatever progress has already been made. The caller may deal with the page fault and retry the operation. If the caller decides to retry the operation, it should pass the accumulated return values of all previous calls as the ``done_before`` parameter to the next call.h](j-)}(h``IOMAP_DIO_PARTIAL``h]hIOMAP_DIO_PARTIAL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhX: If a page fault occurs, return whatever progress has already been made. The caller may deal with the page fault and retry the operation. If the caller decides to retry the operation, it should pass the accumulated return values of all previous calls as the }(hjhhhNhNubj-)}(h``done_before``h]h done_before}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh parameter to the next call.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1hhj/ubeh}(h]h ]h"]h$]h&]jjuh1hhhhMhj+ubah}(h]h ]h"]h$]h&]uh1j;hhhMhj3hhubj)}(hGThese ``struct kiocb`` flags are significant for direct I/O with iomap:h](hThese }(hjhhhNhNubj-)}(h``struct kiocb``h]h struct kiocb}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh1 flags are significant for direct I/O with iomap:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj3hhubj<)}(hX * ``IOCB_NOWAIT``: Turns on ``IOMAP_NOWAIT``. * ``IOCB_SYNC``: Ensure that the device has persisted data to disk before completing the call. In the case of pure overwrites, the I/O may be issued with FUA enabled. * ``IOCB_HIPRI``: Poll for I/O completion instead of waiting for an interrupt. Only meaningful for asynchronous I/O, and only if the entire I/O can be issued as a single ``struct bio``. * ``IOCB_DIO_CALLER_COMP``: Try to run I/O completion from the caller's process context. See ``linux/fs.h`` for more details. h]h)}(hhh](h)}(h,``IOCB_NOWAIT``: Turns on ``IOMAP_NOWAIT``. h]j)}(h+``IOCB_NOWAIT``: Turns on ``IOMAP_NOWAIT``.h](j-)}(h``IOCB_NOWAIT``h]h IOCB_NOWAIT}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjCubh : Turns on }(hjChhhNhNubj-)}(h``IOMAP_NOWAIT``h]h IOMAP_NOWAIT}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjCubh.}(hjChhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj?ubah}(h]h ]h"]h$]h&]uh1hhj<ubh)}(h``IOCB_SYNC``: Ensure that the device has persisted data to disk before completing the call. In the case of pure overwrites, the I/O may be issued with FUA enabled. h]j)}(h``IOCB_SYNC``: Ensure that the device has persisted data to disk before completing the call. In the case of pure overwrites, the I/O may be issued with FUA enabled.h](j-)}(h ``IOCB_SYNC``h]h IOCB_SYNC}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj{ubh: Ensure that the device has persisted data to disk before completing the call. In the case of pure overwrites, the I/O may be issued with FUA enabled.}(hj{hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjwubah}(h]h ]h"]h$]h&]uh1hhj<ubh)}(h``IOCB_HIPRI``: Poll for I/O completion instead of waiting for an interrupt. Only meaningful for asynchronous I/O, and only if the entire I/O can be issued as a single ``struct bio``. h]j)}(h``IOCB_HIPRI``: Poll for I/O completion instead of waiting for an interrupt. Only meaningful for asynchronous I/O, and only if the entire I/O can be issued as a single ``struct bio``.h](j-)}(h``IOCB_HIPRI``h]h IOCB_HIPRI}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh: Poll for I/O completion instead of waiting for an interrupt. Only meaningful for asynchronous I/O, and only if the entire I/O can be issued as a single }(hjhhhNhNubj-)}(h``struct bio``h]h struct bio}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1hhj<ubh)}(h|``IOCB_DIO_CALLER_COMP``: Try to run I/O completion from the caller's process context. See ``linux/fs.h`` for more details. h]j)}(h{``IOCB_DIO_CALLER_COMP``: Try to run I/O completion from the caller's process context. See ``linux/fs.h`` for more details.h](j-)}(h``IOCB_DIO_CALLER_COMP``h]hIOCB_DIO_CALLER_COMP}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhE: Try to run I/O completion from the caller’s process context. See }(hjhhhNhNubj-)}(h``linux/fs.h``h]h linux/fs.h}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh for more details.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1hhj<ubeh}(h]h ]h"]h$]h&]jjuh1hhhhMhj8ubah}(h]h ]h"]h$]h&]uh1j;hhhMhj3hhubj)}(hFilesystems should call ``iomap_dio_rw`` from ``->read_iter`` and ``->write_iter``, and set ``FMODE_CAN_ODIRECT`` in the ``->open`` function for the file. They should not set ``->direct_IO``, which is deprecated.h](hFilesystems should call }(hjhhhNhNubj-)}(h``iomap_dio_rw``h]h iomap_dio_rw}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh from }(hjhhhNhNubj-)}(h``->read_iter``h]h ->read_iter}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh and }(hjhhhNhNubj-)}(h``->write_iter``h]h ->write_iter}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh , and set }(hjhhhNhNubj-)}(h``FMODE_CAN_ODIRECT``h]hFMODE_CAN_ODIRECT}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh in the }(hjhhhNhNubj-)}(h ``->open``h]h->open}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh, function for the file. They should not set }(hjhhhNhNubj-)}(h``->direct_IO``h]h ->direct_IO}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh, which is deprecated.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj3hhubj)}(hXIf a filesystem wishes to perform its own work before direct I/O completion, it should call ``__iomap_dio_rw``. If its return value is not an error pointer or a NULL pointer, the filesystem should pass the return value to ``iomap_dio_complete`` after finishing its internal work.h](h\If a filesystem wishes to perform its own work before direct I/O completion, it should call }(hjhhhNhNubj-)}(h``__iomap_dio_rw``h]h__iomap_dio_rw}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhp. If its return value is not an error pointer or a NULL pointer, the filesystem should pass the return value to }(hjhhhNhNubj-)}(h``iomap_dio_complete``h]hiomap_dio_complete}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh# after finishing its internal work.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj3hhubh)}(hhh](h)}(h Return Valuesh]h Return Values}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjIuh1hhjhhhhhMubj)}(h1``iomap_dio_rw`` can return one of the following:h](j-)}(h``iomap_dio_rw``h]h iomap_dio_rw}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh! can return one of the following:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjhhubj<)}(hX* A non-negative number of bytes transferred. * ``-ENOTBLK``: Fall back to buffered I/O. iomap itself will return this value if it cannot invalidate the page cache before issuing the I/O to storage. The ``->iomap_begin`` or ``->iomap_end`` functions may also return this value. * ``-EIOCBQUEUED``: The asynchronous direct I/O request has been queued and will be completed separately. * Any of the other negative error codes. h]h)}(hhh](h)}(h,A non-negative number of bytes transferred. h]j)}(h+A non-negative number of bytes transferred.h]h+A non-negative number of bytes transferred.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(h``-ENOTBLK``: Fall back to buffered I/O. iomap itself will return this value if it cannot invalidate the page cache before issuing the I/O to storage. The ``->iomap_begin`` or ``->iomap_end`` functions may also return this value. h]j)}(h``-ENOTBLK``: Fall back to buffered I/O. iomap itself will return this value if it cannot invalidate the page cache before issuing the I/O to storage. The ``->iomap_begin`` or ``->iomap_end`` functions may also return this value.h](j-)}(h ``-ENOTBLK``h]h-ENOTBLK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh: Fall back to buffered I/O. iomap itself will return this value if it cannot invalidate the page cache before issuing the I/O to storage. The }(hjhhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh or }(hjhhhNhNubj-)}(h``->iomap_end``h]h ->iomap_end}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh& functions may also return this value.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hh``-EIOCBQUEUED``: The asynchronous direct I/O request has been queued and will be completed separately. h]j)}(hg``-EIOCBQUEUED``: The asynchronous direct I/O request has been queued and will be completed separately.h](j-)}(h``-EIOCBQUEUED``h]h -EIOCBQUEUED}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj_ubhW: The asynchronous direct I/O request has been queued and will be completed separately.}(hj_hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj[ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(h'Any of the other negative error codes. h]j)}(h&Any of the other negative error codes.h]h&Any of the other negative error codes.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jjuh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j;hhhMhjhhubeh}(h]jOah ]h"] return valuesah$]h&]uh1hhj3hhhhhMubh)}(hhh](h)}(h Direct Readsh]h Direct Reads}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjkuh1hhjhhhhhMubj)}(hX A direct I/O read initiates a read I/O from the storage device to the caller's buffer. Dirty parts of the pagecache are flushed to storage before initiating the read io. The ``flags`` value for ``->iomap_begin`` will be ``IOMAP_DIRECT`` with any combination of the following enhancements:h](hA direct I/O read initiates a read I/O from the storage device to the caller’s buffer. Dirty parts of the pagecache are flushed to storage before initiating the read io. The }(hjhhhNhNubj-)}(h ``flags``h]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh value for }(hjhhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh will be }(hjhhhNhNubj-)}(h``IOMAP_DIRECT``h]h IOMAP_DIRECT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh4 with any combination of the following enhancements:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjhhubj<)}(h+* ``IOMAP_NOWAIT``, as defined previously. h]h)}(hhh]h)}(h)``IOMAP_NOWAIT``, as defined previously. h]j)}(h(``IOMAP_NOWAIT``, as defined previously.h](j-)}(h``IOMAP_NOWAIT``h]h IOMAP_NOWAIT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh, as defined previously.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]jjuh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j;hhhMhjhhubj)}(hNCallers commonly hold ``i_rwsem`` in shared mode before calling this function.h](hCallers commonly hold }(hj:hhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj:ubh- in shared mode before calling this function.}(hj:hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjhhubeh}(h]jqah ]h"] direct readsah$]h&]uh1hhj3hhhhhMubh)}(hhh](h)}(h Direct Writesh]h Direct Writes}(hjdhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjahhhhhMubj)}(hXrA direct I/O write initiates a write I/O to the storage device from the caller's buffer. Dirty parts of the pagecache are flushed to storage before initiating the write io. The pagecache is invalidated both before and after the write io. The ``flags`` value for ``->iomap_begin`` will be ``IOMAP_DIRECT | IOMAP_WRITE`` with any combination of the following enhancements:h](hA direct I/O write initiates a write I/O to the storage device from the caller’s buffer. Dirty parts of the pagecache are flushed to storage before initiating the write io. The pagecache is invalidated both before and after the write io. The }(hjrhhhNhNubj-)}(h ``flags``h]hflags}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjrubh value for }(hjrhhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjrubh will be }(hjrhhhNhNubj-)}(h``IOMAP_DIRECT | IOMAP_WRITE``h]hIOMAP_DIRECT | IOMAP_WRITE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjrubh4 with any combination of the following enhancements:}(hjrhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjahhubj<)}(hX|* ``IOMAP_NOWAIT``, as defined previously. * ``IOMAP_OVERWRITE_ONLY``: Allocating blocks and zeroing partial blocks is not allowed. The entire file range must map to a single written or unwritten extent. The file I/O range must be aligned to the filesystem block size if the mapping is unwritten and the filesystem cannot handle zeroing the unaligned regions without exposing stale contents. * ``IOMAP_ATOMIC``: This write is being issued with torn-write protection. Torn-write protection may be provided based on HW-offload or by a software mechanism provided by the filesystem. For HW-offload based support, only a single bio can be created for the write, and the write must not be split into multiple I/O requests, i.e. flag REQ_ATOMIC must be set. The file range to write must be aligned to satisfy the requirements of both the filesystem and the underlying block device's atomic commit capabilities. If filesystem metadata updates are required (e.g. unwritten extent conversion or copy-on-write), all updates for the entire file range must be committed atomically as well. Untorn-writes may be longer than a single file block. In all cases, the mapping start disk block must have at least the same alignment as the write offset. The filesystems must set IOMAP_F_ATOMIC_BIO to inform iomap core of an untorn-write based on HW-offload. For untorn-writes based on a software mechanism provided by the filesystem, all the disk block alignment and single bio restrictions which apply for HW-offload based untorn-writes do not apply. The mechanism would typically be used as a fallback for when HW-offload based untorn-writes may not be issued, e.g. the range of the write covers multiple extents, meaning that it is not possible to issue a single bio. All filesystem metadata updates for the entire file range must be committed atomically as well. h]h)}(hhh](h)}(h)``IOMAP_NOWAIT``, as defined previously. h]j)}(h(``IOMAP_NOWAIT``, as defined previously.h](j-)}(h``IOMAP_NOWAIT``h]h IOMAP_NOWAIT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh, as defined previously.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hX[``IOMAP_OVERWRITE_ONLY``: Allocating blocks and zeroing partial blocks is not allowed. The entire file range must map to a single written or unwritten extent. The file I/O range must be aligned to the filesystem block size if the mapping is unwritten and the filesystem cannot handle zeroing the unaligned regions without exposing stale contents. h]j)}(hXZ``IOMAP_OVERWRITE_ONLY``: Allocating blocks and zeroing partial blocks is not allowed. The entire file range must map to a single written or unwritten extent. The file I/O range must be aligned to the filesystem block size if the mapping is unwritten and the filesystem cannot handle zeroing the unaligned regions without exposing stale contents.h](j-)}(h``IOMAP_OVERWRITE_ONLY``h]hIOMAP_OVERWRITE_ONLY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhXB: Allocating blocks and zeroing partial blocks is not allowed. The entire file range must map to a single written or unwritten extent. The file I/O range must be aligned to the filesystem block size if the mapping is unwritten and the filesystem cannot handle zeroing the unaligned regions without exposing stale contents.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hX``IOMAP_ATOMIC``: This write is being issued with torn-write protection. Torn-write protection may be provided based on HW-offload or by a software mechanism provided by the filesystem. For HW-offload based support, only a single bio can be created for the write, and the write must not be split into multiple I/O requests, i.e. flag REQ_ATOMIC must be set. The file range to write must be aligned to satisfy the requirements of both the filesystem and the underlying block device's atomic commit capabilities. If filesystem metadata updates are required (e.g. unwritten extent conversion or copy-on-write), all updates for the entire file range must be committed atomically as well. Untorn-writes may be longer than a single file block. In all cases, the mapping start disk block must have at least the same alignment as the write offset. The filesystems must set IOMAP_F_ATOMIC_BIO to inform iomap core of an untorn-write based on HW-offload. For untorn-writes based on a software mechanism provided by the filesystem, all the disk block alignment and single bio restrictions which apply for HW-offload based untorn-writes do not apply. The mechanism would typically be used as a fallback for when HW-offload based untorn-writes may not be issued, e.g. the range of the write covers multiple extents, meaning that it is not possible to issue a single bio. All filesystem metadata updates for the entire file range must be committed atomically as well. h](j)}(h``IOMAP_ATOMIC``: This write is being issued with torn-write protection. Torn-write protection may be provided based on HW-offload or by a software mechanism provided by the filesystem.h](j-)}(h``IOMAP_ATOMIC``h]h IOMAP_ATOMIC}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh: This write is being issued with torn-write protection. Torn-write protection may be provided based on HW-offload or by a software mechanism provided by the filesystem.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj ubj)}(hXFor HW-offload based support, only a single bio can be created for the write, and the write must not be split into multiple I/O requests, i.e. flag REQ_ATOMIC must be set. The file range to write must be aligned to satisfy the requirements of both the filesystem and the underlying block device's atomic commit capabilities. If filesystem metadata updates are required (e.g. unwritten extent conversion or copy-on-write), all updates for the entire file range must be committed atomically as well. Untorn-writes may be longer than a single file block. In all cases, the mapping start disk block must have at least the same alignment as the write offset. The filesystems must set IOMAP_F_ATOMIC_BIO to inform iomap core of an untorn-write based on HW-offload.h]hXFor HW-offload based support, only a single bio can be created for the write, and the write must not be split into multiple I/O requests, i.e. flag REQ_ATOMIC must be set. The file range to write must be aligned to satisfy the requirements of both the filesystem and the underlying block device’s atomic commit capabilities. If filesystem metadata updates are required (e.g. unwritten extent conversion or copy-on-write), all updates for the entire file range must be committed atomically as well. Untorn-writes may be longer than a single file block. In all cases, the mapping start disk block must have at least the same alignment as the write offset. The filesystems must set IOMAP_F_ATOMIC_BIO to inform iomap core of an untorn-write based on HW-offload.}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hj ubj)}(hXFor untorn-writes based on a software mechanism provided by the filesystem, all the disk block alignment and single bio restrictions which apply for HW-offload based untorn-writes do not apply. The mechanism would typically be used as a fallback for when HW-offload based untorn-writes may not be issued, e.g. the range of the write covers multiple extents, meaning that it is not possible to issue a single bio. All filesystem metadata updates for the entire file range must be committed atomically as well.h]hXFor untorn-writes based on a software mechanism provided by the filesystem, all the disk block alignment and single bio restrictions which apply for HW-offload based untorn-writes do not apply. The mechanism would typically be used as a fallback for when HW-offload based untorn-writes may not be issued, e.g. the range of the write covers multiple extents, meaning that it is not possible to issue a single bio. All filesystem metadata updates for the entire file range must be committed atomically as well.}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj ubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jjuh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j;hhhMhjahhubj)}(h[Callers commonly hold ``i_rwsem`` in shared or exclusive mode before calling this function.h](hCallers commonly hold }(hjWhhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjWubh: in shared or exclusive mode before calling this function.}(hjWhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhM"hjahhubeh}(h]jah ]h"] direct writesah$]h&]uh1hhj3hhhhhMubh)}(hhh](h)}(hjh]j-)}(hjh]hstruct iomap_dio_ops:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubah}(h]h ]h"]h$]h&]jjuh1hhj~hhhhhM&ubj)}(hX struct iomap_dio_ops { void (*submit_io)(const struct iomap_iter *iter, struct bio *bio, loff_t file_offset); int (*end_io)(struct kiocb *iocb, ssize_t size, int error, unsigned flags); struct bio_set *bio_set; };h]hX struct iomap_dio_ops { void (*submit_io)(const struct iomap_iter *iter, struct bio *bio, loff_t file_offset); int (*end_io)(struct kiocb *iocb, ssize_t size, int error, unsigned flags); struct bio_set *bio_set; };}hjsbah}(h]h ]h"]h$]h&]hhjjjj}uh1jhhhM'hj~hhubj)}(h,The fields of this structure are as follows:h]h,The fields of this structure are as follows:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM1hj~hhubj<)}(hX- ``submit_io``: iomap calls this function when it has constructed a ``struct bio`` object for the I/O requested, and wishes to submit it to the block device. If no function is provided, ``submit_bio`` will be called directly. Filesystems that would like to perform additional work before (e.g. data replication for btrfs) should implement this function. - ``end_io``: This is called after the ``struct bio`` completes. This function should perform post-write conversions of unwritten extent mappings, handle write failures, etc. The ``flags`` argument may be set to a combination of the following: * ``IOMAP_DIO_UNWRITTEN``: The mapping was unwritten, so the ioend should mark the extent as written. * ``IOMAP_DIO_COW``: Writing to the space in the mapping required a copy on write operation, so the ioend should switch mappings. - ``bio_set``: This allows the filesystem to provide a custom bio_set for allocating direct I/O bios. This enables filesystems to `stash additional per-bio information `_ for private use. If this field is NULL, generic ``struct bio`` objects will be used. h]h)}(hhh](h)}(hXa``submit_io``: iomap calls this function when it has constructed a ``struct bio`` object for the I/O requested, and wishes to submit it to the block device. If no function is provided, ``submit_bio`` will be called directly. Filesystems that would like to perform additional work before (e.g. data replication for btrfs) should implement this function. h]j)}(hX```submit_io``: iomap calls this function when it has constructed a ``struct bio`` object for the I/O requested, and wishes to submit it to the block device. If no function is provided, ``submit_bio`` will be called directly. Filesystems that would like to perform additional work before (e.g. data replication for btrfs) should implement this function.h](j-)}(h ``submit_io``h]h submit_io}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh6: iomap calls this function when it has constructed a }(hjhhhNhNubj-)}(h``struct bio``h]h struct bio}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhh object for the I/O requested, and wishes to submit it to the block device. If no function is provided, }(hjhhhNhNubj-)}(h``submit_bio``h]h submit_bio}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh will be called directly. Filesystems that would like to perform additional work before (e.g. data replication for btrfs) should implement this function.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhM3hjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hX``end_io``: This is called after the ``struct bio`` completes. This function should perform post-write conversions of unwritten extent mappings, handle write failures, etc. The ``flags`` argument may be set to a combination of the following: * ``IOMAP_DIO_UNWRITTEN``: The mapping was unwritten, so the ioend should mark the extent as written. * ``IOMAP_DIO_COW``: Writing to the space in the mapping required a copy on write operation, so the ioend should switch mappings. h](j)}(h``end_io``: This is called after the ``struct bio`` completes. This function should perform post-write conversions of unwritten extent mappings, handle write failures, etc. The ``flags`` argument may be set to a combination of the following:h](j-)}(h ``end_io``h]hend_io}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh: This is called after the }(hj hhhNhNubj-)}(h``struct bio``h]h struct bio}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh~ completes. This function should perform post-write conversions of unwritten extent mappings, handle write failures, etc. The }(hj hhhNhNubj-)}(h ``flags``h]hflags}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh7 argument may be set to a combination of the following:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhM:hjubh)}(hhh](h)}(hd``IOMAP_DIO_UNWRITTEN``: The mapping was unwritten, so the ioend should mark the extent as written. h]j)}(hc``IOMAP_DIO_UNWRITTEN``: The mapping was unwritten, so the ioend should mark the extent as written.h](j-)}(h``IOMAP_DIO_UNWRITTEN``h]hIOMAP_DIO_UNWRITTEN}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjPubhL: The mapping was unwritten, so the ioend should mark the extent as written.}(hjPhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhM?hjLubah}(h]h ]h"]h$]h&]uh1hhjIubh)}(h``IOMAP_DIO_COW``: Writing to the space in the mapping required a copy on write operation, so the ioend should switch mappings. h]j)}(h``IOMAP_DIO_COW``: Writing to the space in the mapping required a copy on write operation, so the ioend should switch mappings.h](j-)}(h``IOMAP_DIO_COW``h]h IOMAP_DIO_COW}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjvubhn: Writing to the space in the mapping required a copy on write operation, so the ioend should switch mappings.}(hjvhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMBhjrubah}(h]h ]h"]h$]h&]uh1hhjIubeh}(h]h ]h"]h$]h&]jjuh1hhhhM?hjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hX?``bio_set``: This allows the filesystem to provide a custom bio_set for allocating direct I/O bios. This enables filesystems to `stash additional per-bio information `_ for private use. If this field is NULL, generic ``struct bio`` objects will be used. h]j)}(hX>``bio_set``: This allows the filesystem to provide a custom bio_set for allocating direct I/O bios. This enables filesystems to `stash additional per-bio information `_ for private use. If this field is NULL, generic ``struct bio`` objects will be used.h](j-)}(h ``bio_set``h]hbio_set}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubhu: This allows the filesystem to provide a custom bio_set for allocating direct I/O bios. This enables filesystems to }(hjhhhNhNubj )}(hi`stash additional per-bio information `_h]h$stash additional per-bio information}(hjhhhNhNubah}(h]h ]h"]h$]h&]name$stash additional per-bio informationj?https://lore.kernel.org/all/20220505201115.937837-3-hch@lst.de/uh1jhjubh)}(hB h]h}(h]$stash-additional-per-bio-informationah ]h"]$stash additional per-bio informationah$]h&]refurijuh1hj*Khjubh1 for private use. If this field is NULL, generic }(hjhhhNhNubj-)}(h``struct bio``h]h struct bio}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh objects will be used.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMEhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jj- uh1hhhhM3hjubah}(h]h ]h"]h$]h&]uh1j;hhhM3hj~hhubj)}(hFilesystems that want to perform extra work after an I/O completion should set a custom ``->bi_end_io`` function via ``->submit_io``. Afterwards, the custom endio function must call ``iomap_dio_bio_end_io`` to finish the direct I/O.h](hXFilesystems that want to perform extra work after an I/O completion should set a custom }(hj hhhNhNubj-)}(h``->bi_end_io``h]h ->bi_end_io}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh function via }(hj hhhNhNubj-)}(h``->submit_io``h]h ->submit_io}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh2. Afterwards, the custom endio function must call }(hj hhhNhNubj-)}(h``iomap_dio_bio_end_io``h]hiomap_dio_bio_end_io}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh to finish the direct I/O.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMLhj~hhubeh}(h]jah ]h"]struct iomap_dio_ops:ah$]h&]uh1hhj3hhhhhM&ubeh}(h]j0ah ]h"] direct i/oah$]h&]uh1hhhhhhhhMwubh)}(hhh](h)}(hDAX I/Oh]hDAX I/O}(hj_hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhj\hhhhhMRubj)}(hSome storage devices can be directly mapped as memory. These devices support a new access mode known as "fsdax" that allows loads and stores through the CPU and memory controller.h]hSome storage devices can be directly mapped as memory. These devices support a new access mode known as “fsdax” that allows loads and stores through the CPU and memory controller.}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMThj\hhubh)}(hhh](h)}(h fsdax Readsh]h fsdax Reads}(hj~hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhj{hhhhhMYubj)}(hA fsdax read performs a memcpy from storage device to the caller's buffer. The ``flags`` value for ``->iomap_begin`` will be ``IOMAP_DAX`` with any combination of the following enhancements:h](hQA fsdax read performs a memcpy from storage device to the caller’s buffer. The }(hjhhhNhNubj-)}(h ``flags``h]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh value for }(hjhhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh will be }(hjhhhNhNubj-)}(h ``IOMAP_DAX``h]h IOMAP_DAX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh4 with any combination of the following enhancements:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhM[hj{hhubj<)}(h+* ``IOMAP_NOWAIT``, as defined previously. h]h)}(hhh]h)}(h)``IOMAP_NOWAIT``, as defined previously. h]j)}(h(``IOMAP_NOWAIT``, as defined previously.h](j-)}(h``IOMAP_NOWAIT``h]h IOMAP_NOWAIT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh, as defined previously.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhM`hjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]jjuh1hhhhM`hjubah}(h]h ]h"]h$]h&]uh1j;hhhM`hj{hhubj)}(hNCallers commonly hold ``i_rwsem`` in shared mode before calling this function.h](hCallers commonly hold }(hj hhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh- in shared mode before calling this function.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMbhj{hhubeh}(h]j ah ]h"] fsdax readsah$]h&]uh1hhj\hhhhhMYubh)}(hhh](h)}(h fsdax Writesh]h fsdax Writes}(hj3hhhNhNubah}(h]h ]h"]h$]h&]jj(uh1hhj0hhhhhMfubj)}(hA fsdax write initiates a memcpy to the storage device from the caller's buffer. The ``flags`` value for ``->iomap_begin`` will be ``IOMAP_DAX | IOMAP_WRITE`` with any combination of the following enhancements:h](hWA fsdax write initiates a memcpy to the storage device from the caller’s buffer. The }(hjAhhhNhNubj-)}(h ``flags``h]hflags}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjAubh value for }(hjAhhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjAubh will be }(hjAhhhNhNubj-)}(h``IOMAP_DAX | IOMAP_WRITE``h]hIOMAP_DAX | IOMAP_WRITE}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjAubh4 with any combination of the following enhancements:}(hjAhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhhj0hhubj<)}(hX* ``IOMAP_NOWAIT``, as defined previously. * ``IOMAP_OVERWRITE_ONLY``: The caller requires a pure overwrite to be performed from this mapping. This requires the filesystem extent mapping to already exist as an ``IOMAP_MAPPED`` type and span the entire range of the write I/O request. If the filesystem cannot map this request in a way that allows the iomap infrastructure to perform a pure overwrite, it must fail the mapping operation with ``-EAGAIN``. h]h)}(hhh](h)}(h)``IOMAP_NOWAIT``, as defined previously. h]j)}(h(``IOMAP_NOWAIT``, as defined previously.h](j-)}(h``IOMAP_NOWAIT``h]h IOMAP_NOWAIT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh, as defined previously.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMmhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hX``IOMAP_OVERWRITE_ONLY``: The caller requires a pure overwrite to be performed from this mapping. This requires the filesystem extent mapping to already exist as an ``IOMAP_MAPPED`` type and span the entire range of the write I/O request. If the filesystem cannot map this request in a way that allows the iomap infrastructure to perform a pure overwrite, it must fail the mapping operation with ``-EAGAIN``. h]j)}(hX``IOMAP_OVERWRITE_ONLY``: The caller requires a pure overwrite to be performed from this mapping. This requires the filesystem extent mapping to already exist as an ``IOMAP_MAPPED`` type and span the entire range of the write I/O request. If the filesystem cannot map this request in a way that allows the iomap infrastructure to perform a pure overwrite, it must fail the mapping operation with ``-EAGAIN``.h](j-)}(h``IOMAP_OVERWRITE_ONLY``h]hIOMAP_OVERWRITE_ONLY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh: The caller requires a pure overwrite to be performed from this mapping. This requires the filesystem extent mapping to already exist as an }(hjhhhNhNubj-)}(h``IOMAP_MAPPED``h]h IOMAP_MAPPED}(hjhhhNhNubah}(hT]h ]h"]h$]h&]uh1j,hjubh type and span the entire range of the write I/O request. If the filesystem cannot map this request in a way that allows the iomap infrastructure to perform a pure overwrite, it must fail the mapping operation with }(hjhhhNhNubj-)}(h ``-EAGAIN``h]h-EAGAIN}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMohjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jjuh1hhhhMmhjubah}(h]h ]h"]h$]h&]uh1j;hhhMmhj0hhubj)}(hQCallers commonly hold ``i_rwsem`` in exclusive mode before calling this function.h](hCallers commonly hold }(hjhhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh0 in exclusive mode before calling this function.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMxhj0hhubh)}(hhh](h)}(hfsdax mmap Faultsh]hfsdax mmap Faults}(hj+hhhNhNubah}(h]h ]h"]h$]h&]jjGuh1hhj(hhhhhM|ubj)}(hX9The ``dax_iomap_fault`` function handles read and write faults to fsdax storage. For a read fault, ``IOMAP_DAX | IOMAP_FAULT`` will be passed as the ``flags`` argument to ``->iomap_begin``. For a write fault, ``IOMAP_DAX | IOMAP_FAULT | IOMAP_WRITE`` will be passed as the ``flags`` argument to ``->iomap_begin``.h](hThe }(hj9hhhNhNubj-)}(h``dax_iomap_fault``h]hdax_iomap_fault}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj9ubhL function handles read and write faults to fsdax storage. For a read fault, }(hj9hhhNhNubj-)}(h``IOMAP_DAX | IOMAP_FAULT``h]hIOMAP_DAX | IOMAP_FAULT}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj9ubh will be passed as the }(hj9hhhNhNubj-)}(h ``flags``h]hflags}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj9ubh argument to }(hj9hhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj9ubh. For a write fault, }(hj9hhhNhNubj-)}(h)``IOMAP_DAX | IOMAP_FAULT | IOMAP_WRITE``h]h%IOMAP_DAX | IOMAP_FAULT | IOMAP_WRITE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj9ubh will be passed as the }(hj9hhhNhNubj-)}(h ``flags``h]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj9ubh argument to }hj9sbj-)}(h``->iomap_begin``h]h ->iomap_begin}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj9ubh.}(hj9hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhM~hj(hhubj)}(h[Callers commonly hold the same locks as they do to call their iomap pagecache counterparts.h]h[Callers commonly hold the same locks as they do to call their iomap pagecache counterparts.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj(hhubeh}(h]jMah ]h"]fsdax mmap faultsah$]h&]uh1hhj0hhhhhM|ubeh}(h]j.ah ]h"] fsdax writesah$]h&]uh1hhj\hhhhhMfubh)}(hhh](h)}(h*fsdax Truncation, fallocate, and Unsharingh]h*fsdax Truncation, fallocate, and Unsharing}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjuuh1hhjhhhhhMubj)}(hFor fsdax files, the following functions are provided to replace their iomap pagecache I/O counterparts. The ``flags`` argument to ``->iomap_begin`` are the same as the pagecache counterparts, with ``IOMAP_DAX`` added.h](hmFor fsdax files, the following functions are provided to replace their iomap pagecache I/O counterparts. The }(hjhhhNhNubj-)}(h ``flags``h]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh argument to }(hjhhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh2 are the same as the pagecache counterparts, with }(hjhhhNhNubj-)}(h ``IOMAP_DAX``h]h IOMAP_DAX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh added.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjhhubj<)}(hD* ``dax_file_unshare`` * ``dax_zero_range`` * ``dax_truncate_page`` h]h)}(hhh](h)}(h``dax_file_unshare``h]j)}(hj?h]j-)}(hj?h]hdax_file_unshare}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjAubah}(h]h ]h"]h$]h&]uh1jhhhMhj=ubah}(h]h ]h"]h$]h&]uh1hhj:ubh)}(h``dax_zero_range``h]j)}(hj_h]j-)}(hj_h]hdax_zero_range}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjaubah}(h]h ]h"]h$]h&]uh1jhhhMhj]ubah}(h]h ]h"]h$]h&]uh1hhj:ubh)}(h``dax_truncate_page`` h]j)}(h``dax_truncate_page``h]j-)}(hjh]hdax_truncate_page}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubah}(h]h ]h"]h$]h&]uh1jhhhMhj}ubah}(h]h ]h"]h$]h&]uh1hhj:ubeh}(h]h ]h"]h$]h&]jjuh1hhhhMhj6ubah}(h]h ]h"]h$]h&]uh1j;hhhMhjhhubj)}(h[Callers commonly hold the same locks as they do to call their iomap pagecache counterparts.h]h[Callers commonly hold the same locks as they do to call their iomap pagecache counterparts.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjhhubeh}(h]j{ah ]h"]*fsdax truncation, fallocate, and unsharingah$]h&]uh1hhj\hhhhhMubh)}(hhh](h)}(hfsdax Deduplicationh]hfsdax Deduplication}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjhhhhhMubj)}(hFilesystems implementing the ``FIDEDUPERANGE`` ioctl must call the ``dax_remap_file_range_prep`` function with their own iomap read ops.h](hFilesystems implementing the }(hjhhhNhNubj-)}(h``FIDEDUPERANGE``h]h FIDEDUPERANGE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh ioctl must call the }(hjhhhNhNubj-)}(h``dax_remap_file_range_prep``h]hdax_remap_file_range_prep}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjubh( function with their own iomap read ops.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjhhubeh}(h]jah ]h"]fsdax deduplicationah$]h&]uh1hhj\hhhhhMubeh}(h]jah ]h"]dax i/oah$]h&]uh1hhhhhhhhMRubh)}(hhh](h)}(h Seeking Filesh]h Seeking Files}(hj hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhj hhhhhMubj)}(hNiomap implements the two iterating whence modes of the ``llseek`` system call.h](h7iomap implements the two iterating whence modes of the }(hj! hhhNhNubj-)}(h ``llseek``h]hllseek}(hj) hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj! ubh system call.}(hj! hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj hhubh)}(hhh](h)}(h SEEK_DATAh]h SEEK_DATA}(hjD hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjA hhhhhMubj)}(hThe ``iomap_seek_data`` function implements the SEEK_DATA "whence" value for llseek. ``IOMAP_REPORT`` will be passed as the ``flags`` argument to ``->iomap_begin``.h](hThe }(hjR hhhNhNubj-)}(h``iomap_seek_data``h]hiomap_seek_data}(hjZ hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjR ubhB function implements the SEEK_DATA “whence” value for llseek. }(hjR hhhNhNubj-)}(h``IOMAP_REPORT``h]h IOMAP_REPORT}(hjl hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjR ubh will be passed as the }(hjR hhhNhNubj-)}(h ``flags``h]hflags}(hj~ hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjR ubh argument to }(hjR hhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjR ubh.}(hjR hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjA hhubj)}(hFor unwritten mappings, the pagecache will be searched. Regions of the pagecache with a folio mapped and uptodate fsblocks within those folios will be reported as data areas.h]hFor unwritten mappings, the pagecache will be searched. Regions of the pagecache with a folio mapped and uptodate fsblocks within those folios will be reported as data areas.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjA hhubj)}(hNCallers commonly hold ``i_rwsem`` in shared mode before calling this function.h](hCallers commonly hold }(hj hhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh- in shared mode before calling this function.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjA hhubeh}(h]jah ]h"] seek_dataah$]h&]uh1hhj hhhhhMubh)}(hhh](h)}(h SEEK_HOLEh]h SEEK_HOLE}(hj hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhj hhhhhMubj)}(hThe ``iomap_seek_hole`` function implements the SEEK_HOLE "whence" value for llseek. ``IOMAP_REPORT`` will be passed as the ``flags`` argument to ``->iomap_begin``.h](hThe }(hj hhhNhNubj-)}(h``iomap_seek_hole``h]hiomap_seek_hole}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubhB function implements the SEEK_HOLE “whence” value for llseek. }(hj hhhNhNubj-)}(h``IOMAP_REPORT``h]h IOMAP_REPORT}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh will be passed as the }(hj hhhNhNubj-)}(h ``flags``h]hflags}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh argument to }(hj hhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hj,!hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj hhubj)}(hFor unwritten mappings, the pagecache will be searched. Regions of the pagecache with no folio mapped, or a !uptodate fsblock within a folio will be reported as sparse hole areas.h]hFor unwritten mappings, the pagecache will be searched. Regions of the pagecache with no folio mapped, or a !uptodate fsblock within a folio will be reported as sparse hole areas.}(hjD!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj hhubj)}(hNCallers commonly hold ``i_rwsem`` in shared mode before calling this function.h](hCallers commonly hold }(hjR!hhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hjZ!hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjR!ubh- in shared mode before calling this function.}(hjR!hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj hhubeh}(h]j ah ]h"] seek_holeah$]h&]uh1hhj hhhhhMubeh}(h]jah ]h"] seeking filesah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hSwap File Activationh]hSwap File Activation}(hj!hhhNhNubah}(h]h ]h"]h$]h&]jj4uh1hhj!hhhhhMubj)}(hXThe ``iomap_swapfile_activate`` function finds all the base-page aligned regions in a file and sets them up as swap space. The file will be ``fsync()``'d before activation. ``IOMAP_REPORT`` will be passed as the ``flags`` argument to ``->iomap_begin``. All mappings must be mapped or unwritten; cannot be dirty or shared, and cannot span multiple block devices. Callers must hold ``i_rwsem`` in exclusive mode; this is already provided by ``swapon``.h](hThe }(hj!hhhNhNubj-)}(h``iomap_swapfile_activate``h]hiomap_swapfile_activate}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj!ubhm function finds all the base-page aligned regions in a file and sets them up as swap space. The file will be }(hj!hhhNhNubj-)}(h ``fsync()``h]hfsync()}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj!ubh’d before activation. }(hj!hhhNhNubj-)}(h``IOMAP_REPORT``h]h IOMAP_REPORT}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj!ubh will be passed as the }(hj!hhhNhNubj-)}(h ``flags``h]hflags}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj!ubh argument to }(hj!hhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj!ubh. All mappings must be mapped or unwritten; cannot be dirty or shared, and cannot span multiple block devices. Callers must hold }(hj!hhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj!ubh0 in exclusive mode; this is already provided by }(hj!hhhNhNubj-)}(h ``swapon``h]hswapon}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj!ubh.}(hj!hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj!hhubeh}(h]j:ah ]h"]swap file activationah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hFile Space Mapping Reportingh]hFile Space Mapping Reporting}(hj'"hhhNhNubah}(h]h ]h"]h$]h&]jjVuh1hhj$"hhhhhMubj)}(hiomap_begin``. Callers commonly hold ``i_rwsem`` in shared mode before calling this function.h](hThe }(hjT"hhhNhNubj-)}(h``iomap_fiemap``h]h iomap_fiemap}(hj\"hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjT"ubhS function exports file extent mappings to userspace in the format specified by the }(hjT"hhhNhNubj-)}(h``FS_IOC_FIEMAP``h]h FS_IOC_FIEMAP}(hjn"hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjT"ubh ioctl. }(hjT"hhhNhNubj-)}(h``IOMAP_REPORT``h]h IOMAP_REPORT}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjT"ubh will be passed as the }(hjT"hhhNhNubj-)}(h ``flags``h]hflags}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjT"ubh argument to }(hjT"hhhNhNubj-)}(h``->iomap_begin``h]h ->iomap_begin}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjT"ubh. Callers commonly hold }(hjT"hhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hjT"ubh- in shared mode before calling this function.}(hjT"hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjC"hhubeh}(h]j{ah ]h"] fs_ioc_fiemapah$]h&]uh1hhj$"hhhhhMubh)}(hhh](h)}(hFIBMAP (deprecated)h]hFIBMAP (deprecated)}(hj"hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhj"hhhhhMubj)}(hX``iomap_bmap`` implements FIBMAP. The calling conventions are the same as for FIEMAP. This function is only provided to maintain compatibility for filesystems that implemented FIBMAP prior to conversion. This ioctl is deprecated; do **not** add a FIBMAP implementation to filesystems that do not have it. Callers should probably hold ``i_rwsem`` in shared mode before calling this function, but this is unclear.h](j-)}(h``iomap_bmap``h]h iomap_bmap}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj"ubh implements FIBMAP. The calling conventions are the same as for FIEMAP. This function is only provided to maintain compatibility for filesystems that implemented FIBMAP prior to conversion. This ioctl is deprecated; do }(hj"hhhNhNubhstrong)}(h**not**h]hnot}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1j"hj"ubh^ add a FIBMAP implementation to filesystems that do not have it. Callers should probably hold }(hj"hhhNhNubj-)}(h ``i_rwsem``h]hi_rwsem}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1j,hj"ubhB in shared mode before calling this function, but this is unclear.}(hj"hhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhj"hhubeh}(h]jah ]h"]fibmap (deprecated)ah$]h&]uh1hhj$"hhhhhMubeh}(h]j\ah ]h"]file space mapping reportingah$]h&]uh1hhhhhhhhMubeh}(h]supported-file-operationsah ]h"]supported file operationsah$]h&]uh1hhhhhhhhK ubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_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_handlerja#error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _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}refids}nameids}(hhj;#j8#jjj0jjjDj jpj&j#jjj j j jj j jL jjjj{ jj_jj j j j jj9jj[j@jj)jjjjjjqjnj"jjkjhjYj0jjjjjjjjOj^jqj{jjRjjjj jj-j jj.jjMjj{j jj}!jj jjv!j j!"j:j3#j\j"j{j,#ju nametypes}(hj;#jj0jj j&jj j j jL jj{ j_j j jjj@j)jjjqj"jkjYjjjjj^j{jRjj j-jjjj j}!j jv!j!"j3#j"j,#uh}(hhj8#hjhjjjDjjpjj#jjjj j jj j j jj jjO jj jj~ j j j j j9jbj[jjjjjCjj@jjjnjhjjjhjbj0j3jjjjjjjOjjqjjjajj~jjjj\j j{j.j0jMj(j{jjjjj jjA j j j:j!j\j$"j{jC"jj"jj j>j)jjjWjjjjjjjjjjj3j*jUjLjjzjjjjjjj*j!jIj@jkjbjjjjjjjjj(jjGj>jujljjjjjjjjj4j+jVjMjujljju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jo#K sRparse_messages]transform_messages]hsystem_message)}(hhh]j)}(hhh]h6Hyperlink target "iomap_operations" is not referenced.}hj#sbah}(h]h ]h"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1j#uba transformerN include_log] decorationNhhub.