fs/afs/rxrpc.c
Source file repositories/reference/linux-study-clean/fs/afs/rxrpc.c
File Facts
- System
- Linux kernel
- Corpus path
fs/afs/rxrpc.c- Extension
.c- Size
- 25429 bytes
- Lines
- 989
- 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.
- 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/slab.hlinux/sched/signal.hnet/sock.hnet/af_rxrpc.hinternal.hafs_cm.hprotocol_yfs.htrace/events/rxrpc.h
Detected Declarations
function afs_open_socketfunction afs_close_socketfunction afs_free_callfunction afs_put_callfunction afs_deferred_free_workerfunction afs_deferred_put_callfunction afs_queue_call_workfunction afs_flat_call_destructorfunction afs_notify_end_request_txfunction afs_make_callfunction afs_log_errorfunction afs_deliver_to_callfunction afs_wait_for_call_to_completefunction afs_wake_up_call_waiterfunction afs_wake_up_async_callfunction afs_process_async_callfunction afs_rx_attachfunction afs_charge_preallocationfunction afs_rx_discard_new_callfunction afs_rx_new_callfunction afs_deliver_cm_op_idfunction afs_notify_end_reply_txfunction afs_send_empty_replyfunction afs_send_simple_replyfunction afs_extract_datafunction afs_protocol_errorfunction afs_rx_notify_oob
Annotated Snippet
if (state == AFS_CALL_SV_AWAIT_ACK) {
len = 0;
iov_iter_kvec(&call->def_iter, ITER_DEST, NULL, 0, 0);
ret = rxrpc_kernel_recv_data(call->net->socket,
call->rxcall, &call->def_iter,
&len, false, &remote_abort,
&call->service_id);
trace_afs_receive_data(call, &call->def_iter, false, ret);
if (ret == -EINPROGRESS || ret == -EAGAIN)
return;
if (ret < 0 || ret == 1) {
if (ret == 1)
ret = 0;
goto call_complete;
}
return;
}
ret = call->type->deliver(call);
state = READ_ONCE(call->state);
if (ret == 0 && call->unmarshalling_error)
ret = -EBADMSG;
switch (ret) {
case 0:
call->responded = true;
afs_queue_call_work(call);
if (state == AFS_CALL_CL_PROC_REPLY) {
if (call->op)
set_bit(AFS_SERVER_FL_MAY_HAVE_CB,
&call->op->server->flags);
goto call_complete;
}
ASSERTCMP(state, >, AFS_CALL_CL_PROC_REPLY);
goto done;
case -EINPROGRESS:
case -EAGAIN:
goto out;
case -ECONNABORTED:
ASSERTCMP(state, ==, AFS_CALL_COMPLETE);
call->responded = true;
afs_log_error(call, call->abort_code);
goto done;
case -ENOTSUPP:
call->responded = true;
abort_code = RXGEN_OPCODE;
rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
abort_code, ret,
afs_abort_op_not_supported);
goto local_abort;
case -EIO:
pr_err("kAFS: Call %u in bad state %u\n",
call->debug_id, state);
fallthrough;
case -ENODATA:
case -EBADMSG:
case -EMSGSIZE:
case -ENOMEM:
case -EFAULT:
abort_code = RXGEN_CC_UNMARSHAL;
if (state != AFS_CALL_CL_AWAIT_REPLY)
abort_code = RXGEN_SS_UNMARSHAL;
rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
abort_code, ret,
afs_abort_unmarshal_error);
goto local_abort;
default:
abort_code = RX_CALL_DEAD;
rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
abort_code, ret,
afs_abort_general_error);
goto local_abort;
}
}
done:
if (call->type->done)
call->type->done(call);
out:
_leave("");
return;
local_abort:
abort_code = 0;
call_complete:
afs_set_call_complete(call, ret, remote_abort);
goto done;
}
/*
Annotation
- Immediate include surface: `linux/slab.h`, `linux/sched/signal.h`, `net/sock.h`, `net/af_rxrpc.h`, `internal.h`, `afs_cm.h`, `protocol_yfs.h`, `trace/events/rxrpc.h`.
- Detected declarations: `function afs_open_socket`, `function afs_close_socket`, `function afs_free_call`, `function afs_put_call`, `function afs_deferred_free_worker`, `function afs_deferred_put_call`, `function afs_queue_call_work`, `function afs_flat_call_destructor`, `function afs_notify_end_request_tx`, `function afs_make_call`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- 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.