fs/afs/dynroot.c
Source file repositories/reference/linux-study-clean/fs/afs/dynroot.c
File Facts
- System
- Linux kernel
- Corpus path
fs/afs/dynroot.c- Extension
.c- Size
- 10148 bytes
- Lines
- 407
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/fs.hlinux/namei.hlinux/dns_resolver.hinternal.h
Detected Declarations
function iget5function iget5function afs_dynroot_d_releasefunction afs_dynroot_delete_dentryfunction afs_atcell_delayed_put_cellfunction afs_dynroot_readdir_cellsfunction afs_dynroot_readdir
Annotated Snippet
static const struct file_operations afs_dynroot_file_operations = {
.llseek = generic_file_llseek,
.read = generic_read_dir,
.iterate_shared = afs_dynroot_readdir,
.fsync = noop_fsync,
};
/*
* Create an inode for a dynamic root directory.
*/
struct inode *afs_dynroot_iget_root(struct super_block *sb)
{
struct afs_super_info *as = AFS_FS_S(sb);
struct afs_vnode *vnode;
struct inode *inode;
struct afs_fid fid = { .vid = 0, .vnode = 1, .unique = 1,};
if (as->volume)
fid.vid = as->volume->vid;
inode = iget5_locked(sb, fid.vnode,
afs_iget5_pseudo_test, afs_iget5_pseudo_set, &fid);
if (!inode)
return ERR_PTR(-ENOMEM);
vnode = AFS_FS_I(inode);
/* there shouldn't be an existing inode */
if (inode_state_read_once(inode) & I_NEW) {
netfs_inode_init(&vnode->netfs, NULL, false);
simple_inode_init_ts(inode);
set_nlink(inode, 2);
inode->i_size = 0;
inode->i_mode = S_IFDIR | 0555;
inode->i_op = &afs_dynroot_inode_operations;
inode->i_fop = &afs_dynroot_file_operations;
inode->i_uid = GLOBAL_ROOT_UID;
inode->i_gid = GLOBAL_ROOT_GID;
inode->i_blocks = 0;
inode->i_generation = 0;
inode->i_flags |= S_NOATIME;
set_bit(AFS_VNODE_PSEUDODIR, &vnode->flags);
unlock_new_inode(inode);
}
_leave(" = %p", inode);
return inode;
}
Annotation
- Immediate include surface: `linux/fs.h`, `linux/namei.h`, `linux/dns_resolver.h`, `internal.h`.
- Detected declarations: `function iget5`, `function iget5`, `function afs_dynroot_d_release`, `function afs_dynroot_delete_dentry`, `function afs_atcell_delayed_put_cell`, `function afs_dynroot_readdir_cells`, `function afs_dynroot_readdir`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: pattern implementation candidate.
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.