fs/smb/client/cifsroot.c
Source file repositories/reference/linux-study-clean/fs/smb/client/cifsroot.c
File Facts
- System
- Linux kernel
- Corpus path
fs/smb/client/cifsroot.c- Extension
.c- Size
- 2104 bytes
- Lines
- 95
- 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.
Dependency Surface
linux/init.hlinux/fs.hlinux/types.hlinux/ctype.hlinux/string.hlinux/root_dev.hlinux/kernel.hlinux/in.hlinux/inet.hnet/ipconfig.h
Detected Declarations
function parse_srvaddrfunction cifs_root_setupfunction cifs_root_data
Annotated Snippet
if (len > sizeof(root_dev)) {
pr_err("Root-CIFS: UNC path too long\n");
return 1;
}
strscpy(root_dev, line, len);
srvaddr = parse_srvaddr(&line[2], s);
if (*s) {
int n = snprintf(root_opts,
sizeof(root_opts), "%s,%s",
DEFAULT_MNT_OPTS, s + 1);
if (n >= sizeof(root_opts)) {
pr_err("Root-CIFS: mount options string too long\n");
root_opts[sizeof(root_opts)-1] = '\0';
return 1;
}
}
}
root_server_addr = srvaddr;
return 1;
}
__setup("cifsroot=", cifs_root_setup);
int __init cifs_root_data(char **dev, char **opts)
{
if (!root_dev[0] || root_server_addr == htonl(INADDR_NONE)) {
pr_err("Root-CIFS: no SMB server address\n");
return -1;
}
*dev = root_dev;
*opts = root_opts;
return 0;
}
Annotation
- Immediate include surface: `linux/init.h`, `linux/fs.h`, `linux/types.h`, `linux/ctype.h`, `linux/string.h`, `linux/root_dev.h`, `linux/kernel.h`, `linux/in.h`.
- Detected declarations: `function parse_srvaddr`, `function cifs_root_setup`, `function cifs_root_data`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source 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.