fs/nfs/getroot.c
Source file repositories/reference/linux-study-clean/fs/nfs/getroot.c
File Facts
- System
- Linux kernel
- Corpus path
fs/nfs/getroot.c- Extension
.c- Size
- 3522 bytes
- Lines
- 134
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- 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/module.hlinux/init.hlinux/time.hlinux/kernel.hlinux/mm.hlinux/string.hlinux/stat.hlinux/errno.hlinux/unistd.hlinux/sunrpc/clnt.hlinux/sunrpc/stats.hlinux/nfs_fs.hlinux/nfs_mount.hlinux/lockd/bind.hlinux/seq_file.hlinux/mount.hlinux/vfs.hlinux/namei.hlinux/security.hlinux/uaccess.hinternal.h
Detected Declarations
function Copyright
Annotated Snippet
if (d_inode(fc->root)->i_fop != &nfs_dir_operations) {
error = -ESTALE;
goto error_splat_root;
}
/* clone lsm security options from the parent to the new sb */
error = security_sb_clone_mnt_opts(ctx->clone_data.sb,
s, kflags, &kflags_out);
if (error)
goto error_splat_root;
clone_server = NFS_SB(ctx->clone_data.sb);
server->has_sec_mnt_opts = clone_server->has_sec_mnt_opts;
} else {
error = security_sb_set_mnt_opts(s, fc->security,
kflags, &kflags_out);
}
if (error)
goto error_splat_root;
if (server->caps & NFS_CAP_SECURITY_LABEL &&
!(kflags_out & SECURITY_LSM_NATIVE_LABELS))
server->caps &= ~NFS_CAP_SECURITY_LABEL;
nfs_setsecurity(inode, fsinfo.fattr);
error = 0;
out_fattr:
nfs_free_fattr(fsinfo.fattr);
out_name:
kfree(name);
out:
return error;
error_splat_root:
dput(fc->root);
fc->root = NULL;
goto out_fattr;
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/time.h`, `linux/kernel.h`, `linux/mm.h`, `linux/string.h`, `linux/stat.h`, `linux/errno.h`.
- Detected declarations: `function Copyright`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- 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.