Documentation/filesystems/caching/fscache.rst

Source file repositories/reference/linux-study-clean/Documentation/filesystems/caching/fscache.rst

File Facts

System
Linux kernel
Corpus path
Documentation/filesystems/caching/fscache.rst
Extension
.rst
Size
15238 bytes
Lines
349
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

.. SPDX-License-Identifier: GPL-2.0

==========================
General Filesystem Caching
==========================

Overview
========

This facility is a general purpose cache for network filesystems, though it
could be used for caching other things such as ISO9660 filesystems too.

FS-Cache mediates between cache backends (such as CacheFiles) and network
filesystems::

	+---------+
	|         |                                    +--------------+
	|   NFS   |--+                                 |              |
	|         |  |                             +-->|   CacheFS    |
	+---------+  |               +----------+  |   |  /dev/hda5   |
	             |               |          |  |   +--------------+
	+---------+  +-------------->|          |  |
	|         |      +-------+   |          |--+
	|   AFS   |----->|       |   | FS-Cache |
	|         |      | netfs |-->|          |--+
	+---------+  +-->|  lib  |   |          |  |
	             |   |       |   |          |  |   +--------------+
	+---------+  |   +-------+   +----------+  |   |              |
	|         |  |                             +-->|  CacheFiles  |
	|   9P    |--+                                 |  /var/cache  |
	|         |                                    +--------------+
	+---------+

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::

	+---------+
	|         |
	| Server  |
	|         |
	+---------+
	     |                  NETWORK
	~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	     |
	     |           +----------+
	     V           |          |
	+---------+      |          |
	|         |      |          |
	|   NFS   |----->| FS-Cache |
	|         |      |          |--+
	+---------+      |          |  |   +--------------+   +--------------+
	     |           |          |  |   |              |   |              |
	     V           +----------+  +-->|  CacheFiles  |-->|  Ext3        |
	+---------+                        |  /var/cache  |   |  /dev/sda6   |
	|         |                        +--------------+   +--------------+
	|   VFS   |                                ^                     ^
	|         |                                |                     |
	+---------+                                +--------------+      |
	     |                  KERNEL SPACE                      |      |
	~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~|~~~~
	     |                  USER SPACE                        |      |
	     V                                                    |      |
	+---------+                                           +--------------+
	|         |                                           |              |
	| Process |                                           | cachefilesd  |
	|         |                                           |              |
	+---------+                                           +--------------+

Annotation

Implementation Notes