Lines Matching +full:zero +full:- +full:initialised

1 .. SPDX-License-Identifier: GPL-2.0
4 FS-Cache Cache backend API
7 The FS-Cache system provides an API by which actual caches can be supplied to
8 FS-Cache for it to then serve out to network filesystems and other interested
11 This API is declared in <linux/fscache-cache.h>.
17 To start off, a cache definition must be initialised and registered for each
21 The cache definition (struct fscache_cache) should be initialised by calling::
35 * "idfmt" is a format and printf-style arguments for constructing a label
39 The cache should then be registered with FS-Cache by passing a pointer to the
40 previously initialised cache definition to::
48 * "fsdef" which should point to the object representation for the FS-Cache
50 here. FS-Cache keeps the caller's reference to the index object if
58 This function may return -ENOMEM if it ran out of memory or -EEXIST if the tag
81 (2) that of one of the processes in the FS-Cache thread pool.
88 This is left to the cache to handle; FS-Cache makes no effort in this regard.
94 The cache may present data to the outside world through FS-Cache's interfaces
95 in sysfs and procfs - the former for control and the latter for statistics.
105 * Index/Data file FS-Cache representation cookie::
121 * In-cache object representation::
136 passed to FS-Cache when requested by the appropriate cache operation. In
142 using "OBJ%x" to be consistent with FS-Cache.
147 initialised by calling fscache_object_init(object).
150 * FS-Cache operation record::
162 FS-Cache has a pool of threads that it uses to give CPU time to the
173 * FS-Cache retrieval operation record::
182 A structure of this type is allocated by FS-Cache to record retrieval and
189 do this, the retrieval->op.processor method pointer should be set
198 * FS-Cache storage operation record::
206 A structure of this type is allocated by FS-Cache to record outstanding
207 writes to be made. FS-Cache itself enqueues this operation and invokes
215 The cache backend provides FS-Cache with a table of operations that can be
240 multiple lookup calls to turn it into a more convenient form. FS-Cache
258 should also be called once a non-present object has been created.
296 object cannot be reclaimed to make space. Return -ENOSPC if there's not
306 if they're consistent and -ESTALE otherwise. -ENOMEM and -ERESTARTSYS
314 new information should be in object->cookie->netfs_data. This can be
315 obtained by calling object->cookie->def->get_aux()/get_attr().
322 This is called to invalidate a data object (as pointed to by op->object).
376 It should also call fscache_set_store_limit() to indicate to FS-Cache the
379 This method may return -ve if an error occurred or the cache object cannot
382 This operation is run asynchronously from FS-Cache's thread pool, and
392 for an object and the metadata used to track it. Zero size should be
395 This should return 0 if successful, -ENOSPC if there isn't enough space
396 available, or -ENOMEM or -EIO on other errors.
412 reserve a backing block if not. FS-Cache will have done as much checking
415 If there's no page in the cache, then -ENODATA should be returned if the
416 backend managed to reserve a backing block; -ENOBUFS or -ENOMEM if it
432 The retrieval record may be used to get CPU time via the FS-Cache thread
433 pool. If this is desired, the op->op.processor should be set to point to
439 If an I/O error occurs, fscache_io_error() should be called and -ENOBUFS
460 If there was an error such as -ENOMEM, then that should be returned; else
461 if one or more pages couldn't be read or allocated, then -ENOBUFS should
462 be returned; else if one or more pages couldn't be read, then -ENODATA
478 If there's no backing block available, then -ENOBUFS should be returned
479 (or -ENOMEM if there were other problems). If a block is successfully
500 successful read_or_alloc_page() call or similar. FS-Cache filters out
503 This method is called asynchronously from the FS-Cache thread pool. It is
504 not required to actually store anything, provided -ENODATA is then
508 otherwise zero should be returned. FS-Cache will take appropriate action
511 If this method returns success then FS-Cache will inform the netfs
515 * Discard retained per-page metadata [mandatory]::
524 FS-Cache Utilities
527 FS-Cache provides some utilities that a cache backend may make use of:
533 This tells FS-Cache that an I/O error occurred in the cache. After this
576 This sets the limit FS-Cache imposes on the highest byte it's willing to
578 rejected by fscache_read_alloc_page() and co with -ENOBUFS.
626 This must be called to inform FS-Cache that an object that belonged to a
636 This is called to indicate to FS-Cache that a lookup process for an object
644 significant - all subsequent calls are ignored.
651 This is called to indicate to FS-Cache that a lookup process for an object
691 - the object was stale and needs discarding.
694 - there was insufficient cache space
697 - the object was retired when relinquished.
700 - the object was culled to make space.
716 This enqueues a retrieval record for processing by the FS-Cache thread
718 op->op.processor callback function. This function may be called from