fs/cachefiles/internal.h
Source file repositories/reference/linux-study-clean/fs/cachefiles/internal.h
File Facts
- System
- Linux kernel
- Corpus path
fs/cachefiles/internal.h- Extension
.h- Size
- 16875 bytes
- Lines
- 543
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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-cache.hlinux/cred.hlinux/security.hlinux/xarray.hlinux/cachefiles.htrace/events/cachefiles.h
Detected Declarations
struct cachefiles_cachestruct cachefiles_objectstruct cachefiles_volumestruct cachefiles_ondemand_infostruct cachefiles_objectstruct cachefiles_cachestruct cachefiles_reqenum cachefiles_contentenum cachefiles_object_stateenum cachefiles_has_space_forfunction cachefiles_in_ondemand_modefunction cachefiles_state_changedfunction cachefiles_register_error_injectionfunction cachefiles_unregister_error_injectionfunction cachefiles_inject_write_errorfunction cachefiles_inject_remove_errorfunction cachefiles_ondemand_is_reopening_readfunction cachefiles_ondemand_daemon_readfunction cachefiles_ondemand_init_objectfunction cachefiles_ondemand_clean_objectfunction cachefiles_ondemand_init_obj_infofunction cachefiles_ondemand_deinit_obj_infofunction cachefiles_begin_securefunction cachefiles_end_secure
Annotated Snippet
extern const struct file_operations cachefiles_daemon_fops;
extern void cachefiles_flush_reqs(struct cachefiles_cache *cache);
extern void cachefiles_get_unbind_pincount(struct cachefiles_cache *cache);
extern void cachefiles_put_unbind_pincount(struct cachefiles_cache *cache);
/*
* error_inject.c
*/
#ifdef CONFIG_CACHEFILES_ERROR_INJECTION
extern unsigned int cachefiles_error_injection_state;
extern int cachefiles_register_error_injection(void);
extern void cachefiles_unregister_error_injection(void);
#else
#define cachefiles_error_injection_state 0
static inline int cachefiles_register_error_injection(void)
{
return 0;
}
static inline void cachefiles_unregister_error_injection(void)
{
}
#endif
static inline int cachefiles_inject_read_error(void)
{
return cachefiles_error_injection_state & 2 ? -EIO : 0;
}
static inline int cachefiles_inject_write_error(void)
{
return cachefiles_error_injection_state & 2 ? -EIO :
cachefiles_error_injection_state & 1 ? -ENOSPC :
0;
}
static inline int cachefiles_inject_remove_error(void)
{
return cachefiles_error_injection_state & 2 ? -EIO : 0;
}
/*
* interface.c
*/
extern const struct fscache_cache_ops cachefiles_cache_ops;
extern void cachefiles_see_object(struct cachefiles_object *object,
enum cachefiles_obj_ref_trace why);
extern struct cachefiles_object *cachefiles_grab_object(struct cachefiles_object *object,
enum cachefiles_obj_ref_trace why);
extern void cachefiles_put_object(struct cachefiles_object *object,
enum cachefiles_obj_ref_trace why);
/*
* io.c
*/
extern bool cachefiles_begin_operation(struct netfs_cache_resources *cres,
enum fscache_want_state want_state);
extern int __cachefiles_prepare_write(struct cachefiles_object *object,
struct file *file,
loff_t *_start, size_t *_len, size_t upper_len,
bool no_space_allocated_yet);
extern int __cachefiles_write(struct cachefiles_object *object,
struct file *file,
loff_t start_pos,
struct iov_iter *iter,
netfs_io_terminated_t term_func,
void *term_func_priv);
/*
* key.c
*/
extern bool cachefiles_cook_key(struct cachefiles_object *object);
/*
* main.c
*/
extern struct kmem_cache *cachefiles_object_jar;
/*
* namei.c
*/
extern void cachefiles_unmark_inode_in_use(struct cachefiles_object *object,
struct file *file);
extern int cachefiles_bury_object(struct cachefiles_cache *cache,
struct cachefiles_object *object,
struct dentry *dir,
struct dentry *rep,
Annotation
- Immediate include surface: `linux/fscache-cache.h`, `linux/cred.h`, `linux/security.h`, `linux/xarray.h`, `linux/cachefiles.h`, `trace/events/cachefiles.h`.
- Detected declarations: `struct cachefiles_cache`, `struct cachefiles_object`, `struct cachefiles_volume`, `struct cachefiles_ondemand_info`, `struct cachefiles_object`, `struct cachefiles_cache`, `struct cachefiles_req`, `enum cachefiles_content`, `enum cachefiles_object_state`, `enum cachefiles_has_space_for`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: pattern 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.