Lines Matching +full:i +full:- +full:cache +full:- +full:size
1 .. SPDX-License-Identifier: GPL-2.0
9 - Overview.
10 - Per-inode context.
11 - Inode context helper functions.
12 - Buffered read helpers.
13 - Read helper functions.
14 - Read helper structures.
15 - Read helper operations.
16 - Read helper procedure.
17 - Read helper cache API.
33 Per-Inode Context
43 struct fscache_cookie *cache;
69 * ``cache``
76 ------------------------------
78 To help deal with the per-inode context, a number helper functions are
89 and finally, a function to get the cache cookie pointer from the context
98 The library provides a set of read helpers that handle the ->read_folio(),
99 ->readahead() and much of the ->write_begin() VM operations and translate them
116 * Handle local caching, allowing cached data and server-read data to be
121 * Handle retrying of reads that failed, switching reads from the cache to the
125 local encryption of data to be stored remotely or in the cache.
133 ---------------------
149 state in the per-inode context.
151 For ->readahead() and ->read_folio(), the network filesystem just point directly
152 at the corresponding read helper; whereas for ->write_begin(), it may be a
161 If an error occurs, the ->free_request() will be called to clean up the
174 the operation was asynchronous (ie. whether the follow-on processing can be
179 ----------------------
203 may or may not point to inode->i_data.
207 Resources for the local cache to use, if present.
218 may be altered by the ->expand_readahead() op.
222 The size of the file at the start of the request.
264 network filesystem or cache should start the operation this far into the
271 or cache:
280 This is a hint to the cache that it might want to try skipping ahead to
290 ----------------------
321 [Optional] This is called to allow the filesystem to expand the size of a
327 Expansion is communicated by changing ->start and ->len in the request
328 structure. Note that if any change is made, ->len must be increased by at
329 least as much as ->start is reduced.
333 [Optional] This is called to allow the filesystem to reduce the size of a
343 reading. In the subrequest, ->start, ->len and ->transferred indicate what
349 uptodate, unlocking them or dropping their refs - the helpers need to deal
350 with this as they have to coordinate with copying to the local cache.
360 cache is still valid. It should return true if it is still valid and false
382 ---------------------
388 * For readahead, allow the local cache and then the network filesystem to
391 be performed, though this may not get written to the cache in its entirety.
395 * If a local cache is present, it gets to do the slicing, otherwise the
398 * The network filesystem gets to clamp the size of each slice if it is to be
401 * The helpers issue a read from the cache or a read from the server or just
411 * Failed cache requests are issued against the server instead.
418 * The cache may need to skip holes that it can't do DIO from.
427 * If a cache is present, will be marked with PG_fscache.
431 * Any folios that need writing to the cache will then have DIO writes issued.
435 * Writes to the cache will proceed asynchronously and the folios will have the
441 Read Helper Cache API
442 ---------------------
444 When implementing a local cache to be used by the read helpers, two things are
448 To begin a cache operation on an fscache object, the following function is
455 fills in the cache resources mentioned below.
457 The netfs_io_request object contains a place for the cache to hang its
515 the cache to expand a request in either direction. This allows the cache to
516 size the request appropriately for the cache granularity.
519 plus the size of the file for reference, and adjusts the start and length
528 downloaded from the server or read from the cache - or whether slicing
533 [Required] Called to configure the next slice of a request. ->start and
534 ->len in the subrequest indicate where and how big the next slice can be;
535 the cache gets to reduce the length to match its granularity requirements.
539 [Required] Called to read from the cache. The start file offset is given
552 [Required] Called to prepare a write to the cache to take place. This
553 involves checking to see whether the cache has sufficient space to honour
556 necessary to align for direct I/O. i_size holds the size of the object and
558 caller is certain that no data has been written to that region - for example
563 [Required] Called to write to the cache. The start file offset is given
575 particular region of the cache. The start and length of the region to be
581 It returns 0 if some data was found, -ENODATA if there was no usable data
582 within the region or -ENOBUFS if there is no caching on this file.
584 Note that these methods are passed a pointer to the cache resource structure,
587 cache.
593 .. kernel-doc:: include/linux/netfs.h
594 .. kernel-doc:: fs/netfs/buffered_read.c