net/rxrpc/proc.c
Source file repositories/reference/linux-study-clean/net/rxrpc/proc.c
File Facts
- System
- Linux kernel
- Corpus path
net/rxrpc/proc.c- Extension
.c- Size
- 17806 bytes
- Lines
- 606
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source 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.
- 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.hnet/sock.hnet/af_rxrpc.har-internal.h
Detected Declarations
function rxrpc_call_seq_stopfunction rxrpc_call_seq_showfunction rxrpc_connection_seq_stopfunction rxrpc_connection_seq_showfunction rxrpc_bundle_seq_stopfunction rxrpc_bundle_seq_showfunction rxrpc_peer_seq_showfunction rxrpc_peer_seq_stopfunction rxrpc_local_seq_showfunction rxrpc_local_seq_stopfunction rxrpc_stats_showfunction rxrpc_stats_clear
Annotated Snippet
if (bucket >= HASH_SIZE(rxnet->peer_hash)) {
*_pos = UINT_MAX;
return NULL;
}
if (n == 0) {
if (bucket == 0)
return SEQ_START_TOKEN;
*_pos += 1;
n++;
}
p = seq_hlist_start_rcu(&rxnet->peer_hash[bucket], n - 1);
if (p)
return p;
bucket++;
n = 1;
*_pos = (bucket << shift) | n;
}
}
static void *rxrpc_peer_seq_next(struct seq_file *seq, void *v, loff_t *_pos)
{
struct rxrpc_net *rxnet = rxrpc_net(seq_file_net(seq));
unsigned int bucket, n;
unsigned int shift = 32 - HASH_BITS(rxnet->peer_hash);
void *p;
if (*_pos >= UINT_MAX)
return NULL;
bucket = *_pos >> shift;
p = seq_hlist_next_rcu(v, &rxnet->peer_hash[bucket], _pos);
if (p)
return p;
for (;;) {
bucket++;
n = 1;
*_pos = (bucket << shift) | n;
if (bucket >= HASH_SIZE(rxnet->peer_hash)) {
*_pos = UINT_MAX;
return NULL;
}
if (n == 0) {
*_pos += 1;
n++;
}
p = seq_hlist_start_rcu(&rxnet->peer_hash[bucket], n - 1);
if (p)
return p;
}
}
static void rxrpc_peer_seq_stop(struct seq_file *seq, void *v)
__releases(rcu)
{
rcu_read_unlock();
}
const struct seq_operations rxrpc_peer_seq_ops = {
.start = rxrpc_peer_seq_start,
.next = rxrpc_peer_seq_next,
.stop = rxrpc_peer_seq_stop,
.show = rxrpc_peer_seq_show,
};
/*
* Generate a list of extant virtual local endpoints in /proc/net/rxrpc/locals
*/
static int rxrpc_local_seq_show(struct seq_file *seq, void *v)
{
struct rxrpc_local *local;
char lbuff[RXRPC_PROC_ADDRBUF_SIZE];
if (v == SEQ_START_TOKEN) {
seq_puts(seq,
"Proto Local "
" Use Act RxQ\n");
return 0;
}
local = hlist_entry(v, struct rxrpc_local, link);
scnprintf(lbuff, sizeof(lbuff), "%pISpc", &local->srx.transport);
seq_printf(seq,
Annotation
- Immediate include surface: `linux/module.h`, `net/sock.h`, `net/af_rxrpc.h`, `ar-internal.h`.
- Detected declarations: `function rxrpc_call_seq_stop`, `function rxrpc_call_seq_show`, `function rxrpc_connection_seq_stop`, `function rxrpc_connection_seq_show`, `function rxrpc_bundle_seq_stop`, `function rxrpc_bundle_seq_show`, `function rxrpc_peer_seq_show`, `function rxrpc_peer_seq_stop`, `function rxrpc_local_seq_show`, `function rxrpc_local_seq_stop`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.