€•Œsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ0/translations/zh_CN/filesystems/iomap/operations”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/zh_TW/filesystems/iomap/operations”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/it_IT/filesystems/iomap/operations”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/ja_JP/filesystems/iomap/operations”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/ko_KR/filesystems/iomap/operations”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/pt_BR/filesystems/iomap/operations”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ0/translations/sp_SP/filesystems/iomap/operations”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)�”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…”�”}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒJ/var/lib/git/docbuild/linux/Documentation/filesystems/iomap/operations.rst”h´KubhŒtarget”“”)�”}”(hŒ.. _iomap_operations:”h]”h}”(h]”Œiomap-operations”ah ]”h"]”Œiomap_operations”ah$]”h&]”uh1hÈh´Khhh²hh³hÇubh¶)�”}”(hŒÈDumb 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]”hŒÈDumb 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.”…”�”}”hhÖsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1hµhhh²hh³hÇh´K ubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒSupported File Operations”h]”hŒSupported File Operations”…”�”}”(hhëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1héhhæh²hh³hÇh´K ubhŒtopic”“”)�”}”(hŒTable of Contents ”h]”(hê)�”}”(hŒTable of Contents”h]”hŒTable of Contents”…”�”}”(hhÿh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1héhhûh³hÇh´KubhŒ bullet_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hhh]”(hŒ paragraph”“”)�”}”(hhh]”hŒ reference”“”)�”}”(hhh]”hŒ Buffered I/O”…”�”}”(hjh²hh³Nh´Nubah}”(h]”Œid1”ah ]”h"]”h$]”h&]”Œrefid”Œ buffered-i-o”uh1jhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(hhh]”(j)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒliteral”“”)�”}”(hŒ#``struct address_space_operations``”h]”hŒstruct address_space_operations”…”�”}”(hjBh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@h³Nh´Nhj=ubah}”(h]”Œid2”ah ]”h"]”h$]”h&]”Œrefid”Œstruct-address-space-operations”uh1jhj:ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj7ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj4ubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”jA)�”}”(hŒ``struct iomap_write_ops``”h]”hŒstruct iomap_write_ops”…”�”}”(hjnh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@h³Nh´Nhjkubah}”(h]”Œid3”ah ]”h"]”h$]”h&]”Œrefid”Œstruct-iomap-write-ops”uh1jhjhubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjeubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj4ubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”jA)�”}”(hŒ``struct iomap_read_ops``”h]”hŒstruct iomap_read_ops”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@h³Nh´Nhj—ubah}”(h]”Œid4”ah ]”h"]”h$]”h&]”Œrefid”Œstruct-iomap-read-ops”uh1jhj”ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj‘ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj4ubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒInternal per-Folio State”…”�”}”(hjÃh²hh³Nh´Nubah}”(h]”Œid5”ah ]”h"]”h$]”h&]”Œrefid”Œinternal-per-folio-state”uh1jhjÀubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj½ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj4ubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒBuffered Readahead and Reads”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”Œid6”ah ]”h"]”h$]”h&]”Œrefid”Œbuffered-readahead-and-reads”uh1jhjâubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjßubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj4ubj)�”}”(hhh]”(j)�”}”(hhh]”j)�”}”(hhh]”hŒBuffered Writes”…”�”}”(hjh²hh³Nh´Nubah}”(h]”Œid7”ah ]”h"]”h$]”h&]”Œrefid”Œbuffered-writes”uh1jhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(hhh]”(j)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒmmap Write Faults”…”�”}”(hj&h²hh³Nh´Nubah}”(h]”Œid8”ah ]”h"]”h$]”h&]”Œrefid”Œmmap-write-faults”uh1jhj#ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒBuffered Write Failures”…”�”}”(hjHh²hh³Nh´Nubah}”(h]”Œid9”ah ]”h"]”h$]”h&]”Œrefid”Œbuffered-write-failures”uh1jhjEubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjBubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒZeroing for File Operations”…”�”}”(hjjh²hh³Nh´Nubah}”(h]”Œid10”ah ]”h"]”h$]”h&]”Œrefid”Œzeroing-for-file-operations”uh1jhjgubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjdubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒUnsharing Reflinked File Data”…”�”}”(hjŒh²hh³Nh´Nubah}”(h]”Œid11”ah ]”h"]”h$]”h&]”Œrefid”Œunsharing-reflinked-file-data”uh1jhj‰ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj†ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhj4ubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒ Truncation”…”�”}”(hjºh²hh³Nh´Nubah}”(h]”Œid12”ah ]”h"]”h$]”h&]”Œrefid”Œ truncation”uh1jhj·ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj´ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj4ubj)�”}”(hhh]”(j)�”}”(hhh]”j)�”}”(hhh]”hŒPagecache Writeback”…”�”}”(hjÜh²hh³Nh´Nubah}”(h]”Œid13”ah ]”h"]”h$]”h&]”Œrefid”Œpagecache-writeback”uh1jhjÙubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÖubj)�”}”(hhh]”(j)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”jA)�”}”(hŒ``struct iomap_writeback_ops``”h]”hŒstruct iomap_writeback_ops”…”�”}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@h³Nh´Nhjûubah}”(h]”Œid14”ah ]”h"]”h$]”h&]”Œrefid”Œstruct-iomap-writeback-ops”uh1jhjøubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjõubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjòubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒPagecache Writeback Completion”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”Œid15”ah ]”h"]”h$]”h&]”Œrefid”Œpagecache-writeback-completion”uh1jhj$ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjòubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hjÖubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhj4ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(hhh]”(j)�”}”(hhh]”j)�”}”(hhh]”hŒ Direct I/O”…”�”}”(hjah²hh³Nh´Nubah}”(h]”Œid16”ah ]”h"]”h$]”h&]”Œrefid”Œ direct-i-o”uh1jhj^ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj[ubj)�”}”(hhh]”(j)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒ Return Values”…”�”}”(hj€h²hh³Nh´Nubah}”(h]”Œid17”ah ]”h"]”h$]”h&]”Œrefid”Œ return-values”uh1jhj}ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjzubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjwubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒ Direct Reads”…”�”}”(hj¢h²hh³Nh´Nubah}”(h]”Œid18”ah ]”h"]”h$]”h&]”Œrefid”Œ direct-reads”uh1jhjŸubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjœubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjwubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒ Direct Writes”…”�”}”(hjÄh²hh³Nh´Nubah}”(h]”Œid19”ah ]”h"]”h$]”h&]”Œrefid”Œ direct-writes”uh1jhjÁubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj¾ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjwubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”jA)�”}”(hŒ``struct iomap_dio_ops:``”h]”hŒstruct iomap_dio_ops:”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@h³Nh´Nhjæubah}”(h]”Œid20”ah ]”h"]”h$]”h&]”Œrefid”Œstruct-iomap-dio-ops”uh1jhjãubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjàubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjwubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hj[ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(hhh]”(j)�”}”(hhh]”j)�”}”(hhh]”hŒDAX I/O”…”�”}”(hjh²hh³Nh´Nubah}”(h]”Œid21”ah ]”h"]”h$]”h&]”Œrefid”Œdax-i-o”uh1jhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(hhh]”(j)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒ fsdax Reads”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”Œid22”ah ]”h"]”h$]”h&]”Œrefid”Œ fsdax-reads”uh1jhj:ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj7ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj4ubj)�”}”(hhh]”(j)�”}”(hhh]”j)�”}”(hhh]”hŒ fsdax Writes”…”�”}”(hj_h²hh³Nh´Nubah}”(h]”Œid23”ah ]”h"]”h$]”h&]”Œrefid”Œ fsdax-writes”uh1jhj\ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjYubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒfsdax mmap Faults”…”�”}”(hj~h²hh³Nh´Nubah}”(h]”Œid24”ah ]”h"]”h$]”h&]”Œrefid”Œfsdax-mmap-faults”uh1jhj{ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjxubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjuubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjYubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhj4ubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒ*fsdax Truncation, fallocate, and Unsharing”…”�”}”(hj¬h²hh³Nh´Nubah}”(h]”Œid25”ah ]”h"]”h$]”h&]”Œrefid”Œ(fsdax-truncation-fallocate-and-unsharing”uh1jhj©ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj¦ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj4ubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒfsdax Deduplication”…”�”}”(hjÎh²hh³Nh´Nubah}”(h]”Œid26”ah ]”h"]”h$]”h&]”Œrefid”Œfsdax-deduplication”uh1jhjËubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÈubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj4ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(hhh]”(j)�”}”(hhh]”j)�”}”(hhh]”hŒ Seeking Files”…”�”}”(hjüh²hh³Nh´Nubah}”(h]”Œid27”ah ]”h"]”h$]”h&]”Œrefid”Œ seeking-files”uh1jhjùubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjöubj)�”}”(hhh]”(j)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒ SEEK_DATA”…”�”}”(hjh²hh³Nh´Nubah}”(h]”Œid28”ah ]”h"]”h$]”h&]”Œrefid”Œ seek-data”uh1jhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒ SEEK_HOLE”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”Œid29”ah ]”h"]”h$]”h&]”Œrefid”Œ seek-hole”uh1jhj:ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj7ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hjöubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒSwap File Activation”…”�”}”(hjkh²hh³Nh´Nubah}”(h]”Œid30”ah ]”h"]”h$]”h&]”Œrefid”Œswap-file-activation”uh1jhjhubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjeubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(hhh]”(j)�”}”(hhh]”j)�”}”(hhh]”hŒFile Space Mapping Reporting”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”Œid31”ah ]”h"]”h$]”h&]”Œrefid”Œfile-space-mapping-reporting”uh1jhjŠubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj‡ubj)�”}”(hhh]”(j)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒ FS_IOC_FIEMAP”…”�”}”(hj¬h²hh³Nh´Nubah}”(h]”Œid32”ah ]”h"]”h$]”h&]”Œrefid”Œ fs-ioc-fiemap”uh1jhj©ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj¦ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj£ubj)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hhh]”hŒFIBMAP (deprecated)”…”�”}”(hjÎh²hh³Nh´Nubah}”(h]”Œid33”ah ]”h"]”h$]”h&]”Œrefid”Œfibmap-deprecated”uh1jhjËubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÈubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj£ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hj‡ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j hhûh²hh³Nh´Nubeh}”(h]”Œtable-of-contents”ah ]”(Œcontents”Œlocal”eh"]”Œtable of contents”ah$]”h&]”uh1hùh³hÇh´Khhæh²hubj)�”}”(hŒOBelow are a discussion of the high level file operations that iomap implements.”h]”hŒOBelow are a discussion of the high level file operations that iomap implements.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Khhæh²hubhå)�”}”(hhh]”(hê)�”}”(hŒ Buffered I/O”h]”hŒ Buffered I/O”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefid”j'uh1héhjh²hh³hÇh´Kubj)�”}”(hŒçBuffered 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]”(hŒÔBuffered 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 ”…”�”}”(hj&h²hh³Nh´NubjA)�”}”(hŒ ``fsync``”h]”hŒfsync”…”�”}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj&ubhŒ and variants.”…”�”}”(hj&h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Khjh²hubj)�”}”(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.”…”�”}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Khjh²hubhå)�”}”(hhh]”(hê)�”}”(hjDh]”jA)�”}”(hjDh]”hŒstruct address_space_operations”…”�”}”(hjZh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjWubah}”(h]”h ]”h"]”h$]”h&]”j%jRuh1héhjTh²hh³hÇh´K*ubj)�”}”(hŒeThe following iomap functions can be referenced directly from the address space operations structure:”h]”hŒeThe following iomap functions can be referenced directly from the address space operations structure:”…”�”}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K,hjTh²hubhŒ block_quote”“”)�”}”(hŒq* ``iomap_dirty_folio`` * ``iomap_release_folio`` * ``iomap_invalidate_folio`` * ``iomap_is_partially_uptodate`` ”h]”j)�”}”(hhh]”(j)�”}”(hŒ``iomap_dirty_folio``”h]”j)�”}”(hj†h]”jA)�”}”(hj†h]”hŒiomap_dirty_folio”…”�”}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjˆubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K/hj„ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj�ubj)�”}”(hŒ``iomap_release_folio``”h]”j)�”}”(hj¦h]”jA)�”}”(hj¦h]”hŒiomap_release_folio”…”�”}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¨ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K0hj¤ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj�ubj)�”}”(hŒ``iomap_invalidate_folio``”h]”j)�”}”(hjÆh]”jA)�”}”(hjÆh]”hŒiomap_invalidate_folio”…”�”}”(hjËh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÈubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K1hjÄubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj�ubj)�”}”(hŒ ``iomap_is_partially_uptodate`` ”h]”j)�”}”(hŒ``iomap_is_partially_uptodate``”h]”jA)�”}”(hjêh]”hŒiomap_is_partially_uptodate”…”�”}”(hjìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjèubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K2hjäubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj�ubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1j h³hÇh´K/hj}ubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´K/hjTh²hubj)�”}”(hŒ=The following address space operations can be wrapped easily:”h]”hŒ=The following address space operations can be wrapped easily:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K4hjTh²hubj|)�”}”(hŒQ* ``read_folio`` * ``readahead`` * ``writepages`` * ``bmap`` * ``swap_activate`` ”h]”j)�”}”(hhh]”(j)�”}”(hŒ``read_folio``”h]”j)�”}”(hj*h]”jA)�”}”(hj*h]”hŒ read_folio”…”�”}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj,ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K6hj(ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj%ubj)�”}”(hŒ ``readahead``”h]”j)�”}”(hjJh]”jA)�”}”(hjJh]”hŒ readahead”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjLubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K7hjHubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj%ubj)�”}”(hŒ``writepages``”h]”j)�”}”(hjjh]”jA)�”}”(hjjh]”hŒ writepages”…”�”}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjlubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K8hjhubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj%ubj)�”}”(hŒ``bmap``”h]”j)�”}”(hjŠh]”jA)�”}”(hjŠh]”hŒbmap”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjŒubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K9hjˆubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj%ubj)�”}”(hŒ``swap_activate`` ”h]”j)�”}”(hŒ``swap_activate``”h]”jA)�”}”(hj®h]”hŒ swap_activate”…”�”}”(hj°h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¬ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K:hj¨ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj%ubeh}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´K6hj!ubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´K6hjTh²hubeh}”(h]”jXah ]”h"]”Œstruct address_space_operations”ah$]”h&]”uh1hähjh²hh³hÇh´K*ubhå)�”}”(hhh]”(hê)�”}”(hjph]”jA)�”}”(hjph]”hŒstruct iomap_write_ops”…”�”}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjßubah}”(h]”h ]”h"]”h$]”h&]”j%j~uh1héhjÜh²hh³hÇh´K=ubhŒ literal_block”“”)�”}”(hXÊstruct 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]”hXÊstruct 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); };”…”�”}”hj÷sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆŒforce”‰Œlanguage”Œc”Œhighlight_args”}”uh1jõh³hÇh´K?hjÜh²hubj)�”}”(hŒiomap calls these functions:”h]”hŒiomap calls these functions:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KKhjÜh²hubj|)�”}”(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]”j)�”}”(hhh]”(j)�”}”(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]”(jA)�”}”(hŒ ``get_folio``”h]”hŒ get_folio”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj#ubhŒ“: 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 ”…”�”}”(hj#h²hh³Nh´NubjA)�”}”(hŒ``iomap_get_folio``”h]”hŒiomap_get_folio”…”�”}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj#ubhŒ. This could be used to ”…”�”}”(hj#h²hh³Nh´Nubj)�”}”(hŒn`set up per-folio filesystem state `_”h]”hŒ!set up per-folio filesystem state”…”�”}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ!set up per-folio filesystem state”Œrefuri”ŒGhttps://lore.kernel.org/all/20190429220934.10415-5-agruenba@redhat.com/”uh1jhj#ubhÉ)�”}”(hŒJ ”h]”h}”(h]”Œ!set-up-per-folio-filesystem-state”ah ]”h"]”Œ!set up per-folio filesystem state”ah$]”h&]”Œrefuri”j\uh1hÈŒ referenced”Khj#ubhŒ for a write.”…”�”}”(hj#h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KMhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(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]”(jA)�”}”(hŒ ``put_folio``”h]”hŒ put_folio”…”�”}”(hjƒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjubhŒw: Called to unlock and put a folio after a pagecache operation completes. If this function is not provided, iomap will ”…”�”}”(hjh²hh³Nh´NubjA)�”}”(hŒ``folio_unlock``”h]”hŒ folio_unlock”…”�”}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjubhŒ and ”…”�”}”(hjh²hh³Nh´NubjA)�”}”(hŒ ``folio_put``”h]”hŒ folio_put”…”�”}”(hj§h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjubhŒ# on its own. This could be used to ”…”�”}”(hjh²hh³Nh´Nubj)�”}”(hŒe`commit per-folio filesystem state `_”h]”hŒ!commit per-folio filesystem state”…”�”}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ!commit per-folio filesystem state”j[Œ>https://lore.kernel.org/all/20180619164137.13720-6-hch@lst.de/”uh1jhjubhÉ)�”}”(hŒA ”h]”h}”(h]”Œ!commit-per-folio-filesystem-state”ah ]”h"]”Œ!commit per-folio filesystem state”ah$]”h&]”Œrefuri”jÉuh1hÈjjKhjubhŒ that was set up by ”…”�”}”(hjh²hh³Nh´NubjA)�”}”(hŒ``->get_folio``”h]”hŒ ->get_folio”…”�”}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjubhŒ.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KUhj{ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(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]”(jA)�”}”(hŒ``iomap_valid``”h]”hŒ iomap_valid”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjýubhŒ,: The filesystem may not hold locks between ”…”�”}”(hjýh²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjýubhŒ and ”…”�”}”(hjýh²hh³Nh´NubjA)�”}”(hŒ``->iomap_end``”h]”hŒ ->iomap_end”…”�”}”(hj% h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjýubhX 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 ”…”�”}”(hjýh²hh³Nh´Nubj)�”}”(hŒi`change in the time it takes `_”h]”hŒchange in the time it takes”…”�”}”(hj7 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œchange in the time it takes”j[ŒHhttps://lore.kernel.org/all/20221123055812.747923-8-david@fromorbit.com/”uh1jhjýubhÉ)�”}”(hŒK ”h]”h}”(h]”Œchange-in-the-time-it-takes”ah ]”h"]”Œchange in the time it takes”ah$]”h&]”Œrefuri”jG uh1hÈjjKhjýubhŒ+ to allocate, install, and lock that folio.”…”�”}”(hjýh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K]hjùubj)�”}”(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_ h²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hjg h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj_ ubhŒ or ”…”�”}”(hj_ h²hh³Nh´NubjA)�”}”(hŒ``invalidate_lock``”h]”hŒinvalidate_lock”…”�”}”(hjy h²hh³Nh´Nubah}”(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_ h²hh³Nh´NubhŒemphasis”“”)�”}”(hŒ*must*”h]”hŒmust”…”�”}”(hj� h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹ hj_ ubhŒa be revalidated after the folio lock has been taken so that iomap can manage the folio correctly.”…”�”}”(hj_ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kghjùubj)�”}”(hŒhfsdax does not need this revalidation because there's no writeback and no support for unwritten extents.”h]”hŒjfsdax does not need this revalidation because there’s no writeback and no support for unwritten extents.”…”�”}”(hj¥ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kmhjùubj)�”}”(hŒ»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.”h]”(hŒ8Filesystems subject to this kind of race must provide a ”…”�”}”(hj³ h²hh³Nh´NubjA)�”}”(hŒ``->iomap_valid``”h]”hŒ ->iomap_valid”…”�”}”(hj» h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj³ ubhŒr function to decide if the mapping is still valid. If the mapping is not valid, the mapping will be sampled again.”…”�”}”(hj³ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kphjùubj)�”}”(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]”(hŒiomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hjÛ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÓ ubhŒ function may set ”…”�”}”(hjÓ h²hh³Nh´NubjA)�”}”(hŒ!``struct iomap::validity_cookie``”h]”hŒstruct iomap::validity_cookie”…”�”}”(hjí h²hh³Nh´Nubah}”(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Ó h²hh³Nh´NubjA)�”}”(hŒ!``struct iomap::validity_cookie``”h]”hŒstruct iomap::validity_cookie”…”�”}”(hjÿ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÓ ubhŒ during ”…”�”}”(hjÓ h²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hj h²hh³Nh´Nubah}”(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Ó h²hh³Nh´NubjA)�”}”(hŒ``->iomap_valid``”h]”hŒ ->iomap_valid”…”�”}”(hj# h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÓ ubhŒC, then the iomap should considered stale and the validation failed.”…”�”}”(hjÓ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kthjùubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(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]”(jA)�”}”(hŒ``read_folio_range``”h]”hŒread_folio_range”…”�”}”(hjI h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjE 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.”…”�”}”(hjE h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K€hjA ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”j Œ-”uh1j h³hÇh´KMhjubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´KMhjÜh²hubj)�”}”(hŒIThese ``struct kiocb`` flags are significant for buffered I/O with iomap:”h]”(hŒThese ”…”�”}”(hjt h²hh³Nh´NubjA)�”}”(hŒ``struct kiocb``”h]”hŒ struct kiocb”…”�”}”(hj| h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjt ubhŒ3 flags are significant for buffered I/O with iomap:”…”�”}”(hjt h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K„hjÜh²hubj|)�”}”(hŒc* ``IOCB_NOWAIT``: Turns on ``IOMAP_NOWAIT``. * ``IOCB_DONTCACHE``: Turns on ``IOMAP_DONTCACHE``. ”h]”j)�”}”(hhh]”(j)�”}”(hŒ,``IOCB_NOWAIT``: Turns on ``IOMAP_NOWAIT``. ”h]”j)�”}”(hŒ+``IOCB_NOWAIT``: Turns on ``IOMAP_NOWAIT``.”h]”(jA)�”}”(hŒ``IOCB_NOWAIT``”h]”hŒ IOCB_NOWAIT”…”�”}”(hj£ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjŸ ubhŒ : Turns on ”…”�”}”(hjŸ h²hh³Nh´NubjA)�”}”(hŒ``IOMAP_NOWAIT``”h]”hŒ IOMAP_NOWAIT”…”�”}”(hjµ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjŸ ubhŒ.”…”�”}”(hjŸ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K†hj› ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj˜ ubj)�”}”(hŒ2``IOCB_DONTCACHE``: Turns on ``IOMAP_DONTCACHE``. ”h]”j)�”}”(hŒ1``IOCB_DONTCACHE``: Turns on ``IOMAP_DONTCACHE``.”h]”(jA)�”}”(hŒ``IOCB_DONTCACHE``”h]”hŒIOCB_DONTCACHE”…”�”}”(hjÛ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj× ubhŒ : Turns on ”…”�”}”(hj× h²hh³Nh´NubjA)�”}”(hŒ``IOMAP_DONTCACHE``”h]”hŒIOMAP_DONTCACHE”…”�”}”(hjí h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj× ubhŒ.”…”�”}”(hj× h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KˆhjÓ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj˜ ubeh}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´K†hj” ubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´K†hjÜh²hubeh}”(h]”j„ah ]”h"]”Œstruct iomap_write_ops”ah$]”h&]”uh1hähjh²hh³hÇh´K=ubhå)�”}”(hhh]”(hê)�”}”(hjœh]”jA)�”}”(hjœh]”hŒstruct iomap_read_ops”…”�”}”(hj$ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj! ubah}”(h]”h ]”h"]”h$]”h&]”j%jªuh1héhj h²hh³hÇh´K‹ubjö)�”}”(hŒÛstruct iomap_read_ops { int (*read_folio_range)(const struct iomap_iter *iter, struct iomap_read_folio_ctx *ctx, size_t len); void (*submit_read)(struct iomap_read_folio_ctx *ctx); };”h]”hŒÛstruct iomap_read_ops { int (*read_folio_range)(const struct iomap_iter *iter, struct iomap_read_folio_ctx *ctx, size_t len); void (*submit_read)(struct iomap_read_folio_ctx *ctx); };”…”�”}”hj7 sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj‰jjj}”uh1jõh³hÇh´K�hj h²hubj)�”}”(hŒiomap calls these functions:”h]”hŒiomap calls these functions:”…”�”}”(hjF h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K•hj h²hubj|)�”}”(hX>- ``read_folio_range``: Called to read in the range. This must be provided by the caller. If this succeeds, iomap_finish_folio_read() must be called after the range is read in, regardless of whether the read succeeded or failed. - ``submit_read``: Submit any pending read requests. This function is optional. ”h]”j)�”}”(hhh]”(j)�”}”(hŒã``read_folio_range``: Called to read in the range. This must be provided by the caller. If this succeeds, iomap_finish_folio_read() must be called after the range is read in, regardless of whether the read succeeded or failed. ”h]”j)�”}”(hŒâ``read_folio_range``: Called to read in the range. This must be provided by the caller. If this succeeds, iomap_finish_folio_read() must be called after the range is read in, regardless of whether the read succeeded or failed.”h]”(jA)�”}”(hŒ``read_folio_range``”h]”hŒread_folio_range”…”�”}”(hjc h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj_ ubhŒÎ: Called to read in the range. This must be provided by the caller. If this succeeds, iomap_finish_folio_read() must be called after the range is read in, regardless of whether the read succeeded or failed.”…”�”}”(hj_ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K—hj[ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjX ubj)�”}”(hŒN``submit_read``: Submit any pending read requests. This function is optional. ”h]”j)�”}”(hŒM``submit_read``: Submit any pending read requests. This function is optional.”h]”(jA)�”}”(hŒ``submit_read``”h]”hŒ submit_read”…”�”}”(hj‰ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj… ubhŒ>: Submit any pending read requests. This function is optional.”…”�”}”(hj… h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kœhj� ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjX ubeh}”(h]”h ]”h"]”h$]”h&]”j jm uh1j h³hÇh´K—hjT ubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´K—hj h²hubeh}”(h]”j°ah ]”h"]”Œstruct iomap_read_ops”ah$]”h&]”uh1hähjh²hh³hÇh´K‹ubhå)�”}”(hhh]”(hê)�”}”(hŒInternal per-Folio State”h]”hŒInternal per-Folio State”…”�”}”(hj½ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%jÌuh1héhjº h²hh³hÇh´K ubj)�”}”(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Ë h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K¢hjº h²hubj)�”}”(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]”(hŒ®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â€� ”…”�”}”(hjÙ h²hh³Nh´Nubj)�”}”(hŒ[`filesystems `_”h]”hŒ filesystems”…”�”}”(hjá h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ filesystems”j[ŒJhttps://lore.kernel.org/all/20230725122932.144426-1-ritesh.list@gmail.com/”uh1jhjÙ ubhÉ)�”}”(hŒM ”h]”h}”(h]”Œ filesystems”ah ]”h"]”Œ filesystems”ah$]”h&]”Œrefuri”jñ uh1hÈjjKhjÙ ubhŒ# and large folios in the pagecache.”…”�”}”(hjÙ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K¨hjº h²hubj)�”}”(hŒ3iomap internally tracks two state bits per fsblock:”h]”hŒ3iomap internally tracks two state bits per fsblock:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K®hjº h²hubj|)�”}”(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]”j)�”}”(hhh]”(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``: 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]”(jA)�”}”(hŒ ``uptodate``”h]”hŒuptodate”…”�”}”(hj& h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj" 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.”…”�”}”(hj" h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K°hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubj)�”}”(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]”(jA)�”}”(hŒ ``dirty``”h]”hŒdirty”…”�”}”(hjL h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjH 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.”…”�”}”(hjH h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K¶hjD ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubeh}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´K°hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´K°hjº h²hubj)�”}”(hŒêiomap 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]”(hŒwiomap also tracks the amount of read and write disk IOs that are in flight. This structure is much lighter weight than ”…”�”}”(hjv h²hh³Nh´NubjA)�”}”(hŒ``struct buffer_head``”h]”hŒstruct buffer_head”…”�”}”(hj~ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjv ubhŒ] because there is only one per folio, and the per-fsblock overhead is two bits vs. 104 bytes.”…”�”}”(hjv h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K»hjº h²hubj)�”}”(hŒ‰Filesystems wishing to turn on large folios in the pagecache should call ``mapping_set_large_folios`` when initializing the incore inode.”h]”(hŒIFilesystems wishing to turn on large folios in the pagecache should call ”…”�”}”(hj– h²hh³Nh´NubjA)�”}”(hŒ``mapping_set_large_folios``”h]”hŒmapping_set_large_folios”…”�”}”(hjž h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj– ubhŒ$ when initializing the incore inode.”…”�”}”(hj– h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KÁhjº h²hubeh}”(h]”jÒah ]”h"]”Œinternal per-folio state”ah$]”h&]”uh1hähjh²hh³hÇh´K ubhå)�”}”(hhh]”(hê)�”}”(hŒBuffered Readahead and Reads”h]”hŒBuffered Readahead and Reads”…”�”}”(hjÀ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%jîuh1héhj½ h²hh³hÇh´KÅubj)�”}”(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]”(hŒThe ”…”�”}”(hjÎ h²hh³Nh´NubjA)�”}”(hŒ``iomap_readahead``”h]”hŒiomap_readahead”…”�”}”(hjÖ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÎ ubhŒ4 function initiates readahead to the pagecache. The ”…”�”}”(hjÎ h²hh³Nh´NubjA)�”}”(hŒ``iomap_read_folio``”h]”hŒiomap_read_folio”…”�”}”(hjè h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÎ ubhŒD function reads one folio’s worth of data into the pagecache. The ”…”�”}”(hjÎ h²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hjú h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÎ ubhŒ argument to ”…”�”}”(hjÎ h²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hj h²hh³Nh´Nubah}”(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Î h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KÇhj½ h²hubj)�”}”(hŒ\Both ``iomap_readahead`` and ``iomap_read_folio`` pass in a ``struct iomap_read_folio_ctx``:”h]”(hŒBoth ”…”�”}”(hj$ h²hh³Nh´NubjA)�”}”(hŒ``iomap_readahead``”h]”hŒiomap_readahead”…”�”}”(hj, h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj$ ubhŒ and ”…”�”}”(hj$ h²hh³Nh´NubjA)�”}”(hŒ``iomap_read_folio``”h]”hŒiomap_read_folio”…”�”}”(hj> h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj$ ubhŒ pass in a ”…”�”}”(hj$ h²hh³Nh´NubjA)�”}”(hŒ``struct iomap_read_folio_ctx``”h]”hŒstruct iomap_read_folio_ctx”…”�”}”(hjP h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj$ ubhŒ:”…”�”}”(hj$ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KÎhj½ h²hubjö)�”}”(hŒ–struct iomap_read_folio_ctx { const struct iomap_read_ops *ops; struct folio *cur_folio; struct readahead_control *rac; void *read_ctx; };”h]”hŒ–struct iomap_read_folio_ctx { const struct iomap_read_ops *ops; struct folio *cur_folio; struct readahead_control *rac; void *read_ctx; };”…”�”}”hjh sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj‰jjj}”uh1jõh³hÇh´KÑhj½ h²hubhŒdefinition_list”“”)�”}”(hhh]”(hŒdefinition_list_item”“”)�”}”(hŒH``iomap_readahead`` must set: * ``ops->read_folio_range()`` and ``rac`` ”h]”(hŒterm”“”)�”}”(hŒ``iomap_readahead`` must set:”h]”(jA)�”}”(hŒ``iomap_readahead``”h]”hŒiomap_readahead”…”�”}”(hjˆ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj„ ubhŒ must set:”…”�”}”(hj„ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1j‚ h³hÇh´KÛhj~ ubhŒ definition”“”)�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hŒ(``ops->read_folio_range()`` and ``rac`` ”h]”j)�”}”(hŒ'``ops->read_folio_range()`` and ``rac``”h]”(jA)�”}”(hŒ``ops->read_folio_range()``”h]”hŒops->read_folio_range()”…”�”}”(hj° h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¬ ubhŒ and ”…”�”}”(hj¬ h²hh³Nh´NubjA)�”}”(hŒ``rac``”h]”hŒrac”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¬ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KÛhj¨ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj¥ ubah}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´KÛhj¢ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j  hj~ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j| h³hÇh´KÛhjy ubj} )�”}”(hŒO``iomap_read_folio`` must set: * ``ops->read_folio_range()`` and ``cur_folio`` ”h]”(jƒ )�”}”(hŒ``iomap_read_folio`` must set:”h]”(jA)�”}”(hŒ``iomap_read_folio``”h]”hŒiomap_read_folio”…”�”}”(hjö h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjò ubhŒ must set:”…”�”}”(hjò h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1j‚ h³hÇh´KÞhjî ubj¡ )�”}”(hhh]”j)�”}”(hhh]”j)�”}”(hŒ.``ops->read_folio_range()`` and ``cur_folio`` ”h]”j)�”}”(hŒ-``ops->read_folio_range()`` and ``cur_folio``”h]”(jA)�”}”(hŒ``ops->read_folio_range()``”h]”hŒops->read_folio_range()”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjubhŒ and ”…”�”}”(hjh²hh³Nh´NubjA)�”}”(hŒ ``cur_folio``”h]”hŒ cur_folio”…”�”}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KÞhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubah}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´KÞhjubah}”(h]”h ]”h"]”h$]”h&]”uh1j  hjî ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j| h³hÇh´KÞhjy h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jw hj½ h²hh³Nh´Nubj)�”}”(hŒ¬``ops->submit_read()`` and ``read_ctx`` are optional. ``read_ctx`` is used to pass in any custom data the caller needs accessible in the ops callbacks for fulfilling reads.”h]”(jA)�”}”(hŒ``ops->submit_read()``”h]”hŒops->submit_read()”…”�”}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj`ubhŒ and ”…”�”}”(hj`h²hh³Nh´NubjA)�”}”(hŒ ``read_ctx``”h]”hŒread_ctx”…”�”}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj`ubhŒ are optional. ”…”�”}”(hj`h²hh³Nh´NubjA)�”}”(hŒ ``read_ctx``”h]”hŒread_ctx”…”�”}”(hjˆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj`ubhŒj is used to pass in any custom data the caller needs accessible in the ops callbacks for fulfilling reads.”…”�”}”(hj`h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kàhj½ h²hubeh}”(h]”jôah ]”h"]”Œbuffered readahead and reads”ah$]”h&]”uh1hähjh²hh³hÇh´KÅubhå)�”}”(hhh]”(hê)�”}”(hŒBuffered Writes”h]”hŒBuffered Writes”…”�”}”(hjªh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%juh1héhj§h²hh³hÇh´Kåubj)�”}”(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]”(hŒThe ”…”�”}”(hj¸h²hh³Nh´NubjA)�”}”(hŒ``iomap_file_buffered_write``”h]”hŒiomap_file_buffered_write”…”�”}”(hjÀh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¸ubhŒ function writes an ”…”�”}”(hj¸h²hh³Nh´NubjA)�”}”(hŒ``iocb``”h]”hŒiocb”…”�”}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¸ubhŒ to the pagecache. ”…”�”}”(hj¸h²hh³Nh´NubjA)�”}”(hŒ``IOMAP_WRITE``”h]”hŒ IOMAP_WRITE”…”�”}”(hjäh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¸ubhŒ or ”…”�”}”(hj¸h²hh³Nh´NubjA)�”}”(hŒ``IOMAP_WRITE``”h]”hŒ IOMAP_WRITE”…”�”}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¸ubhŒ | ”…”�”}”(hj¸h²hh³Nh´NubjA)�”}”(hŒ``IOMAP_NOWAIT``”h]”hŒ IOMAP_NOWAIT”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¸ubhŒ will be passed as the ”…”�”}”(hj¸h²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¸ubhŒ argument to ”…”�”}”(hj¸h²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¸ubhŒ. Callers commonly take ”…”�”}”(hj¸h²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¸ubhŒA in either shared or exclusive mode before calling this function.”…”�”}”(hj¸h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kçhj§h²hubhå)�”}”(hhh]”(hê)�”}”(hŒmmap Write Faults”h]”hŒmmap Write Faults”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%j/uh1héhjVh²hh³hÇh´Kïubj)�”}”(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]”(hŒThe ”…”�”}”(hjgh²hh³Nh´NubjA)�”}”(hŒ``iomap_page_mkwrite``”h]”hŒiomap_page_mkwrite”…”�”}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjgubhŒ= function handles a write fault to a folio in the pagecache. ”…”�”}”(hjgh²hh³Nh´NubjA)�”}”(hŒ``IOMAP_WRITE | IOMAP_FAULT``”h]”hŒIOMAP_WRITE | IOMAP_FAULT”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjgubhŒ will be passed as the ”…”�”}”(hjgh²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hj“h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjgubhŒ argument to ”…”�”}”(hjgh²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjgubhŒ!. Callers commonly take the mmap ”…”�”}”(hjgh²hh³Nh´NubjA)�”}”(hŒ``invalidate_lock``”h]”hŒinvalidate_lock”…”�”}”(hj·h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjgubhŒ: in shared or exclusive mode before calling this function.”…”�”}”(hjgh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KñhjVh²hubeh}”(h]”j5ah ]”h"]”Œmmap write faults”ah$]”h&]”uh1hähj§h²hh³hÇh´Kïubhå)�”}”(hhh]”(hê)�”}”(hŒBuffered Write Failures”h]”hŒBuffered Write Failures”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%jQuh1héhjÖh²hh³hÇh´Kùubj)�”}”(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]”(hŒyAfter a short write to the pagecache, the areas not written will not become marked dirty. The filesystem must arrange to ”…”�”}”(hjçh²hh³Nh´Nubj)�”}”(hŒT`cancel `_”h]”hŒcancel”…”�”}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œcancel”j[ŒHhttps://lore.kernel.org/all/20221123055812.747923-6-david@fromorbit.com/”uh1jhjçubhÉ)�”}”(hŒK ”h]”h}”(h]”Œcancel”ah ]”h"]”Œcancel”ah$]”h&]”Œrefuri”jÿuh1hÈjjKhjçubhŒ such ”…”�”}”(hjçh²hh³Nh´Nubj)�”}”(hŒa`reservations `_”h]”hŒ reservations”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ reservations”j[ŒOhttps://lore.kernel.org/linux-xfs/20220817093627.GZ3600936@dread.disaster.area/”uh1jhjçubhÉ)�”}”(hŒR ”h]”h}”(h]”Œ reservations”ah ]”h"]”Œ reservations”ah$]”h&]”Œrefuri”j!uh1hÈjjKhjçubhŒ9 because writeback will not consume the reservation. The ”…”�”}”(hjçh²hh³Nh´NubjA)�”}”(hŒ ``iomap_write_delalloc_release``”h]”hŒiomap_write_delalloc_release”…”�”}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjçubhŒ can be called from a ”…”�”}”(hjçh²hh³Nh´NubjA)�”}”(hŒ``->iomap_end``”h]”hŒ ->iomap_end”…”�”}”(hjEh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjçubhŒE function to find all the clean areas of the folios caching a fresh (”…”�”}”(hjçh²hh³Nh´NubjA)�”}”(hŒ``IOMAP_F_NEW``”h]”hŒ IOMAP_F_NEW”…”�”}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjçubhŒ!) delalloc mapping. It takes the ”…”�”}”(hjçh²hh³Nh´NubjA)�”}”(hŒ``invalidate_lock``”h]”hŒinvalidate_lock”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjçubhŒ.”…”�”}”(hjçh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KûhjÖh²hubj)�”}”(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�h²hh³Nh´NubjA)�”}”(hŒ ``punch``”h]”hŒpunch”…”�”}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj�ubhŒD to be called for each file range in this state. This function must ”…”�”}”(hj�h²hh³Nh´NubjŒ )�”}”(hŒ*only*”h]”hŒonly”…”�”}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹ 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�h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MhjÖh²hubeh}”(h]”jWah ]”h"]”Œbuffered write failures”ah$]”h&]”uh1hähj§h²hh³hÇh´Kùubhå)�”}”(hhh]”(hê)�”}”(hŒZeroing for File Operations”h]”hŒZeroing for File Operations”…”�”}”(hj½h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%jsuh1héhjºh²hh³hÇh´Mubj)�”}”(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]”(hŒFilesystems can call ”…”�”}”(hjËh²hh³Nh´NubjA)�”}”(hŒ``iomap_zero_range``”h]”hŒiomap_zero_range”…”�”}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjËubhŒr to perform zeroing of the pagecache for non-truncation file operations that are not aligned to the fsblock size. ”…”�”}”(hjËh²hh³Nh´NubjA)�”}”(hŒ``IOMAP_ZERO``”h]”hŒ IOMAP_ZERO”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjËubhŒ will be passed as the ”…”�”}”(hjËh²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjËubhŒ argument to ”…”�”}”(hjËh²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjËubhŒ. Callers typically hold ”…”�”}”(hjËh²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjËubhŒ and ”…”�”}”(hjËh²hh³Nh´NubjA)�”}”(hŒ``invalidate_lock``”h]”hŒinvalidate_lock”…”�”}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjËubhŒ0 in exclusive mode before calling this function.”…”�”}”(hjËh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mhjºh²hubeh}”(h]”jyah ]”h"]”Œzeroing for file operations”ah$]”h&]”uh1hähj§h²hh³hÇh´Mubhå)�”}”(hhh]”(hê)�”}”(hŒUnsharing Reflinked File Data”h]”hŒUnsharing Reflinked File Data”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%j•uh1héhjLh²hh³hÇh´Mubj)�”}”(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]”(hŒFilesystems can call ”…”�”}”(hj]h²hh³Nh´NubjA)�”}”(hŒ``iomap_file_unshare``”h]”hŒiomap_file_unshare”…”�”}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj]ubhŒs to force a file sharing storage with another file to preemptively copy the shared data to newly allocate storage. ”…”�”}”(hj]h²hh³Nh´NubjA)�”}”(hŒ``IOMAP_WRITE | IOMAP_UNSHARE``”h]”hŒIOMAP_WRITE | IOMAP_UNSHARE”…”�”}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj]ubhŒ will be passed as the ”…”�”}”(hj]h²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj]ubhŒ argument to ”…”�”}”(hj]h²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj]ubhŒ. Callers typically hold ”…”�”}”(hj]h²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj]ubhŒ and ”…”�”}”(hj]h²hh³Nh´NubjA)�”}”(hŒ``invalidate_lock``”h]”hŒinvalidate_lock”…”�”}”(hj¿h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj]ubhŒ0 in exclusive mode before calling this function.”…”�”}”(hj]h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MhjLh²hubeh}”(h]”j›ah ]”h"]”Œunsharing reflinked file data”ah$]”h&]”uh1hähj§h²hh³hÇh´Mubeh}”(h]”jah ]”h"]”Œbuffered writes”ah$]”h&]”uh1hähjh²hh³hÇh´Kåubhå)�”}”(hhh]”(hê)�”}”(hŒ Truncation”h]”hŒ Truncation”…”�”}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%jÃuh1héhjåh²hh³hÇh´M%ubj)�”}”(hX°Filesystems 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]”(hŒFilesystems can call ”…”�”}”(hjöh²hh³Nh´NubjA)�”}”(hŒ``iomap_truncate_page``”h]”hŒiomap_truncate_page”…”�”}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjöubhŒk to zero the bytes in the pagecache from EOF to the end of the fsblock during a file truncation operation. ”…”�”•r}”(hjöh²hh³Nh´NubjA)�”}”(hŒ``truncate_setsize``”h]”hŒtruncate_setsize”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjöubhŒ or ”…”�”}”(hjöh²hh³Nh´NubjA)�”}”(hŒ``truncate_pagecache``”h]”hŒtruncate_pagecache”…”�”}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjöubhŒ3 will take care of everything after the EOF block. ”…”�”}”(hjöh²hh³Nh´NubjA)�”}”(hŒ``IOMAP_ZERO``”h]”hŒ IOMAP_ZERO”…”�”}”(hj4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjöubhŒ will be passed as the ”…”�”}”(hjöh²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjöubhŒ argument to ”…”�”}”(hjöh²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjöubhŒ. Callers typically hold ”…”�”}”(hjöh²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hjjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjöubhŒ and ”…”�”}”(hjöh²hh³Nh´NubjA)�”}”(hŒ``invalidate_lock``”h]”hŒinvalidate_lock”…”�”}”(hj|h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjöubhŒ0 in exclusive mode before calling this function.”…”�”}”(hjöh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M'hjåh²hubeh}”(h]”jÉah ]”h"]”Œ truncation”ah$]”h&]”uh1hähjh²hh³hÇh´M%ubhå)�”}”(hhh]”(hê)�”}”(hŒPagecache Writeback”h]”hŒPagecache Writeback”…”�”}”(hjžh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%jåuh1héhj›h²hh³hÇh´M2ubj)�”}”(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]”(hŒFilesystems can call ”…”�”}”(hj¬h²hh³Nh´NubjA)�”}”(hŒ``iomap_writepages``”h]”hŒiomap_writepages”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¬ubhŒF to respond to a request to write dirty pagecache folios to disk. The ”…”�”}”(hj¬h²hh³Nh´NubjA)�”}”(hŒ ``mapping``”h]”hŒmapping”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¬ubhŒ and ”…”�”}”(hj¬h²hh³Nh´NubjA)�”}”(hŒ``wbc``”h]”hŒwbc”…”�”}”(hjØh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¬ubhŒ, parameters should be passed unchanged. The ”…”�”}”(hj¬h²hh³Nh´NubjA)�”}”(hŒ``wpc``”h]”hŒwpc”…”�”}”(hjêh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¬ubhŒO pointer should be allocated by the filesystem and must be initialized to zero.”…”�”}”(hj¬h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M4hj›h²hubj)�”}”(hŒƒThe 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 ”…”�”}”(hjh²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjubhŒ or ”…”�”}”(hjh²hh³Nh´NubjA)�”}”(hŒ``invalidate_lock``”h]”hŒinvalidate_lock”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjubhŒ.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M:hj›h²hubj)�”}”(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 ”…”�”}”(hj4h²hh³Nh´NubjA)�”}”(hŒ``->writeback_range``”h]”hŒ->writeback_range”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj4ubhŒ{ machinery described below even if the writeback fails. This is to prevent dirty folio clots when storage devices fail; an ”…”�”}”(hj4h²hh³Nh´NubjA)�”}”(hŒ``-EIO``”h]”hŒ-EIO”…”�”}”(hjNh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj4ubhŒ* is recorded for userspace to collect via ”…”�”}”(hj4h²hh³Nh´NubjA)�”}”(hŒ ``fsync``”h]”hŒfsync”…”�”}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj4ubhŒ.”…”�”}”(hj4h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M>hj›h²hubj)�”}”(hŒ:The ``ops`` structure must be specified and is as follows:”h]”(hŒThe ”…”�”}”(hjxh²hh³Nh´NubjA)�”}”(hŒ``ops``”h]”hŒops”…”�”}”(hj€h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjxubhŒ/ structure must be specified and is as follows:”…”�”}”(hjxh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MChj›h²hubhå)�”}”(hhh]”(hê)�”}”(hjh]”jA)�”}”(hjh]”hŒstruct iomap_writeback_ops”…”�”}”(hjžh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj›ubah}”(h]”h ]”h"]”h$]”h&]”j%juh1héhj˜h²hh³hÇh´MFubjö)�”}”(hŒçstruct 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]”hŒçstruct 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); };”…”�”}”hj±sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj‰jjj}”uh1jõh³hÇh´MHhj˜h²hubj)�”}”(hŒThe fields are as follows:”h]”hŒThe fields are as follows:”…”�”}”(hjÀh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MPhj˜h²hubj|)�”}”(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. If this succeeds, iomap_finish_folio_write() must be called once writeback completes for the range, regardless of whether the writeback succeeded or failed. - ``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 optionally 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)�”}”(hhh]”(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. 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. If this succeeds, iomap_finish_folio_write() must be called once writeback completes for the range, regardless of whether the writeback succeeded or failed. ”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]”(jA)�”}”(hŒ``writeback_range``”h]”hŒwriteback_range”…”�”}”(hjÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÙubhŒ: Sets ”…”�”}”(hjÙh²hh³Nh´NubjA)�”}”(hŒ``wpc->iomap``”h]”hŒ wpc->iomap”…”�”}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÙubhŒ< to the space mapping of the file range (in bytes) given by ”…”�”}”(hjÙh²hh³Nh´NubjA)�”}”(hŒ ``offset``”h]”hŒoffset”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÙubhŒ and ”…”�”}”(hjÙh²hh³Nh´NubjA)�”}”(hŒ``len``”h]”hŒlen”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÙubhŒX. iomap calls this function for each dirty fs block in each dirty folio, though it will ”…”�”}”(hjÙh²hh³Nh´Nubj)�”}”(hŒT`reuse mappings `_”h]”hŒreuse mappings”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œreuse mappings”j[Œ@https://lore.kernel.org/all/20231207072710.176093-15-hch@lst.de/”uh1jhjÙubhÉ)�”}”(hŒC ”h]”h}”(h]”Œreuse-mappings”ah ]”h"]”Œreuse mappings”ah$]”h&]”Œrefuri”j5uh1hÈjjKhjÙubhŒE for runs of contiguous dirty fsblocks within a folio. Do not return ”…”�”}”(hjÙh²hh³Nh´NubjA)�”}”(hŒ``IOMAP_INLINE``”h]”hŒ IOMAP_INLINE”…”�”}”(hjGh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÙubhŒ mappings here; the ”…”�”}”(hjÙh²hh³Nh´NubjA)�”}”(hŒ``->iomap_end``”h]”hŒ ->iomap_end”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÙubhŒ@ function must deal with persisting written data. Do not return ”…”�”}”(hjÙh²hh³Nh´NubjA)�”}”(hŒ``IOMAP_DELALLOC``”h]”hŒIOMAP_DELALLOC”…”�”}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÙubhŒì 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 ”…”�”}”(hjÙh²hh³Nh´NubjA)�”}”(hŒ``iomap::validity_cookie``”h]”hŒiomap::validity_cookie”…”�”}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÙubhŒ can be reused for this purpose.”…”�”}”(hjÙh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MRhjÕubj)�”}”(hXuIf 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. If this succeeds, iomap_finish_folio_write() must be called once writeback completes for the range, regardless of whether the writeback succeeded or failed.”h]”(hŒ¸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 ”…”�”}”(hj•h²hh³Nh´NubjA)�”}”(hŒ``-EIO``”h]”hŒ-EIO”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj•ubhŒA recorded in the pagecache. Filesystems can use this callback to ”…”�”}”(hj•h²hh³Nh´Nubj)�”}”(hŒT`remove `_”h]”hŒremove”…”�”}”(hj¯h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œremove”j[ŒHhttps://lore.kernel.org/all/20201029163313.1766967-1-bfoster@redhat.com/”uh1jhj•ubhÉ)�”}”(hŒK ”h]”h}”(h]”Œremove”ah ]”h"]”Œremove”ah$]”h&]”Œrefuri”j¿uh1hÈjjKhj•ubhX  delalloc reservations to avoid having delalloc reservations for clean pagecache. This function must be supplied by the filesystem. If this succeeds, iomap_finish_folio_write() must be called once writeback completes for the range, regardless of whether the writeback succeeded or failed.”…”�”}”(hj•h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MbhjÕubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjÒubj)�”}”(hX5``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 optionally 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)�”}”(hX4``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 optionally 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]”(jA)�”}”(hŒ``writeback_submit``”h]”hŒwriteback_submit”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjáubhX5: 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 optionally hook into writeback bio submission. This might include pre-write space accounting updates, or installing a custom ”…”�”}”(hjáh²hh³Nh´NubjA)�”}”(hŒ``->bi_end_io``”h]”hŒ ->bi_end_io”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjáubhŒÜ 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.”…”�”}”(hjáh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MohjÝubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÒubeh}”(h]”h ]”h"]”h$]”h&]”j jm uh1j h³hÇh´MRhjÎubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´MRhj˜h²hubeh}”(h]”jah ]”h"]”Œstruct iomap_writeback_ops”ah$]”h&]”uh1hähj›h²hh³hÇh´MFubhå)�”}”(hhh]”(hê)�”}”(hŒPagecache Writeback Completion”h]”hŒPagecache Writeback Completion”…”�”}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%j0uh1héhj(h²hh³hÇh´Mzubj)�”}”(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]”(hŒkTo handle the bookkeeping that must happen after disk I/O for writeback completes, iomap creates chains of ”…”�”}”(hj9h²hh³Nh´NubjA)�”}”(hŒ``struct iomap_ioend``”h]”hŒstruct iomap_ioend”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj9ubhŒ objects that wrap the ”…”�”}”(hj9h²hh³Nh´NubjA)�”}”(hŒ``bio``”h]”hŒbio”…”�”}”(hjSh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj9ubhŒ— 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 ”…”�”}”(hj9h²hh³Nh´NubjA)�”}”(hŒ ``ioend``”h]”hŒioend”…”�”}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj9ubhX?. 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 ”…”�”}”(hj9h²hh³Nh´NubjA)�”}”(hŒ``->submit_writeback``”h]”hŒ->submit_writeback”…”�”}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj9ubhŒ This function should call ”…”�”}”(hj9h²hh³Nh´NubjA)�”}”(hŒ``iomap_finish_ioends``”h]”hŒiomap_finish_ioends”…”�”}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj9ubhŒA after finishing its own work (e.g. unwritten extent conversion).”…”�”}”(hj9h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M|hj(h²hubj)�”}”(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]”(hŒSome filesystems may wish to ”…”�”}”(hj¡h²hh³Nh´Nubj)�”}”(hŒ€`amortize the cost of running metadata transactions `_”h]”hŒ2amortize the cost of running metadata transactions”…”�”}”(hj©h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ2amortize the cost of running metadata transactions”j[ŒHhttps://lore.kernel.org/all/20220120034733.221737-1-david@fromorbit.com/”uh1jhj¡ubhÉ)�”}”(hŒK ”h]”h}”(h]”Œ2amortize-the-cost-of-running-metadata-transactions”ah ]”h"]”Œ2amortize the cost of running metadata transactions”ah$]”h&]”Œrefuri”j¹uh1hÈjjKhj¡ubhŒ³ 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 ”…”�”}”(hj¡h²hh³Nh´NubjA)�”}”(hŒ ``list_head``”h]”hŒ list_head”…”�”}”(hjËh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¡ubhŒ to enable batching.”…”�”}”(hj¡h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M‹hj(h²hubj)�”}”(hŒMGiven a batch of ioends, iomap has a few helpers to assist with amortization:”h]”hŒMGiven a batch of ioends, iomap has a few helpers to assist with amortization:”…”�”}”(hjãh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M“hj(h²hubj|)�”}”(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]”j)�”}”(hhh]”(j)�”}”(hŒG``iomap_sort_ioends``: Sort all the ioends in the list by file offset. ”h]”j)�”}”(hŒF``iomap_sort_ioends``: Sort all the ioends in the list by file offset.”h]”(jA)�”}”(hŒ``iomap_sort_ioends``”h]”hŒiomap_sort_ioends”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjüubhŒ1: Sort all the ioends in the list by file offset.”…”�”}”(hjüh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M–hjøubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjõubj)�”}”(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]”(jA)�”}”(hŒ``iomap_ioend_try_merge``”h]”hŒiomap_ioend_try_merge”…”�”}”(hj&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj"ubhXj: 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.”…”�”}”(hj"h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M™hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjõubj)�”}”(hŒV``iomap_finish_ioends``: Finish an ioend that possibly has other ioends linked to it. ”h]”j)�”}”(hŒU``iomap_finish_ioends``: Finish an ioend that possibly has other ioends linked to it.”h]”(jA)�”}”(hŒ``iomap_finish_ioends``”h]”hŒiomap_finish_ioends”…”�”}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjHubhŒ>: Finish an ioend that possibly has other ioends linked to it.”…”�”}”(hjHh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M¡hjDubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjõubeh}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´M–hjñubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´M–hj(h²hubeh}”(h]”j6ah ]”h"]”Œpagecache writeback completion”ah$]”h&]”uh1hähj›h²hh³hÇh´Mzubeh}”(h]”jëah ]”h"]”Œpagecache writeback”ah$]”h&]”uh1hähjh²hh³hÇh´M2ubeh}”(h]”j-ah ]”h"]”Œ buffered i/o”ah$]”h&]”uh1hähhæh²hh³hÇh´Kubhå)�”}”(hhh]”(hê)�”}”(hŒ Direct I/O”h]”hŒ Direct I/O”…”�”}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%jjuh1héhj‹h²hh³hÇh´M¥ubj)�”}”(hŒÃIn 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]”(hŒmIn Linux, direct I/O is defined as file I/O that is issued directly to storage, bypassing the pagecache. The ”…”�”}”(hjœh²hh³Nh´NubjA)�”}”(hŒ``iomap_dio_rw``”h]”hŒ iomap_dio_rw”…”�”}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjœubhŒF function implements O_DIRECT (direct I/O) reads and writes for files.”…”�”}”(hjœh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M§hj‹h²hubjö)�”}”(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);”…”�”}”hj¼sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj‰jjj}”uh1jõh³hÇh´M¬hj‹h²hubj)�”}”(hXÎThe 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]”(hŒThe filesystem can provide the ”…”�”}”(hjËh²hh³Nh´NubjA)�”}”(hŒ``dops``”h]”hŒdops”…”�”}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjËubhŒ_ parameter if it needs to perform extra work before or after the I/O is issued to storage. The ”…”�”}”(hjËh²hh³Nh´NubjA)�”}”(hŒ``done_before``”h]”hŒ done_before”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjËubhŒ€ parameter tells the how much of the request has already been transferred. It is used to continue a request asynchronously when ”…”�”}”(hjËh²hh³Nh´Nubj)�”}”(hŒ�`part of the request `_”h]”hŒpart of the request”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œpart of the request”j[Œvhttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c03098d4b9ad76bca2966a8769dcfe59f7f85103”uh1jhjËubhÉ)�”}”(hŒy ”h]”h}”(h]”Œpart-of-the-request”ah ]”h"]”Œpart of the request”ah$]”h&]”Œrefuri”juh1hÈjjKhjËubhŒ* has already been completed synchronously.”…”�”}”(hjËh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M´hj‹h²hubj)�”}”(hŒ±The ``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]”(hŒThe ”…”�”}”(hjh²hh³Nh´NubjA)�”}”(hŒ``done_before``”h]”hŒ done_before”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjubhŒ+ parameter should be set if writes for the ”…”�”}”(hjh²hh³Nh´NubjA)�”}”(hŒ``iocb``”h]”hŒiocb”…”�”}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjubhŒX have been initiated prior to the call. The direction of the I/O is determined from the ”…”�”}”(hjh²hh³Nh´NubjA)�”}”(hŒ``iocb``”h]”hŒiocb”…”�”}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjubhŒ passed in.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M½hj‹h²hubj)�”}”(hŒQThe ``dio_flags`` argument can be set to any combination of the following values:”h]”(hŒThe ”…”�”}”(hjch²hh³Nh´NubjA)�”}”(hŒ ``dio_flags``”h]”hŒ dio_flags”…”�”}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjcubhŒ@ argument can be set to any combination of the following values:”…”�”}”(hjch²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MÁhj‹h²hubj|)�”}”(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]”j)�”}”(hhh]”(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``: Wait for the I/O to complete even if the kiocb is not synchronous.”h]”(jA)�”}”(hŒ``IOMAP_DIO_FORCE_WAIT``”h]”hŒIOMAP_DIO_FORCE_WAIT”…”�”}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjŽubhŒD: Wait for the I/O to complete even if the kiocb is not synchronous.”…”�”}”(hjŽh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MÄhjŠubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj‡ubj)�”}”(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]”(jA)�”}”(hŒ``IOMAP_DIO_OVERWRITE_ONLY``”h]”hŒIOMAP_DIO_OVERWRITE_ONLY”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj´ubhŒ7: Perform a pure overwrite for this range or fail with ”…”�”}”(hj´h²hh³Nh´NubjA)�”}”(hŒ ``-EAGAIN``”h]”hŒ-EAGAIN”…”�”}”(hjÊh²hh³Nh´Nubah}”(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´h²hh³Nh´Nubj)�”}”(hŒe`detailed checking `_”h]”hŒdetailed checking”…”�”}”(hjÜh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œdetailed checking”j[ŒNhttps://lore.kernel.org/linux-ext4/20230314130759.642710-1-bfoster@redhat.com/”uh1jhj´ubhÉ)�”}”(hŒQ ”h]”h}”(h]”Œdetailed-checking”ah ]”h"]”Œdetailed checking”ah$]”h&]”Œrefuri”jìuh1hÈjjKhj´ubhŒ is required to do it ”…”�”}”(hj´h²hh³Nh´Nubj)�”}”(hŒ]`correctly `_”h]”hŒ correctly”…”�”}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ correctly”j[ŒNhttps://lore.kernel.org/linux-ext4/20230810165559.946222-1-bfoster@redhat.com/”uh1jhj´ubhÉ)�”}”(hŒQ ”h]”h}”(h]”Œ correctly”ah ]”h"]”Œ correctly”ah$]”h&]”Œrefuri”juh1hÈjjKhj´ubhŒ.”…”�”}”(hj´h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MÇhj°ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj‡ubj)�”}”(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]”(jA)�”}”(hŒ``IOMAP_DIO_PARTIAL``”h]”hŒIOMAP_DIO_PARTIAL”…”�”}”(hj4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj0ubhX: 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 ”…”�”}”(hj0h²hh³Nh´NubjA)�”}”(hŒ``done_before``”h]”hŒ done_before”…”�”}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj0ubhŒ parameter to the next call.”…”�”}”(hj0h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MØhj,ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj‡ubeh}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´MÄhjƒubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´MÄhj‹h²hubj)�”}”(hŒGThese ``struct kiocb`` flags are significant for direct I/O with iomap:”h]”(hŒThese ”…”�”}”(hjph²hh³Nh´NubjA)�”}”(hŒ``struct kiocb``”h]”hŒ struct kiocb”…”�”}”(hjxh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjpubhŒ1 flags are significant for direct I/O with iomap:”…”�”}”(hjph²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mßhj‹h²hubj|)�”}”(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``. ”h]”j)�”}”(hhh]”(j)�”}”(hŒ,``IOCB_NOWAIT``: Turns on ``IOMAP_NOWAIT``. ”h]”j)�”}”(hŒ+``IOCB_NOWAIT``: Turns on ``IOMAP_NOWAIT``.”h]”(jA)�”}”(hŒ``IOCB_NOWAIT``”h]”hŒ IOCB_NOWAIT”…”�”}”(hjŸh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj›ubhŒ : Turns on ”…”�”}”(hj›h²hh³Nh´NubjA)�”}”(hŒ``IOMAP_NOWAIT``”h]”hŒ IOMAP_NOWAIT”…”�”}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj›ubhŒ.”…”�”}”(hj›h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Máhj—ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj”ubj)�”}”(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]”(jA)�”}”(hŒ ``IOCB_SYNC``”h]”hŒ IOCB_SYNC”…”�”}”(hj×h²hh³Nh´Nubah}”(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Óh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MãhjÏubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj”ubj)�”}”(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]”(jA)�”}”(hŒ``IOCB_HIPRI``”h]”hŒ IOCB_HIPRI”…”�”}”(hjýh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjùubhŒš: 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 ”…”�”}”(hjùh²hh³Nh´NubjA)�”}”(hŒ``struct bio``”h]”hŒ struct bio”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjùubhŒ.”…”�”}”(hjùh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mèhjõubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj”ubeh}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´Máhj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´Máhj‹h²hubj)�”}”(hŒÔFilesystems 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]”(hŒFilesystems should call ”…”�”}”(hj9h²hh³Nh´NubjA)�”}”(hŒ``iomap_dio_rw``”h]”hŒ iomap_dio_rw”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj9ubhŒ from ”…”�”}”(hj9h²hh³Nh´NubjA)�”}”(hŒ``->read_iter``”h]”hŒ ->read_iter”…”�”}”(hjSh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj9ubhŒ and ”…”�”}”(hj9h²hh³Nh´NubjA)�”}”(hŒ``->write_iter``”h]”hŒ ->write_iter”…”�”}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj9ubhŒ , and set ”…”�”}”(hj9h²hh³Nh´NubjA)�”}”(hŒ``FMODE_CAN_ODIRECT``”h]”hŒFMODE_CAN_ODIRECT”…”�”}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj9ubhŒ in the ”…”�”}”(hj9h²hh³Nh´NubjA)�”}”(hŒ ``->open``”h]”hŒ->open”…”�”}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj9ubhŒ, function for the file. They should not set ”…”�”}”(hj9h²hh³Nh´NubjA)�”}”(hŒ``->direct_IO``”h]”hŒ ->direct_IO”…”�”}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj9ubhŒ, which is deprecated.”…”�”}”(hj9h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Míhj‹h²hubj)�”}”(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 ”…”�”}”(hj³h²hh³Nh´NubjA)�”}”(hŒ``__iomap_dio_rw``”h]”hŒ__iomap_dio_rw”…”�”}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj³ubhŒp. If its return value is not an error pointer or a NULL pointer, the filesystem should pass the return value to ”…”�”}”(hj³h²hh³Nh´NubjA)�”}”(hŒ``iomap_dio_complete``”h]”hŒiomap_dio_complete”…”�”}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj³ubhŒ# after finishing its internal work.”…”�”}”(hj³h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mòhj‹h²hubhå)�”}”(hhh]”(hê)�”}”(hŒ Return Values”h]”hŒ Return Values”…”�”}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%j‰uh1héhjåh²hh³hÇh´Mùubj)�”}”(hŒ1``iomap_dio_rw`` can return one of the following:”h]”(jA)�”}”(hŒ``iomap_dio_rw``”h]”hŒ iomap_dio_rw”…”�”}”(hjúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjöubhŒ! can return one of the following:”…”�”}”(hjöh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mûhjåh²hubj|)�”}”(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]”j)�”}”(hhh]”(j)�”}”(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.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mýhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(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]”(jA)�”}”(hŒ ``-ENOTBLK``”h]”hŒ-ENOTBLK”…”�”}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj5ubhŒ�: 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 ”…”�”}”(hj5h²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj5ubhŒ or ”…”�”}”(hj5h²hh³Nh´NubjA)�”}”(hŒ``->iomap_end``”h]”hŒ ->iomap_end”…”�”}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj5ubhŒ& functions may also return this value.”…”�”}”(hj5h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mÿhj1ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(hŒh``-EIOCBQUEUED``: The asynchronous direct I/O request has been queued and will be completed separately. ”h]”j)�”}”(hŒg``-EIOCBQUEUED``: The asynchronous direct I/O request has been queued and will be completed separately.”h]”(jA)�”}”(hŒ``-EIOCBQUEUED``”h]”hŒ -EIOCBQUEUED”…”�”}”(hjƒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjubhŒW: The asynchronous direct I/O request has been queued and will be completed separately.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mhj{ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)�”}”(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.”…”�”}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mhj¡ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´Mýhjubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´Mýhjåh²hubeh}”(h]”j�ah ]”h"]”Œ return values”ah$]”h&]”uh1hähj‹h²hh³hÇh´Mùubhå)�”}”(hhh]”(hê)�”}”(hŒ Direct Reads”h]”hŒ Direct Reads”…”�”}”(hjÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%j«uh1héhjÌh²hh³hÇh´M ubj)�”}”(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]”(hŒ°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 ”…”�”}”(hjÝh²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÝubhŒ value for ”…”�”}”(hjÝh²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÝubhŒ will be ”…”�”}”(hjÝh²hh³Nh´NubjA)�”}”(hŒ``IOMAP_DIRECT``”h]”hŒ IOMAP_DIRECT”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÝubhŒ4 with any combination of the following enhancements:”…”�”}”(hjÝh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M hjÌh²hubj|)�”}”(hŒ+* ``IOMAP_NOWAIT``, as defined previously. ”h]”j)�”}”(hhh]”j)�”}”(hŒ)``IOMAP_NOWAIT``, as defined previously. ”h]”j)�”}”(hŒ(``IOMAP_NOWAIT``, as defined previously.”h]”(jA)�”}”(hŒ``IOMAP_NOWAIT``”h]”hŒ IOMAP_NOWAIT”…”�”}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj,ubhŒ, as defined previously.”…”�”}”(hj,h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mhj(ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj%ubah}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´Mhj!ubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´MhjÌh²hubj)�”}”(hŒNCallers commonly hold ``i_rwsem`` in shared mode before calling this function.”h]”(hŒCallers commonly hold ”…”�”}”(hjZh²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjZubhŒ- in shared mode before calling this function.”…”�”}”(hjZh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MhjÌh²hubeh}”(h]”j±ah ]”h"]”Œ direct reads”ah$]”h&]”uh1hähj‹h²hh³hÇh´M ubhå)�”}”(hhh]”(hê)�”}”(hŒ Direct Writes”h]”hŒ Direct Writes”…”�”}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%jÍuh1héhj�h²hh³hÇh´Mubj)�”}”(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]”(hŒôA 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 ”…”�”}”(hj’h²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj’ubhŒ value for ”…”�”}”(hj’h²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hj¬h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj’ubhŒ will be ”…”�”}”(hj’h²hh³Nh´NubjA)�”}”(hŒ``IOMAP_DIRECT | IOMAP_WRITE``”h]”hŒIOMAP_DIRECT | IOMAP_WRITE”…”�”}”(hj¾h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj’ubhŒ4 with any combination of the following enhancements:”…”�”}”(hj’h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mhj�h²hubj|)�”}”(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]”j)�”}”(hhh]”(j)�”}”(hŒ)``IOMAP_NOWAIT``, as defined previously. ”h]”j)�”}”(hŒ(``IOMAP_NOWAIT``, as defined previously.”h]”(jA)�”}”(hŒ``IOMAP_NOWAIT``”h]”hŒ IOMAP_NOWAIT”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjáubhŒ, as defined previously.”…”�”}”(hjáh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M$hjÝubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÚubj)�”}”(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]”(jA)�”}”(hŒ``IOMAP_OVERWRITE_ONLY``”h]”hŒIOMAP_OVERWRITE_ONLY”…”�”}”(hj h²hh³Nh´Nubah}”(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.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M&hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÚubj)�”}”(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]”(jA)�”}”(hŒ``IOMAP_ATOMIC``”h]”hŒ IOMAP_ATOMIC”…”�”}”(hj1h²hh³Nh´Nubah}”(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-h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M.hj)ubj)�”}”(hXö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.”h]”hXø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.”…”�”}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M3hj)ubj)�”}”(hXü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]”hXü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.”…”�”}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MBhj)ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjÚubeh}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´M$hjÖubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´M$hj�h²hubj)�”}”(hŒ[Callers commonly hold ``i_rwsem`` in shared or exclusive mode before calling this function.”h]”(hŒCallers commonly hold ”…”�”}”(hjwh²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjwubhŒ: in shared or exclusive mode before calling this function.”…”�”}”(hjwh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MLhj�h²hubeh}”(h]”jÓah ]”h"]”Œ direct writes”ah$]”h&]”uh1hähj‹h²hh³hÇh´Mubhå)�”}”(hhh]”(hê)�”}”(hjëh]”jA)�”}”(hjëh]”hŒstruct iomap_dio_ops:”…”�”}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¡ubah}”(h]”h ]”h"]”h$]”h&]”j%jùuh1héhjžh²hh³hÇh´MPubjö)�”}”(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; };”…”�”}”hj·sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj‰jjj}”uh1jõh³hÇh´MQhjžh²hubj)�”}”(hŒ,The fields of this structure are as follows:”h]”hŒ,The fields of this structure are as follows:”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M[hjžh²hubj|)�”}”(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]”j)�”}”(hhh]”(j)�”}”(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]”(jA)�”}”(hŒ ``submit_io``”h]”hŒ submit_io”…”�”}”(hjãh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjßubhŒ6: iomap calls this function when it has constructed a ”…”�”}”(hjßh²hh³Nh´NubjA)�”}”(hŒ``struct bio``”h]”hŒ struct bio”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjßubhŒh object for the I/O requested, and wishes to submit it to the block device. If no function is provided, ”…”�”}”(hjßh²hh³Nh´NubjA)�”}”(hŒ``submit_bio``”h]”hŒ submit_bio”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjßubhŒ™ will be called directly. Filesystems that would like to perform additional work before (e.g. data replication for btrfs) should implement this function.”…”�”}”(hjßh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M]hjÛubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjØubj)�”}”(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]”(jA)�”}”(hŒ ``end_io``”h]”hŒend_io”…”�”}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj)ubhŒ: This is called after the ”…”�”}”(hj)h²hh³Nh´NubjA)�”}”(hŒ``struct bio``”h]”hŒ struct bio”…”�”}”(hj?h²hh³Nh´Nubah}”(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)h²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj)ubhŒ7 argument may be set to a combination of the following:”…”�”}”(hj)h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mdhj%ubj)�”}”(hhh]”(j)�”}”(hŒd``IOMAP_DIO_UNWRITTEN``: The mapping was unwritten, so the ioend should mark the extent as written. ”h]”j)�”}”(hŒc``IOMAP_DIO_UNWRITTEN``: The mapping was unwritten, so the ioend should mark the extent as written.”h]”(jA)�”}”(hŒ``IOMAP_DIO_UNWRITTEN``”h]”hŒIOMAP_DIO_UNWRITTEN”…”�”}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjpubhŒL: The mapping was unwritten, so the ioend should mark the extent as written.”…”�”}”(hjph²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mihjlubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjiubj)�”}”(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]”(jA)�”}”(hŒ``IOMAP_DIO_COW``”h]”hŒ IOMAP_DIO_COW”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj–ubhŒn: Writing to the space in the mapping required a copy on write operation, so the ioend should switch mappings.”…”�”}”(hj–h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mlhj’ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjiubeh}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´Mihj%ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjØubj)�”}”(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. ”•…vh]”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]”(jA)�”}”(hŒ ``bio_set``”h]”hŒbio_set”…”�”}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÈubhŒu: This allows the filesystem to provide a custom bio_set for allocating direct I/O bios. This enables filesystems to ”…”�”}”(hjÈh²hh³Nh´Nubj)�”}”(hŒi`stash additional per-bio information `_”h]”hŒ$stash additional per-bio information”…”�”}”(hjÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ$stash additional per-bio information”j[Œ?https://lore.kernel.org/all/20220505201115.937837-3-hch@lst.de/”uh1jhjÈubhÉ)�”}”(hŒB ”h]”h}”(h]”Œ$stash-additional-per-bio-information”ah ]”h"]”Œ$stash additional per-bio information”ah$]”h&]”Œrefuri”jîuh1hÈjjKhjÈubhŒ1 for private use. If this field is NULL, generic ”…”�”}”(hjÈh²hh³Nh´NubjA)�”}”(hŒ``struct bio``”h]”hŒ struct bio”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÈubhŒ objects will be used.”…”�”}”(hjÈh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MohjÄubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjØubeh}”(h]”h ]”h"]”h$]”h&]”j jm uh1j h³hÇh´M]hjÔubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´M]hjžh²hubj)�”}”(hŒèFilesystems 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]”(hŒXFilesystems that want to perform extra work after an I/O completion should set a custom ”…”�”}”(hj*h²hh³Nh´NubjA)�”}”(hŒ``->bi_end_io``”h]”hŒ ->bi_end_io”…”�”}”(hj2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj*ubhŒ function via ”…”�”}”(hj*h²hh³Nh´NubjA)�”}”(hŒ``->submit_io``”h]”hŒ ->submit_io”…”�”}”(hjDh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj*ubhŒ2. Afterwards, the custom endio function must call ”…”�”}”(hj*h²hh³Nh´NubjA)�”}”(hŒ``iomap_dio_bio_end_io``”h]”hŒiomap_dio_bio_end_io”…”�”}”(hjVh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj*ubhŒ to finish the direct I/O.”…”�”}”(hj*h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mvhjžh²hubeh}”(h]”jÿah ]”h"]”Œstruct iomap_dio_ops:”ah$]”h&]”uh1hähj‹h²hh³hÇh´MPubeh}”(h]”jpah ]”h"]”Œ direct i/o”ah$]”h&]”uh1hähhæh²hh³hÇh´M¥ubhå)�”}”(hhh]”(hê)�”}”(hŒDAX I/O”h]”hŒDAX I/O”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%j'uh1héhj|h²hh³hÇh´M|ubj)�”}”(hŒ³Some 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]”hŒ·Some 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.”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M~hj|h²hubhå)�”}”(hhh]”(hê)�”}”(hŒ fsdax Reads”h]”hŒ fsdax Reads”…”�”}”(hjžh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%jFuh1héhj›h²hh³hÇh´Mƒubj)�”}”(hŒ¾A 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]”(hŒQA fsdax read performs a memcpy from storage device to the caller’s buffer. The ”…”�”}”(hj¬h²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¬ubhŒ value for ”…”�”}”(hj¬h²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¬ubhŒ will be ”…”�”}”(hj¬h²hh³Nh´NubjA)�”}”(hŒ ``IOMAP_DAX``”h]”hŒ IOMAP_DAX”…”�”}”(hjØh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¬ubhŒ4 with any combination of the following enhancements:”…”�”}”(hj¬h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M…hj›h²hubj|)�”}”(hŒ+* ``IOMAP_NOWAIT``, as defined previously. ”h]”j)�”}”(hhh]”j)�”}”(hŒ)``IOMAP_NOWAIT``, as defined previously. ”h]”j)�”}”(hŒ(``IOMAP_NOWAIT``, as defined previously.”h]”(jA)�”}”(hŒ``IOMAP_NOWAIT``”h]”hŒ IOMAP_NOWAIT”…”�”}”(hjÿh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjûubhŒ, as defined previously.”…”�”}”(hjûh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MŠhj÷ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjôubah}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´MŠhjðubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´MŠhj›h²hubj)�”}”(hŒNCallers commonly hold ``i_rwsem`` in shared mode before calling this function.”h]”(hŒCallers commonly hold ”…”�”}”(hj)h²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hj1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj)ubhŒ- in shared mode before calling this function.”…”�”}”(hj)h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MŒhj›h²hubeh}”(h]”jLah ]”h"]”Œ fsdax reads”ah$]”h&]”uh1hähj|h²hh³hÇh´Mƒubhå)�”}”(hhh]”(hê)�”}”(hŒ fsdax Writes”h]”hŒ fsdax Writes”…”�”}”(hjSh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%jhuh1héhjPh²hh³hÇh´M�ubj)�”}”(hŒÒA 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]”(hŒWA fsdax write initiates a memcpy to the storage device from the caller’s buffer. The ”…”�”}”(hjah²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjaubhŒ value for ”…”�”}”(hjah²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hj{h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjaubhŒ will be ”…”�”}”(hjah²hh³Nh´NubjA)�”}”(hŒ``IOMAP_DAX | IOMAP_WRITE``”h]”hŒIOMAP_DAX | IOMAP_WRITE”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjaubhŒ4 with any combination of the following enhancements:”…”�”}”(hjah²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M’hjPh²hubj|)�”}”(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]”j)�”}”(hhh]”(j)�”}”(hŒ)``IOMAP_NOWAIT``, as defined previously. ”h]”j)�”}”(hŒ(``IOMAP_NOWAIT``, as defined previously.”h]”(jA)�”}”(hŒ``IOMAP_NOWAIT``”h]”hŒ IOMAP_NOWAIT”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj°ubhŒ, as defined previously.”…”�”}”(hj°h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M—hj¬ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj©ubj)�”}”(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]”(jA)�”}”(hŒ``IOMAP_OVERWRITE_ONLY``”h]”hŒIOMAP_OVERWRITE_ONLY”…”�”}”(hjÚh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÖubhŒ�: The caller requires a pure overwrite to be performed from this mapping. This requires the filesystem extent mapping to already exist as an ”…”�”}”(hjÖh²hh³Nh´NubjA)�”}”(hŒ``IOMAP_MAPPED``”h]”hŒ IOMAP_MAPPED”…”�”}”(hjìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÖubhŒ× 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 ”…”�”}”(hjÖh²hh³Nh´NubjA)�”}”(hŒ ``-EAGAIN``”h]”hŒ-EAGAIN”…”�”}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÖubhŒ.”…”�”}”(hjÖh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M™hjÒubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj©ubeh}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´M—hj¥ubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´M—hjPh²hubj)�”}”(hŒQCallers commonly hold ``i_rwsem`` in exclusive mode before calling this function.”h]”(hŒCallers commonly hold ”…”�”}”(hj( h²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hj0 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj( ubhŒ0 in exclusive mode before calling this function.”…”�”}”(hj( h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M¢hjPh²hubhå)�”}”(hhh]”(hê)�”}”(hŒfsdax mmap Faults”h]”hŒfsdax mmap Faults”…”�”}”(hjK h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%j‡uh1héhjH h²hh³hÇh´M¦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]”(hŒThe ”…”�”}”(hjY h²hh³Nh´NubjA)�”}”(hŒ``dax_iomap_fault``”h]”hŒdax_iomap_fault”…”�”}”(hja h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjY ubhŒL function handles read and write faults to fsdax storage. For a read fault, ”…”�”}”(hjY h²hh³Nh´NubjA)�”}”(hŒ``IOMAP_DAX | IOMAP_FAULT``”h]”hŒIOMAP_DAX | IOMAP_FAULT”…”�”}”(hjs h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjY ubhŒ will be passed as the ”…”�”}”(hjY h²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hj… h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjY ubhŒ argument to ”…”�”}”(hjY h²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hj— h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjY ubhŒ. For a write fault, ”…”�”}”(hjY h²hh³Nh´NubjA)�”}”(hŒ)``IOMAP_DAX | IOMAP_FAULT | IOMAP_WRITE``”h]”hŒ%IOMAP_DAX | IOMAP_FAULT | IOMAP_WRITE”…”�”}”(hj© h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjY ubhŒ will be passed as the ”…”�”}”(hjY h²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hj» h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjY ubhŒ argument to ”…”�”}”hjY sbjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hjÍ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjY ubhŒ.”…”�”}”(hjY h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M¨hjH h²hubj)�”}”(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.”…”�”}”(hjå h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M¯hjH h²hubeh}”(h]”j�ah ]”h"]”Œfsdax mmap faults”ah$]”h&]”uh1hähjPh²hh³hÇh´M¦ubeh}”(h]”jnah ]”h"]”Œ fsdax writes”ah$]”h&]”uh1hähj|h²hh³hÇh´M�ubhå)�”}”(hhh]”(hê)�”}”(hŒ*fsdax Truncation, fallocate, and Unsharing”h]”hŒ*fsdax Truncation, fallocate, and Unsharing”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%jµuh1héhj!h²hh³hÇh´M³ubj)�”}”(hŒÚFor 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]”(hŒmFor fsdax files, the following functions are provided to replace their iomap pagecache I/O counterparts. The ”…”�”}”(hj!h²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj!ubhŒ argument to ”…”�”}”(hj!h²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hj,!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj!ubhŒ2 are the same as the pagecache counterparts, with ”…”�”}”(hj!h²hh³Nh´NubjA)�”}”(hŒ ``IOMAP_DAX``”h]”hŒ IOMAP_DAX”…”�”}”(hj>!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj!ubhŒ added.”…”�”}”(hj!h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mµhj!h²hubj|)�”}”(hŒD* ``dax_file_unshare`` * ``dax_zero_range`` * ``dax_truncate_page`` ”h]”j)�”}”(hhh]”(j)�”}”(hŒ``dax_file_unshare``”h]”j)�”}”(hj_!h]”jA)�”}”(hj_!h]”hŒdax_file_unshare”…”�”}”(hjd!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hja!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mºhj]!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjZ!ubj)�”}”(hŒ``dax_zero_range``”h]”j)�”}”(hj!h]”jA)�”}”(hj!h]”hŒdax_zero_range”…”�”}”(hj„!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj�!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M»hj}!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjZ!ubj)�”}”(hŒ``dax_truncate_page`` ”h]”j)�”}”(hŒ``dax_truncate_page``”h]”jA)�”}”(hj£!h]”hŒdax_truncate_page”…”�”}”(hj¥!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj¡!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M¼hj�!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjZ!ubeh}”(h]”h ]”h"]”h$]”h&]”j j uh1j h³hÇh´MºhjV!ubah}”(h]”h ]”h"]”h$]”h&]”uh1j{h³hÇh´Mºhj!h²hubj)�”}”(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.”…”�”}”(hjÊ!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M¾hj!h²hubeh}”(h]”j»ah ]”h"]”Œ*fsdax truncation, fallocate, and unsharing”ah$]”h&]”uh1hähj|h²hh³hÇh´M³ubhå)�”}”(hhh]”(hê)�”}”(hŒfsdax Deduplication”h]”hŒfsdax Deduplication”…”�”}”(hjâ!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%j×uh1héhjß!h²hh³hÇh´MÂubj)�”}”(hŒˆFilesystems implementing the ``FIDEDUPERANGE`` ioctl must call the ``dax_remap_file_range_prep`` function with their own iomap read ops.”h]”(hŒFilesystems implementing the ”…”�”}”(hjð!h²hh³Nh´NubjA)�”}”(hŒ``FIDEDUPERANGE``”h]”hŒ FIDEDUPERANGE”…”�”}”(hjø!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjð!ubhŒ ioctl must call the ”…”�”}”(hjð!h²hh³Nh´NubjA)�”}”(hŒ``dax_remap_file_range_prep``”h]”hŒdax_remap_file_range_prep”…”�”}”(hj "h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjð!ubhŒ( function with their own iomap read ops.”…”�”}”(hjð!h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MÄhjß!h²hubeh}”(h]”jÝah ]”h"]”Œfsdax deduplication”ah$]”h&]”uh1hähj|h²hh³hÇh´MÂubeh}”(h]”j-ah ]”h"]”Œdax i/o”ah$]”h&]”uh1hähhæh²hh³hÇh´M|ubhå)�”}”(hhh]”(hê)�”}”(hŒ Seeking Files”h]”hŒ Seeking Files”…”�”}”(hj3"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%juh1héhj0"h²hh³hÇh´MÈubj)�”}”(hŒNiomap implements the two iterating whence modes of the ``llseek`` system call.”h]”(hŒ7iomap implements the two iterating whence modes of the ”…”�”}”(hjA"h²hh³Nh´NubjA)�”}”(hŒ ``llseek``”h]”hŒllseek”…”�”}”(hjI"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjA"ubhŒ system call.”…”�”}”(hjA"h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MÊhj0"h²hubhå)�”}”(hhh]”(hê)�”}”(hŒ SEEK_DATA”h]”hŒ SEEK_DATA”…”�”}”(hjd"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%j$uh1héhja"h²hh³hÇh´MÎubj)�”}”(hŒ¤The ``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]”(hŒThe ”…”�”}”(hjr"h²hh³Nh´NubjA)�”}”(hŒ``iomap_seek_data``”h]”hŒiomap_seek_data”…”�”}”(hjz"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjr"ubhŒB function implements the SEEK_DATA “whenceâ€� value for llseek. ”…”�”}”(hjr"h²hh³Nh´NubjA)�”}”(hŒ``IOMAP_REPORT``”h]”hŒ IOMAP_REPORT”…”�”}”(hjŒ"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjr"ubhŒ will be passed as the ”…”�”}”(hjr"h²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hjž"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjr"ubhŒ argument to ”…”�”}”(hjr"h²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hj°"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjr"ubhŒ.”…”�”}”(hjr"h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MÐhja"h²hubj)�”}”(hŒ®For 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]”hŒ®For 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È"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MÕhja"h²hubj)�”}”(hŒNCallers commonly hold ``i_rwsem`` in shared mode before calling this function.”h]”(hŒCallers commonly hold ”…”�”}”(hjÖ"h²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hjÞ"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjÖ"ubhŒ- in shared mode before calling this function.”…”�”}”(hjÖ"h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´MÙhja"h²hubeh}”(h]”j*ah ]”h"]”Œ seek_data”ah$]”h&]”uh1hähj0"h²hh³hÇh´MÎubhå)�”}”(hhh]”(hê)�”}”(hŒ SEEK_HOLE”h]”hŒ SEEK_HOLE”…”�”}”(hj#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%jFuh1héhjý"h²hh³hÇh´MÝubj)�”}”(hŒ¤The ``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]”(hŒThe ”…”�”}”(hj#h²hh³Nh´NubjA)�”}”(hŒ``iomap_seek_hole``”h]”hŒiomap_seek_hole”…”�”}”(hj#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj#ubhŒB function implements the SEEK_HOLE “whenceâ€� value for llseek. ”…”�”}”(hj#h²hh³Nh´NubjA)�”}”(hŒ``IOMAP_REPORT``”h]”hŒ IOMAP_REPORT”…”�”}”(hj(#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj#ubhŒ will be passed as the ”…”�”}”(hj#h²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hj:#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj#ubhŒ argument to ”…”�”}”(hj#h²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hjL#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj#ubhŒ.”…”�”}”(hj#h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mßhjý"h²hubj)�”}”(hŒ³For 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]”hŒ³For 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#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mähjý"h²hubj)�”}”(hŒNCallers commonly hold ``i_rwsem`` in shared mode before calling this function.”h]”(hŒCallers commonly hold ”…”�”}”(hjr#h²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hjz#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjr#ubhŒ- in shared mode before calling this function.”…”�”}”(hjr#h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mèhjý"h²hubeh}”(h]”jLah ]”h"]”Œ seek_hole”ah$]”h&]”uh1hähj0"h²hh³hÇh´MÝubeh}”(h]”j ah ]”h"]”Œ seeking files”ah$]”h&]”uh1hähhæh²hh³hÇh´MÈubhå)�”}”(hhh]”(hê)�”}”(hŒSwap File Activation”h]”hŒSwap File Activation”…”�”}”(hj£#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%jtuh1héhj #h²hh³hÇh´Mìubj)�”}”(hXÂThe ``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]”(hŒThe ”…”�”}”(hj±#h²hh³Nh´NubjA)�”}”(hŒ``iomap_swapfile_activate``”h]”hŒiomap_swapfile_activate”…”�”}”(hj¹#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj±#ubhŒm function finds all the base-page aligned regions in a file and sets them up as swap space. The file will be ”…”�”}”(hj±#h²hh³Nh´NubjA)�”}”(hŒ ``fsync()``”h]”hŒfsync()”…”�”}”(hjË#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj±#ubhŒ’d before activation. ”…”�”}”(hj±#h²hh³Nh´NubjA)�”}”(hŒ``IOMAP_REPORT``”h]”hŒ IOMAP_REPORT”…”�”}”(hjÝ#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj±#ubhŒ will be passed as the ”…”�”}”(hj±#h²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hjï#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj±#ubhŒ argument to ”…”�”}”(hj±#h²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hj$h²hh³Nh´Nubah}”(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±#h²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj±#ubhŒ0 in exclusive mode; this is already provided by ”…”�”}”(hj±#h²hh³Nh´NubjA)�”}”(hŒ ``swapon``”h]”hŒswapon”…”�”}”(hj%$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj±#ubhŒ.”…”�”}”(hj±#h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mîhj #h²hubeh}”(h]”jzah ]”h"]”Œswap file activation”ah$]”h&]”uh1hähhæh²hh³hÇh´Mìubhå)�”}”(hhh]”(hê)�”}”(hŒFile Space Mapping Reporting”h]”hŒFile Space Mapping Reporting”…”�”}”(hjG$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%j–uh1héhjD$h²hh³hÇh´Mùubj)�”}”(hŒiomap_begin``. Callers commonly hold ``i_rwsem`` in shared mode before calling this function.”h]”(hŒThe ”…”�”}”(hjt$h²hh³Nh´NubjA)�”}”(hŒ``iomap_fiemap``”h]”hŒ iomap_fiemap”…”�”}”(hj|$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjt$ubhŒS function exports file extent mappings to userspace in the format specified by the ”…”�”}”(hjt$h²hh³Nh´NubjA)�”}”(hŒ``FS_IOC_FIEMAP``”h]”hŒ FS_IOC_FIEMAP”…”�”}”(hjŽ$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjt$ubhŒ ioctl. ”…”�”}”(hjt$h²hh³Nh´NubjA)�”}”(hŒ``IOMAP_REPORT``”h]”hŒ IOMAP_REPORT”…”�”}”(hj $h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjt$ubhŒ will be passed as the ”…”�”}”(hjt$h²hh³Nh´NubjA)�”}”(hŒ ``flags``”h]”hŒflags”…”�”}”(hj²$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjt$ubhŒ argument to ”…”�”}”(hjt$h²hh³Nh´NubjA)�”}”(hŒ``->iomap_begin``”h]”hŒ ->iomap_begin”…”�”}”(hjÄ$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjt$ubhŒ. Callers commonly hold ”…”�”}”(hjt$h²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hjÖ$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hjt$ubhŒ- in shared mode before calling this function.”…”�”}”(hjt$h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Mhjc$h²hubeh}”(h]”j»ah ]”h"]”Œ fs_ioc_fiemap”ah$]”h&]”uh1hähjD$h²hh³hÇh´Mþubhå)�”}”(hhh]”(hê)�”}”(hŒFIBMAP (deprecated)”h]”hŒFIBMAP (deprecated)”…”�”}”(hjø$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”j%j×uh1héhjõ$h²hh³hÇh´Mubj)�”}”(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]”(jA)�”}”(hŒ``iomap_bmap``”h]”hŒ iomap_bmap”…”�”}”(hj %h²hh³Nh´Nubah}”(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%h²hh³Nh´NubhŒstrong”“”)�”}”(hŒ**not**”h]”hŒnot”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j%hj%ubhŒ^ add a FIBMAP implementation to filesystems that do not have it. Callers should probably hold ”…”�”}”(hj%h²hh³Nh´NubjA)�”}”(hŒ ``i_rwsem``”h]”hŒi_rwsem”…”�”}”(hj0%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j@hj%ubhŒB in shared mode before calling this function, but this is unclear.”…”�”}”(hj%h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´M hjõ$h²hubeh}”(h]”jÝah ]”h"]”Œfibmap (deprecated)”ah$]”h&]”uh1hähjD$h²hh³hÇh´Mubeh}”(h]”jœah ]”h"]”Œfile space mapping reporting”ah$]”h&]”uh1hähhæh²hh³hÇh´Mùubeh}”(h]”Œsupported-file-operations”ah ]”h"]”Œsupported file operations”ah$]”h&]”uh1hähhh²hh³hÇh´K ubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(héNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j�%Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(hÓhÐj[%jX%jjþjˆj-jÙjXj j„jfjcjÓjÐjQ jN j· j°jº jÒjû jø j¤jôjâjjÓj5j·jWj jj+j(jIjyjÛj›j˜jÉj�jëj%jj?j<jÉjÆjzj6jÃjÀjyjpjjjöjójjjÉj�j~j±j›jÓjrjÿjøjõj-"j-jMjLjþ jnj÷ j�jÜ!j»j&"jÝj�#j jú"j*j–#jLjA$jzjS%jœjò$j»jL%jÝuŒ nametypes”}”(hÓˆj[%‰j‰jˆ‰jÙ‰j ‰jfˆjÓˆjQ ˆj· ‰jº ‰jû ˆj¤‰jâ‰jÓ‰j·‰j ˆj+ˆjI‰jÛ‰j˜‰j�‰j%‰j?ˆjɈjz‰jÈjy‰jˆjöˆjˆjɉj~‰j›‰jr‰jøˆj-"‰jM‰jþ ‰j÷ ‰jÜ!‰j&"‰j�#‰jú"‰j–#‰jA$‰jS%‰jò$‰jL%‰uh}”(hÐhÊjX%hæjþhûj-jjXjTj„jÜjcj]jÐjÊjN jH j°j jÒjº jø jò jôj½ jj§j5jVjWjÖjjj(j"jyjºj›jLjÉjåjëj›jj˜j<j6jÆjÀj6j(jÀjºjpj‹jjjójíjjj�jåj±jÌjÓj�jÿjžjõjïj-j|jLj›jnjPj�jH j»j!jÝjß!j j0"j*ja"jLjý"jzj #jœjD$j»jc$jÝjõ$j'jjRj=j~jkjªj—jÌjÃjîjåjjj/j&jQjHjsjjj•jŒjÃjºjåjÜjjûj0j'jjjaj‰j€j«j¢jÍjÄjùjæj'jjFj=jhj_j‡j~jµj¬j×jÎjjüj$jjFj=jtjkj–j�jµj¬j×jÎuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”j�%K!s…”R”Œparse_messages”]”Œtransform_messages”]”hŒsystem_message”“”)�”}”(hhh]”j)�”}”(hhh]”hŒ6Hyperlink target "iomap_operations" is not referenced.”…”�”}”hjê%sbah}”(h]”h ]”h"]”h$]”h&]”uh1jhjç%ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”hÇŒline”Kuh1jå%ubaŒ transformer”NŒ include_log”]”Œ decoration”Nh²hub.