include/linux/sunrpc/rpc_rdma.h
Source file repositories/reference/linux-study-clean/include/linux/sunrpc/rpc_rdma.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/sunrpc/rpc_rdma.h- Extension
.h- Size
- 6219 bytes
- Lines
- 202
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/bitops.h
Detected Declarations
struct rpcrdma_connect_privateenum rpcrdma_errcodeenum rpcrdma_procfunction rpcrdma_encode_buffer_sizefunction rpcrdma_decode_buffer_size
Annotated Snippet
struct rpcrdma_connect_private {
__be32 cp_magic;
u8 cp_version;
u8 cp_flags;
u8 cp_send_size;
u8 cp_recv_size;
} __packed;
#define rpcrdma_cmp_magic __cpu_to_be32(0xf6ab0e18)
enum {
RPCRDMA_CMP_VERSION = 1,
RPCRDMA_CMP_F_SND_W_INV_OK = BIT(0),
};
static inline u8
rpcrdma_encode_buffer_size(unsigned int size)
{
return (size >> 10) - 1;
}
static inline unsigned int
rpcrdma_decode_buffer_size(u8 val)
{
return ((unsigned int)val + 1) << 10;
}
/**
* xdr_encode_rdma_segment - Encode contents of an RDMA segment
* @p: Pointer into a send buffer
* @handle: The RDMA handle to encode
* @length: The RDMA length to encode
* @offset: The RDMA offset to encode
*
* Return value:
* Pointer to the XDR position that follows the encoded RDMA segment
*/
static inline __be32 *xdr_encode_rdma_segment(__be32 *p, u32 handle,
u32 length, u64 offset)
{
*p++ = cpu_to_be32(handle);
*p++ = cpu_to_be32(length);
return xdr_encode_hyper(p, offset);
}
/**
* xdr_encode_read_segment - Encode contents of a Read segment
* @p: Pointer into a send buffer
* @position: The position to encode
* @handle: The RDMA handle to encode
* @length: The RDMA length to encode
* @offset: The RDMA offset to encode
*
* Return value:
* Pointer to the XDR position that follows the encoded Read segment
*/
static inline __be32 *xdr_encode_read_segment(__be32 *p, u32 position,
u32 handle, u32 length,
u64 offset)
{
*p++ = cpu_to_be32(position);
return xdr_encode_rdma_segment(p, handle, length, offset);
}
/**
* xdr_decode_rdma_segment - Decode contents of an RDMA segment
* @p: Pointer to the undecoded RDMA segment
* @handle: Upon return, the RDMA handle
* @length: Upon return, the RDMA length
* @offset: Upon return, the RDMA offset
*
* Return value:
* Pointer to the XDR item that follows the RDMA segment
*/
static inline __be32 *xdr_decode_rdma_segment(__be32 *p, u32 *handle,
u32 *length, u64 *offset)
{
*handle = be32_to_cpup(p++);
*length = be32_to_cpup(p++);
return xdr_decode_hyper(p, offset);
}
/**
* xdr_decode_read_segment - Decode contents of a Read segment
* @p: Pointer to the undecoded Read segment
* @position: Upon return, the segment's position
* @handle: Upon return, the RDMA handle
* @length: Upon return, the RDMA length
* @offset: Upon return, the RDMA offset
*
Annotation
- Immediate include surface: `linux/types.h`, `linux/bitops.h`.
- Detected declarations: `struct rpcrdma_connect_private`, `enum rpcrdma_errcode`, `enum rpcrdma_proc`, `function rpcrdma_encode_buffer_size`, `function rpcrdma_decode_buffer_size`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.