summaryrefslogtreecommitdiff
path: root/Documentation/filesystems
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-10-19 20:12:19 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2026-10-19 20:12:19 -1000
commit2a49d49159b76f6dd587131b3765d3458cc3aa01 (patch)
tree72eabce46a7e55b7ba1d201b87e3eaef1cd73912 /Documentation/filesystems
parent0cbcaf75a1eb0dd9e800f66324fe4a295a251ccc (diff)
parentb6134f76740497004f72954ae67bd4ba45d2f044 (diff)
Merge tag 'vfs-7.4-rc1.netfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
Pull netfs updates from Christian Brauner: "This contains the netfs and cachefiles changes for this cycle from David. Cachefiles learns to cache the most common class of files properly, files that are created or truncated, written once sequentially and closed. So far it relied on the backing filesystem's idea of what is stored and asked with SEEK_DATA and SEEK_HOLE before every read it prepared, two seeks per read, and the backing filesystem is free to insert or remove runs of zeros which produces false positives and false negatives. The object type in the state xattr is now actually set to CACHEFILES_CONTENT_{SINGLE,ALL,BACKFS_MAP} instead of zero. For files written contiguously the type is ALL, the backing file's i_size tracks how much is cached and the object size lives in the xattr, and reads skip the seeks entirely. Netfslib queries the cache occupancy through a new ->query_occupancy() method that returns up to two extents at once, ->prepare_read() only limits the size of a cache read anymore and a new ->collect_write() lets the cache update its metadata once a contiguous run of writes completes. The state xattr is preset when the tmpfile is created so ENOSPC from setxattr can't scrap a fully written cache file. Two fixes for this followed, one for resize handling where the cache's idea of the size can be stale and one for an unset error that hung a request on a failed cache write. Preparatory work converts file positions that can't be negative to uoff_t, removes the writethrough code whose locking looked like it could deadlock with ceph snapshots, makes the deprecated PG_private_2 support opt-in so mm can get its page bit back, adds helpers for the NETFS_RREQ_ALL_QUEUED barriers and adds the cache object id to the read and write tracepoints. Plus an unused header removal and two documentation fixes" * tag 'vfs-7.4-rc1.netfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: fscache, cachefiles: Fix resize handling cachefiles: Fix unset error when calling netfs_prepare_write_failed() netfs: remove unused fscache_internal.h header cachefiles: Preset the state xattr when creating a new file cachefiles: Don't rely on backing fs storage map for most use cases netfs: Document the remote size member and its accessors cachefiles: Add a tracepoint to log insufficient space errors netfs, cachefiles: Add a couple of traces for write failure cachefiles: Clean up cachefiles_do_prepare_read() netfs: Set subrequest->source at alloc before trace emission netfs: Add some functions to wrap the all-queued handling netfs: Make deprecated PG_private_2 support opt-in netfs: Add the cache object ID to netfs_read/write tracepoints netfs: trace: Rejig a couple of the tracepoints cachefiles: Fix path of the "debug" module parameter in help paragraph netfs: trace: Change the "clear" folio traces to "endwb" netfs: Remove the writethrough code netfs: Use uoff_t instead of unsigned long long and loff_t
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r--Documentation/filesystems/caching/backend-api.rst2
-rw-r--r--Documentation/filesystems/caching/netfs-api.rst2
-rw-r--r--Documentation/filesystems/netfs_library.rst7
3 files changed, 7 insertions, 4 deletions
diff --git a/Documentation/filesystems/caching/backend-api.rst b/Documentation/filesystems/caching/backend-api.rst
index 3a199fc50828..df837531b3fd 100644
--- a/Documentation/filesystems/caching/backend-api.rst
+++ b/Documentation/filesystems/caching/backend-api.rst
@@ -339,7 +339,7 @@ pointers to methods to allow fscache to request management of the cache:
* Change the size of a data storage object [mandatory]::
void (*resize_cookie)(struct netfs_cache_resources *cres,
- loff_t new_size);
+ loff_t new_size, bool shrank);
This method is called to inform the cache backend of a change in size of
the netfs file due to local truncation. The cache backend should make all
diff --git a/Documentation/filesystems/caching/netfs-api.rst b/Documentation/filesystems/caching/netfs-api.rst
index 665b27f1556e..3154a1686480 100644
--- a/Documentation/filesystems/caching/netfs-api.rst
+++ b/Documentation/filesystems/caching/netfs-api.rst
@@ -226,7 +226,7 @@ If a network filesystem file is resized locally by truncation, the following
should be called to notify the cache::
void fscache_resize_cookie(struct fscache_cookie *cookie,
- loff_t new_size);
+ loff_t new_size, bool shrank);
The caller must have first marked the cookie in-use. The cookie and the new
size are passed in and the cache is synchronously resized. This is expected to
diff --git a/Documentation/filesystems/netfs_library.rst b/Documentation/filesystems/netfs_library.rst
index a9de281db8ee..215a6621f3d3 100644
--- a/Documentation/filesystems/netfs_library.rst
+++ b/Documentation/filesystems/netfs_library.rst
@@ -195,7 +195,7 @@ structure is defined::
struct inode inode;
const struct netfs_request_ops *ops;
struct fscache_cookie * cache;
- loff_t remote_i_size;
+ loff_t _remote_i_size;
unsigned long flags;
...
};
@@ -229,11 +229,14 @@ filesystem:
Local caching cookie, or NULL if no caching is enabled. This field does not
exist if fscache is disabled.
- * ``remote_i_size``
+ * ``_remote_i_size``
The size of the file on the server. This differs from inode->i_size if
local modifications have been made but not yet written back.
+ Use netfs_read_remote_i_size() and netfs_write_remote_i_size() to access
+ this field. Hold inode->i_lock when writing it.
+
* ``flags``
A set of flags, some of which the filesystem might be interested in: