net/rxrpc/call_object.c
Source file repositories/reference/linux-study-clean/net/rxrpc/call_object.c
File Facts
- System
- Linux kernel
- Corpus path
net/rxrpc/call_object.c- Extension
.c- Size
- 21068 bytes
- Lines
- 776
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/slab.hlinux/module.hlinux/circ_buf.hlinux/spinlock_types.hnet/sock.hnet/af_rxrpc.har-internal.h
Detected Declarations
function rxrpc_poke_callfunction rxrpc_call_timer_expiredfunction rxrpc_start_call_timerfunction rxrpc_put_call_slotfunction rxrpc_connect_callfunction rxrpc_incoming_callfunction rxrpc_see_callfunction rxrpc_get_callfunction rxrpc_cleanup_tx_buffersfunction rxrpc_cleanup_rx_buffersfunction rxrpc_release_callfunction rxrpc_release_calls_on_socketfunction rxrpc_put_callfunction rxrpc_rcu_free_callfunction rxrpc_destroy_callfunction rxrpc_cleanup_callfunction rxrpc_destroy_all_callsfunction list_for_each_entryfunction rxrpc_kernel_query_call_securityexport rxrpc_kernel_query_call_security
Annotated Snippet
if (!busy) {
list_add_tail(&call->attend_link, &local->call_attend_q);
}
spin_unlock_irq(&local->lock);
if (!busy)
rxrpc_wake_up_io_thread(local);
}
}
static void rxrpc_call_timer_expired(struct timer_list *t)
{
struct rxrpc_call *call = timer_container_of(call, t, timer);
_enter("%d", call->debug_id);
if (!__rxrpc_call_is_complete(call)) {
trace_rxrpc_timer_expired(call);
rxrpc_poke_call(call, rxrpc_call_poke_timer);
}
}
static struct lock_class_key rxrpc_call_user_mutex_lock_class_key;
static void rxrpc_destroy_call(struct work_struct *);
/*
* find an extant server call
* - called in process context with IRQs enabled
*/
struct rxrpc_call *rxrpc_find_call_by_user_ID(struct rxrpc_sock *rx,
unsigned long user_call_ID)
{
struct rxrpc_call *call;
struct rb_node *p;
_enter("%p,%lx", rx, user_call_ID);
read_lock(&rx->call_lock);
p = rx->calls.rb_node;
while (p) {
call = rb_entry(p, struct rxrpc_call, sock_node);
if (user_call_ID < call->user_call_ID)
p = p->rb_left;
else if (user_call_ID > call->user_call_ID)
p = p->rb_right;
else
goto found_extant_call;
}
read_unlock(&rx->call_lock);
_leave(" = NULL");
return NULL;
found_extant_call:
rxrpc_get_call(call, rxrpc_call_get_sendmsg);
read_unlock(&rx->call_lock);
_leave(" = %p [%d]", call, refcount_read(&call->ref));
return call;
}
/*
* allocate a new call
*/
struct rxrpc_call *rxrpc_alloc_call(struct rxrpc_sock *rx, gfp_t gfp,
unsigned int debug_id)
{
struct rxrpc_call *call;
struct rxrpc_net *rxnet = rxrpc_net(sock_net(&rx->sk));
call = kmem_cache_zalloc(rxrpc_call_jar, gfp);
if (!call)
return NULL;
mutex_init(&call->user_mutex);
/* Prevent lockdep reporting a deadlock false positive between the afs
* filesystem and sys_sendmsg() via the mmap sem.
*/
if (rx->sk.sk_kern_sock)
lockdep_set_class(&call->user_mutex,
&rxrpc_call_user_mutex_lock_class_key);
timer_setup(&call->timer, rxrpc_call_timer_expired, 0);
INIT_WORK(&call->destroyer, rxrpc_destroy_call);
INIT_LIST_HEAD(&call->link);
INIT_LIST_HEAD(&call->wait_link);
INIT_LIST_HEAD(&call->accept_link);
INIT_LIST_HEAD(&call->recvmsg_link);
Annotation
- Immediate include surface: `linux/slab.h`, `linux/module.h`, `linux/circ_buf.h`, `linux/spinlock_types.h`, `net/sock.h`, `net/af_rxrpc.h`, `ar-internal.h`.
- Detected declarations: `function rxrpc_poke_call`, `function rxrpc_call_timer_expired`, `function rxrpc_start_call_timer`, `function rxrpc_put_call_slot`, `function rxrpc_connect_call`, `function rxrpc_incoming_call`, `function rxrpc_see_call`, `function rxrpc_get_call`, `function rxrpc_cleanup_tx_buffers`, `function rxrpc_cleanup_rx_buffers`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: integration implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.