include/linux/fscache-cache.h
Source file repositories/reference/linux-study-clean/include/linux/fscache-cache.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/fscache-cache.h- Extension
.h- Size
- 7262 bytes
- Lines
- 215
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/fscache.h
Detected Declarations
struct fscache_cachestruct fscache_cache_opsenum fscache_cache_traceenum fscache_cookie_traceenum fscache_access_traceenum fscache_volume_traceenum fscache_cache_statefunction fscache_cookie_statefunction fscache_count_objectfunction fscache_uncount_objectfunction fscache_wait_for_objects
Annotated Snippet
struct fscache_cache {
const struct fscache_cache_ops *ops;
struct list_head cache_link; /* Link in cache list */
void *cache_priv; /* Private cache data (or NULL) */
refcount_t ref;
atomic_t n_volumes; /* Number of active volumes; */
atomic_t n_accesses; /* Number of in-progress accesses on the cache */
atomic_t object_count; /* no. of live objects in this cache */
unsigned int debug_id;
enum fscache_cache_state state;
char *name;
};
/*
* cache operations
*/
struct fscache_cache_ops {
/* name of cache provider */
const char *name;
/* Acquire a volume */
void (*acquire_volume)(struct fscache_volume *volume);
/* Free the cache's data attached to a volume */
void (*free_volume)(struct fscache_volume *volume);
/* Look up a cookie in the cache */
bool (*lookup_cookie)(struct fscache_cookie *cookie);
/* Withdraw an object without any cookie access counts held */
void (*withdraw_cookie)(struct fscache_cookie *cookie);
/* Change the size of a data object */
void (*resize_cookie)(struct netfs_cache_resources *cres,
loff_t new_size);
/* Invalidate an object */
bool (*invalidate_cookie)(struct fscache_cookie *cookie);
/* Begin an operation for the netfs lib */
bool (*begin_operation)(struct netfs_cache_resources *cres,
enum fscache_want_state want_state);
/* Prepare to write to a live cache object */
void (*prepare_to_write)(struct fscache_cookie *cookie);
};
extern struct workqueue_struct *fscache_wq;
extern wait_queue_head_t fscache_clearance_waiters;
/*
* out-of-line cache backend functions
*/
extern struct rw_semaphore fscache_addremove_sem;
extern struct fscache_cache *fscache_acquire_cache(const char *name);
extern void fscache_relinquish_cache(struct fscache_cache *cache);
extern int fscache_add_cache(struct fscache_cache *cache,
const struct fscache_cache_ops *ops,
void *cache_priv);
extern void fscache_withdraw_cache(struct fscache_cache *cache);
extern void fscache_withdraw_volume(struct fscache_volume *volume);
extern void fscache_withdraw_cookie(struct fscache_cookie *cookie);
extern void fscache_io_error(struct fscache_cache *cache);
extern struct fscache_volume *
fscache_try_get_volume(struct fscache_volume *volume,
enum fscache_volume_trace where);
extern void fscache_put_volume(struct fscache_volume *volume,
enum fscache_volume_trace where);
extern void fscache_end_volume_access(struct fscache_volume *volume,
struct fscache_cookie *cookie,
enum fscache_access_trace why);
extern struct fscache_cookie *fscache_get_cookie(struct fscache_cookie *cookie,
enum fscache_cookie_trace where);
extern void fscache_put_cookie(struct fscache_cookie *cookie,
enum fscache_cookie_trace where);
extern void fscache_end_cookie_access(struct fscache_cookie *cookie,
enum fscache_access_trace why);
extern void fscache_cookie_lookup_negative(struct fscache_cookie *cookie);
extern void fscache_resume_after_invalidation(struct fscache_cookie *cookie);
extern void fscache_caching_failed(struct fscache_cookie *cookie);
extern bool fscache_wait_for_operation(struct netfs_cache_resources *cred,
enum fscache_want_state state);
/**
* fscache_cookie_state - Read the state of a cookie
* @cookie: The cookie to query
*
Annotation
- Immediate include surface: `linux/fscache.h`.
- Detected declarations: `struct fscache_cache`, `struct fscache_cache_ops`, `enum fscache_cache_trace`, `enum fscache_cookie_trace`, `enum fscache_access_trace`, `enum fscache_volume_trace`, `enum fscache_cache_state`, `function fscache_cookie_state`, `function fscache_count_object`, `function fscache_uncount_object`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.