net/sunrpc/svcauth.c
Source file repositories/reference/linux-study-clean/net/sunrpc/svcauth.c
File Facts
- System
- Linux kernel
- Corpus path
net/sunrpc/svcauth.c- Extension
.c- Size
- 7768 bytes
- Lines
- 304
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/module.hlinux/sunrpc/types.hlinux/sunrpc/xdr.hlinux/sunrpc/svcsock.hlinux/sunrpc/svcauth.hlinux/err.hlinux/hash.hlinux/user_namespace.htrace/events/sunrpc.hsunrpc.h
Detected Declarations
function svc_get_auth_opsfunction svc_put_auth_opsfunction svc_authenticatefunction svc_set_clientfunction svc_authorisefunction svc_auth_registerfunction svc_auth_unregisterfunction svc_auth_flavorfunction svcauth_map_clnt_to_svc_cred_localfunction auth_domain_releasefunction auth_domain_putfunction auth_domain_lookupfunction hlist_for_each_entryfunction auth_domain_cleanupexport svc_set_clientexport svc_auth_registerexport svc_auth_unregisterexport svc_auth_flavorexport svcauth_map_clnt_to_svc_cred_localexport auth_domain_putexport auth_domain_lookupexport auth_domain_find
Annotated Snippet
if (strcmp(hp->name, name)==0) {
kref_get(&hp->ref);
spin_unlock(&auth_domain_lock);
return hp;
}
}
if (new)
hlist_add_head_rcu(&new->hash, head);
spin_unlock(&auth_domain_lock);
return new;
}
EXPORT_SYMBOL_GPL(auth_domain_lookup);
struct auth_domain *auth_domain_find(char *name)
{
struct auth_domain *hp;
struct hlist_head *head;
head = &auth_domain_table[hash_str(name, DN_HASHBITS)];
rcu_read_lock();
hlist_for_each_entry_rcu(hp, head, hash) {
if (strcmp(hp->name, name)==0) {
if (!kref_get_unless_zero(&hp->ref))
hp = NULL;
rcu_read_unlock();
return hp;
}
}
rcu_read_unlock();
return NULL;
}
EXPORT_SYMBOL_GPL(auth_domain_find);
/**
* auth_domain_cleanup - check that the auth_domain table is empty
*
* On module unload the auth_domain_table must be empty. To make it
* easier to catch bugs which don't clean up domains properly, we
* warn if anything remains in the table at cleanup time.
*
* Note that we cannot proactively remove the domains at this stage.
* The ->release() function might be in a module that has already been
* unloaded.
*/
void auth_domain_cleanup(void)
{
int h;
struct auth_domain *hp;
for (h = 0; h < DN_HASHMAX; h++)
hlist_for_each_entry(hp, &auth_domain_table[h], hash)
pr_warn("svc: domain %s still present at module unload.\n",
hp->name);
}
Annotation
- Immediate include surface: `linux/types.h`, `linux/module.h`, `linux/sunrpc/types.h`, `linux/sunrpc/xdr.h`, `linux/sunrpc/svcsock.h`, `linux/sunrpc/svcauth.h`, `linux/err.h`, `linux/hash.h`.
- Detected declarations: `function svc_get_auth_ops`, `function svc_put_auth_ops`, `function svc_authenticate`, `function svc_set_client`, `function svc_authorise`, `function svc_auth_register`, `function svc_auth_unregister`, `function svc_auth_flavor`, `function svcauth_map_clnt_to_svc_cred_local`, `function auth_domain_release`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.