include/linux/dcache.h
Source file repositories/reference/linux-study-clean/include/linux/dcache.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/dcache.h- Extension
.h- Size
- 20484 bytes
- Lines
- 653
- 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/atomic.hlinux/list.hlinux/math.hlinux/rculist.hlinux/rculist_bl.hlinux/spinlock.hlinux/seqlock.hlinux/cache.hlinux/rcupdate.hlinux/lockref.hlinux/stringhash.hlinux/wait.h
Detected Declarations
struct pathstruct filestruct vfsmountstruct qstrstruct completion_liststruct dentrystruct dentry_operationsstruct name_snapshotenum dentry_d_lock_classenum d_real_typeenum dentry_flagsfunction d_countfunction dget_alias_ilockedfunction d_unhashedfunction d_unlinkedfunction cant_mountfunction dont_mountfunction d_in_lookupfunction d_lookup_donefunction d_managedfunction d_mountpointfunction __d_entry_typefunction d_is_missfunction d_is_whiteoutfunction d_can_lookupfunction d_is_autodirfunction d_is_dirfunction d_is_symlinkfunction d_is_regfunction d_is_specialfunction d_is_filefunction d_is_negativefunction d_flags_negativefunction d_is_positivefunction d_really_is_negativefunction d_really_is_positivefunction simple_positivefunction d_inode
Annotated Snippet
struct qstr {
union {
struct {
HASH_LEN_DECLARE;
};
u64 hash_len;
};
const unsigned char *name;
};
#define QSTR_INIT(n,l) { { { .len = l } }, .name = n }
#define QSTR_LEN(n,l) (struct qstr)QSTR_INIT(n,l)
#define QSTR(n) QSTR_LEN(n, strlen(n))
extern const struct qstr empty_name;
extern const struct qstr slash_name;
extern const struct qstr dotdot_name;
/*
* Try to keep struct dentry aligned on 64 byte cachelines (this will
* give reasonable cacheline footprint with larger lines without the
* large memory footprint increase).
*/
#ifdef CONFIG_64BIT
# define DNAME_INLINE_WORDS 5 /* 192 bytes */
#else
# ifdef CONFIG_SMP
# define DNAME_INLINE_WORDS 9 /* 128 bytes */
# else
# define DNAME_INLINE_WORDS 11 /* 128 bytes */
# endif
#endif
#define DNAME_INLINE_LEN (DNAME_INLINE_WORDS*sizeof(unsigned long))
union shortname_store {
unsigned char string[DNAME_INLINE_LEN];
unsigned long words[DNAME_INLINE_WORDS];
};
#define d_lock d_lockref.lock
#define d_iname d_shortname.string
struct completion_list;
struct dentry {
/* RCU lookup touched fields */
unsigned int d_flags; /* protected by d_lock */
seqcount_spinlock_t d_seq; /* per dentry seqlock */
struct hlist_bl_node d_hash; /* lookup hash list */
struct dentry *d_parent; /* parent directory */
union {
struct qstr __d_name; /* for use ONLY in fs/dcache.c */
const struct qstr d_name;
};
struct inode *d_inode; /* Where the name belongs to - NULL is
* negative */
union shortname_store d_shortname;
/* --- cacheline 1 boundary (64 bytes) was 32 bytes ago --- */
/* Ref lookup also touches following */
const struct dentry_operations *d_op;
struct super_block *d_sb; /* The root of the dentry tree */
unsigned long d_time; /* used by d_revalidate */
void *d_fsdata; /* fs-specific data */
/* --- cacheline 2 boundary (128 bytes) --- */
struct lockref d_lockref; /* per-dentry lock and refcount
* keep separate from RCU lookup area if
* possible!
*/
struct list_head d_lru; /* LRU list */
struct hlist_node d_sib; /* child of parent list */
struct hlist_head d_children; /* our children */
/*
* the following members can share memory - their uses are
* mutually exclusive.
*/
union {
/* positives: inode alias list */
struct hlist_node d_alias;
/* in-lookup ones (all negative, live): hash chain */
struct hlist_bl_node d_in_lookup_hash;
/* killed ones: (already negative) used to schedule freeing */
struct rcu_head d_rcu;
/*
* live non-in-lookup negatives: used if shrink_dcache_tree()
* races with eviction by another thread and needs to wait for
* this dentry to get killed . Remains NULL for almost all
* negative dentries.
*/
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/list.h`, `linux/math.h`, `linux/rculist.h`, `linux/rculist_bl.h`, `linux/spinlock.h`, `linux/seqlock.h`, `linux/cache.h`.
- Detected declarations: `struct path`, `struct file`, `struct vfsmount`, `struct qstr`, `struct completion_list`, `struct dentry`, `struct dentry_operations`, `struct name_snapshot`, `enum dentry_d_lock_class`, `enum d_real_type`.
- 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.