fs/smb/server/transport_rdma.c
Source file repositories/reference/linux-study-clean/fs/smb/server/transport_rdma.c
File Facts
- System
- Linux kernel
- Corpus path
fs/smb/server/transport_rdma.c- Extension
.c- Size
- 13717 bytes
- Lines
- 544
- 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.
- 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/kthread.hlinux/list.hlinux/string_choices.hglob.hconnection.hsmb_common.h../common/smb2status.htransport_rdma.h
Detected Declarations
struct smb_direct_transportfunction smb_direct_logging_neededfunction smb_direct_logging_vaprintffunction init_smbd_max_io_sizefunction get_smbd_max_read_write_sizefunction smb_direct_free_transportfunction free_transportfunction smb_direct_readfunction smb_direct_writevfunction smb_direct_rdma_writefunction smb_direct_rdma_readfunction smb_direct_disconnectfunction smb_direct_shutdownfunction smb_direct_new_connectionfunction smb_direct_listener_kthread_fnfunction smb_direct_listener_destroyfunction smb_direct_listenfunction ksmbd_rdma_initfunction ksmbd_rdma_stop_listeningfunction ksmbd_rdma_capable_netdev
Annotated Snippet
struct smb_direct_transport {
struct ksmbd_transport transport;
struct smbdirect_socket *socket;
};
static bool smb_direct_logging_needed(struct smbdirect_socket *sc,
void *private_ptr,
unsigned int lvl,
unsigned int cls)
{
if (lvl <= SMBDIRECT_LOG_ERR)
return true;
if (lvl > SMBDIRECT_LOG_INFO)
return false;
switch (cls) {
/*
* These were more or less also logged before
* the move to common code.
*
* SMBDIRECT_LOG_RDMA_MR was not used, but
* that's client only code and we should
* notice if it's used on the server...
*/
case SMBDIRECT_LOG_RDMA_EVENT:
case SMBDIRECT_LOG_RDMA_SEND:
case SMBDIRECT_LOG_RDMA_RECV:
case SMBDIRECT_LOG_WRITE:
case SMBDIRECT_LOG_READ:
case SMBDIRECT_LOG_NEGOTIATE:
case SMBDIRECT_LOG_OUTGOING:
case SMBDIRECT_LOG_RDMA_RW:
case SMBDIRECT_LOG_RDMA_MR:
return true;
/*
* These were not logged before the move
* to common code.
*/
case SMBDIRECT_LOG_KEEP_ALIVE:
case SMBDIRECT_LOG_INCOMING:
return false;
}
/*
* Log all unknown messages
*/
return true;
}
static void smb_direct_logging_vaprintf(struct smbdirect_socket *sc,
const char *func,
unsigned int line,
void *private_ptr,
unsigned int lvl,
unsigned int cls,
struct va_format *vaf)
{
if (lvl <= SMBDIRECT_LOG_ERR)
pr_err("%pV", vaf);
else
ksmbd_debug(RDMA, "%pV", vaf);
}
#define KSMBD_TRANS(t) (&(t)->transport)
#define SMBD_TRANS(t) (container_of(t, \
struct smb_direct_transport, transport))
static const struct ksmbd_transport_ops ksmbd_smb_direct_transport_ops;
void init_smbd_max_io_size(unsigned int sz)
{
sz = clamp_val(sz, SMBD_MIN_IOSIZE, SMBD_MAX_IOSIZE);
smb_direct_max_read_write_size = sz;
}
unsigned int get_smbd_max_read_write_size(struct ksmbd_transport *kt)
{
struct smb_direct_transport *t;
const struct smbdirect_socket_parameters *sp;
if (kt->ops != &ksmbd_smb_direct_transport_ops)
return 0;
t = SMBD_TRANS(kt);
sp = smbdirect_socket_get_current_parameters(t->socket);
return sp->max_read_write_size;
}
Annotation
- Immediate include surface: `linux/kthread.h`, `linux/list.h`, `linux/string_choices.h`, `glob.h`, `connection.h`, `smb_common.h`, `../common/smb2status.h`, `transport_rdma.h`.
- Detected declarations: `struct smb_direct_transport`, `function smb_direct_logging_needed`, `function smb_direct_logging_vaprintf`, `function init_smbd_max_io_size`, `function get_smbd_max_read_write_size`, `function smb_direct_free_transport`, `function free_transport`, `function smb_direct_read`, `function smb_direct_writev`, `function smb_direct_rdma_write`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
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.