fs/smb/smbdirect/accept.c
Source file repositories/reference/linux-study-clean/fs/smb/smbdirect/accept.c
File Facts
- System
- Linux kernel
- Corpus path
fs/smb/smbdirect/accept.c- Extension
.c- Size
- 25834 bytes
- Lines
- 858
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
internal.hnet/sock.h../common/smb2status.h
Detected Declarations
function smbdirect_accept_connect_requestfunction smbdirect_accept_init_paramsfunction smbdirect_accept_negotiate_recv_donefunction smbdirect_accept_negotiate_recv_workfunction smbdirect_accept_negotiate_finishfunction smbdirect_accept_negotiate_send_donefunction smbdirect_accept_rdma_event_handlerfunction smbdirect_socket_wait_for_acceptexport smbdirect_socket_accept
Annotated Snippet
if (timeo == 0) {
arg->err = -EAGAIN;
return NULL;
}
ret = smbdirect_socket_wait_for_accept(lsc, timeo);
if (ret) {
arg->err = ret;
return NULL;
}
}
spin_lock_irqsave(&lsc->listen.lock, flags);
nsc = list_first_entry_or_null(&lsc->listen.ready,
struct smbdirect_socket,
accept.list);
if (nsc) {
nsc->accept.listener = NULL;
list_del_init_careful(&nsc->accept.list);
arg->is_empty = list_empty_careful(&lsc->listen.ready);
}
spin_unlock_irqrestore(&lsc->listen.lock, flags);
if (!nsc) {
arg->err = -EAGAIN;
return NULL;
}
/*
* We did not send the negotiation response
* yet, so we did not grant any credits to the client,
* so it didn't grant any credits to us.
*
* The caller expects a connected socket
* now as there are no credits anyway.
*
* Then we send the negotiation response in
* order to grant credits to the peer.
*/
nsc->status = SMBDIRECT_SOCKET_CONNECTED;
smbdirect_accept_negotiate_finish(nsc, 0);
return nsc;
}
EXPORT_SYMBOL_GPL(smbdirect_socket_accept);
Annotation
- Immediate include surface: `internal.h`, `net/sock.h`, `../common/smb2status.h`.
- Detected declarations: `function smbdirect_accept_connect_request`, `function smbdirect_accept_init_params`, `function smbdirect_accept_negotiate_recv_done`, `function smbdirect_accept_negotiate_recv_work`, `function smbdirect_accept_negotiate_finish`, `function smbdirect_accept_negotiate_send_done`, `function smbdirect_accept_rdma_event_handler`, `function smbdirect_socket_wait_for_accept`, `export smbdirect_socket_accept`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.