fs/nfs/super.c
Source file repositories/reference/linux-study-clean/fs/nfs/super.c
File Facts
- System
- Linux kernel
- Corpus path
fs/nfs/super.c- Extension
.c- Size
- 38988 bytes
- Lines
- 1460
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- 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/addr.hlinux/sunrpc/stats.hlinux/sunrpc/metrics.hlinux/sunrpc/xprtsock.hlinux/sunrpc/xprtrdma.hlinux/nfs_fs.hlinux/nfs_mount.hlinux/nfs4_mount.hlinux/lockd/bind.hlinux/seq_file.hlinux/mount.hlinux/namei.hlinux/vfs.hlinux/inet.hlinux/in6.hlinux/sched.hlinux/slab.hnet/ipv6.hlinux/netdevice.hlinux/nfs_xdr.hlinux/magic.hlinux/parser.h
Detected Declarations
function register_nfs4_fsfunction unregister_nfs4_fsfunction register_nfs4_fsfunction unregister_nfs4_fsfunction nfs_ssc_unregister_opsfunction register_nfs_fsfunction unregister_nfs_fsfunction nfs_sb_activefunction nfs_sb_deactivefunction nfs_client_for_each_serverfunction nfs_statfsfunction nfs_show_mountd_netidfunction nfs_show_mountd_optionsfunction nfs_show_nfsv4_optionsfunction nfs_show_nfsv4_optionsfunction nfs_show_mount_optionsfunction nfs_show_optionsfunction show_leasefunction show_sessionsfunction show_pnfsfunction show_implementation_idfunction show_implementation_idfunction nfs_show_pathfunction nfs_show_statsfunction nfs_umount_beginfunction nfs_auth_info_matchfunction nfs_verify_authflavorsfunction nfs_request_mountfunction nfs_try_get_treefunction nfs_compare_remount_datafunction nfs_reconfigurefunction nfs_fill_superfunction nfs_compare_mount_optionsfunction nfs_set_superfunction nfs_compare_super_addressfunction nfs_compare_usernsfunction nfs_compare_superfunction nfs_get_cache_cookiefunction nfs_get_cache_cookiefunction nfs_get_tree_commonfunction nfs_kill_superfunction param_set_portnrexport nfs_sopsexport nfs_sb_activeexport nfs_sb_deactiveexport nfs_client_for_each_serverexport nfs_statfsexport nfs_show_options
Annotated Snippet
switch (nfss->mountd_protocol) {
case IPPROTO_UDP:
proto = RPCBIND_NETID_UDP;
break;
case IPPROTO_TCP:
proto = RPCBIND_NETID_TCP;
break;
}
break;
case AF_INET6:
switch (nfss->mountd_protocol) {
case IPPROTO_UDP:
proto = RPCBIND_NETID_UDP6;
break;
case IPPROTO_TCP:
proto = RPCBIND_NETID_TCP6;
break;
}
break;
}
if (proto || showdefaults)
seq_printf(m, ",mountproto=%s", proto ?: "auto");
}
static void nfs_show_mountd_options(struct seq_file *m, struct nfs_server *nfss,
int showdefaults)
{
struct sockaddr *sap = (struct sockaddr *)&nfss->mountd_address;
if (nfss->flags & NFS_MOUNT_LEGACY_INTERFACE)
return;
switch (sap->sa_family) {
case AF_INET: {
struct sockaddr_in *sin = (struct sockaddr_in *)sap;
seq_printf(m, ",mountaddr=%pI4", &sin->sin_addr.s_addr);
break;
}
case AF_INET6: {
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap;
seq_printf(m, ",mountaddr=%pI6c", &sin6->sin6_addr);
break;
}
default:
if (showdefaults)
seq_puts(m, ",mountaddr=unspecified");
}
if (nfss->mountd_version || showdefaults)
seq_printf(m, ",mountvers=%u", nfss->mountd_version);
if ((nfss->mountd_port &&
nfss->mountd_port != (unsigned short)NFS_UNSPEC_PORT) ||
showdefaults)
seq_printf(m, ",mountport=%u", nfss->mountd_port);
nfs_show_mountd_netid(m, nfss, showdefaults);
}
#if IS_ENABLED(CONFIG_NFS_V4)
static void nfs_show_nfsv4_options(struct seq_file *m, struct nfs_server *nfss,
int showdefaults)
{
struct nfs_client *clp = nfss->nfs_client;
seq_printf(m, ",clientaddr=%s", clp->cl_ipaddr);
}
#else
static void nfs_show_nfsv4_options(struct seq_file *m, struct nfs_server *nfss,
int showdefaults)
{
}
#endif
static void nfs_show_nfs_version(struct seq_file *m,
unsigned int version,
unsigned int minorversion)
{
seq_printf(m, ",vers=%u", version);
if (version == 4)
seq_printf(m, ".%u", minorversion);
}
/*
* Describe the mount options in force on this server representation
*/
static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
int showdefaults)
{
static const struct proc_nfs_info {
int flag;
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 register_nfs4_fs`, `function unregister_nfs4_fs`, `function register_nfs4_fs`, `function unregister_nfs4_fs`, `function nfs_ssc_unregister_ops`, `function register_nfs_fs`, `function unregister_nfs_fs`, `function nfs_sb_active`, `function nfs_sb_deactive`, `function nfs_client_for_each_server`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: integration 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.