fs/smb/smbdirect/socket.h
Source file repositories/reference/linux-study-clean/fs/smb/smbdirect/socket.h
File Facts
- System
- Linux kernel
- Corpus path
fs/smb/smbdirect/socket.h- Extension
.h- Size
- 20789 bytes
- Lines
- 833
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/wait.hlinux/workqueue.hlinux/kref.hlinux/mempool.hlinux/spinlock.hlinux/mutex.hlinux/completion.hrdma/rw.h
Detected Declarations
struct smbdirect_socketstruct smbdirect_send_iostruct smbdirect_send_batchstruct smbdirect_recv_iostruct smbdirect_mr_iostruct smbdirect_rw_ioenum smbdirect_socket_statusenum smbdirect_keepalive_statusenum smbdirect_mr_statefunction SMBDIRECT_DEBUG_ERR_PTRfunction __smbdirect_socket_disabled_workfunction __smbdirect_log_neededfunction __smbdirect_log_vaprintffunction __smbdirect_log_printffunction __smbdirect_log_genericfunction smbdirect_get_buf_page_count
Annotated Snippet
struct smbdirect_socket {
enum smbdirect_socket_status status;
wait_queue_head_t status_wait;
int first_error;
/*
* This points to the workqueues to
* be used for this socket.
*/
struct {
struct workqueue_struct *accept;
struct workqueue_struct *connect;
struct workqueue_struct *idle;
struct workqueue_struct *refill;
struct workqueue_struct *immediate;
struct workqueue_struct *cleanup;
} workqueues;
struct work_struct disconnect_work;
/*
* The reference counts.
*/
struct {
/*
* This holds the references by the
* frontend, typically the smb layer.
*
* It is typically 1 and a disconnect
* will happen if it reaches 0.
*/
struct kref disconnect;
/*
* This holds the reference by the
* backend, the code that manages
* the lifetime of the whole
* struct smbdirect_socket,
* if this reaches 0 it can will
* be freed.
*
* Can be REFCOUNT_MAX is part
* of another structure.
*
* This is equal or higher than
* the disconnect refcount.
*/
struct kref destroy;
} refs;
/* RDMA related */
struct {
struct rdma_cm_id *cm_id;
/*
* The expected event in our current
* cm_id->event_handler, all other events
* are treated as an error.
*/
enum rdma_cm_event_type expected_event;
/*
* This is for iWarp MPA v1
*/
bool legacy_iwarp;
} rdma;
/* IB verbs related */
struct {
struct ib_pd *pd;
enum ib_poll_context poll_ctx;
struct ib_cq *send_cq;
struct ib_cq *recv_cq;
/*
* shortcuts for rdma.cm_id->{qp,device};
*/
struct ib_qp *qp;
struct ib_device *dev;
} ib;
struct smbdirect_socket_parameters parameters;
/*
* The state for connect/negotiation
*/
struct {
spinlock_t lock;
struct work_struct work;
} connect;
/*
Annotation
- Immediate include surface: `linux/wait.h`, `linux/workqueue.h`, `linux/kref.h`, `linux/mempool.h`, `linux/spinlock.h`, `linux/mutex.h`, `linux/completion.h`, `rdma/rw.h`.
- Detected declarations: `struct smbdirect_socket`, `struct smbdirect_send_io`, `struct smbdirect_send_batch`, `struct smbdirect_recv_io`, `struct smbdirect_mr_io`, `struct smbdirect_rw_io`, `enum smbdirect_socket_status`, `enum smbdirect_keepalive_status`, `enum smbdirect_mr_state`, `function SMBDIRECT_DEBUG_ERR_PTR`.
- 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.