Lines Matching refs:cache

9 This API is declared in <linux/fscache-cache.h>.
16 To start off, a cache definition must be initialised and registered for each
17 cache the backend wants to make available. For instance, CacheFS does this in
20 The cache definition (struct fscache_cache) should be initialised by calling:
22 void fscache_init_cache(struct fscache_cache *cache,
29 (*) "cache" is a pointer to the cache definition;
32 this cache; and
35 for the cache.
38 The cache should then be registered with FS-Cache by passing a pointer to the
39 previously initialised cache definition to:
41 int fscache_add_cache(struct fscache_cache *cache,
48 master index in this cache. Netfs primary index entries will be created
50 successful and will release it upon withdrawal of the cache.
52 (*) "tagname" which, if given, should be a text string naming this cache. If
65 A cache can be withdrawn from the system by calling this function with a
66 pointer to the cache definition:
68 void fscache_withdraw_cache(struct fscache_cache *cache);
77 The cache methods are executed one of two contexts:
80 the cache method to be invoked, or
85 cache.
88 be masqueraded for the duration of the cache driver's access to the cache.
89 This is left to the cache to handle; FS-Cache makes no effort in this regard.
96 The cache may present data to the outside world through FS-Cache's interfaces
101 and is for use by the cache as it sees fit.
121 cache operations.
124 (*) In-cache object representation:
133 struct fscache_cache *cache;
138 Structures of this type should be allocated by the cache backend and
139 passed to FS-Cache when requested by the appropriate cache operation. In
167 the cache. These are represented by the above structure. The processor
197 The to_do field is an empty list available for the cache backend to use as
219 The cache backend provides FS-Cache with a table of operations that can be
220 performed on the denizens of the cache. These are held in a structure of type:
224 (*) Name of cache provider [mandatory]:
234 struct fscache_object *(*alloc_object)(struct fscache_cache *cache,
237 This method is used to allocate a cache object representation to back a
238 cookie in a particular cache. fscache_object_init() should be called on
243 will call the lookup_complete() method to allow the cache to release the
253 in the cache if it can.
256 possible if it determines the object doesn't exist in the cache. If the
270 This method is called to ask the cache to release any resources it was
279 may fail (for instance if the cache is being withdrawn) by returning NULL.
297 These methods are used to pin an object into the cache. Once pinned an
299 enough space in the cache to permit this.
306 This method is called to have the cache check the saved auxiliary data of
337 cookie, and that the cache should release the object's resources and
352 (*) Synchronise a cache [mandatory]:
354 void (*sync)(struct fscache_cache *cache)
356 This is called to ask the backend to synchronise a cache with its backing
360 (*) Dissociate a cache [mandatory]:
362 void (*dissociate_pages)(struct fscache_cache *cache)
364 This is called to ask a cache to perform any page dissociations as part of
365 cache withdrawal.
372 This is called to indicate to the cache that certain attributes on a netfs
374 cache can read these from the netfs by calling the cookie's get_attr()
377 The cache may use the file size information to reserve space on the cache.
381 This method may return -ve if an error occurred or the cache object cannot
389 (*) Reserve cache space for an object's data [optional]:
393 This is called to request that cache space be reserved to hold the data
407 (*) Request page be read from cache [mandatory]:
413 This is called to attempt to read a netfs page from the cache, or to
417 If there's no page in the cache, then -ENODATA should be returned if the
421 If there is suitable data in the cache, then a read operation should be
425 The fscache_mark_pages_cached() should be called for the page if any cache
449 (*) Request pages be read from cache [mandatory]:
458 started must be added to the page cache for the specified mapping and also
469 (*) Request page be allocated in the cache [mandatory]:
476 read from the cache, even if there's data there that could be retrieved.
478 the write_page() method can write to the cache.
485 (*) Request pages be allocated in the cache [mandatory]:
496 (*) Request page be written to cache [mandatory]:
522 cache backend should tear down any internal representation or tracking it
530 FS-Cache provides some utilities that a cache backend may make use of:
532 (*) Note occurrence of an I/O error in a cache:
534 void fscache_io_error(struct fscache_cache *cache)
536 This tells FS-Cache that an I/O error occurred in the cache. After this
538 release) will be passed from the netfs to the cache backend for the
539 specified cache.
541 This does not actually withdraw the cache. That must be done separately.
602 retrieved from the cache can be found.
630 void fscache_object_destroyed(struct fscache_cache *cache);
633 cache has been destroyed and deallocated. This will allow continuation
634 of the cache withdrawal process when it is stopped pending destruction of
647 known at this point that there can't be any data in the cache.
684 the cache that the netfs decided was stale. The object has been
685 discarded from the cache and the lookup will be performed again.
693 This is called to indicate that the cache backend preemptively killed an
697 FSCACHE_OBJECT_NO_SPACE - there was insufficient cache space