include/linux/sunrpc/xprt.h
Source file repositories/reference/linux-study-clean/include/linux/sunrpc/xprt.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/sunrpc/xprt.h- Extension
.h- Size
- 17354 bytes
- Lines
- 541
- 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.
- 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/uio.hlinux/socket.hlinux/in.hlinux/ktime.hlinux/kref.hlinux/sunrpc/sched.hlinux/sunrpc/xdr.hlinux/sunrpc/msg_prot.hlinux/lwq.h
Detected Declarations
struct rpc_taskstruct rpc_xprtstruct xprt_classstruct seq_filestruct svc_servstruct netstruct rpc_rqststruct xprtsec_parmsstruct rpc_xprt_opsstruct rpc_sysfs_xprtstruct rpc_xprtstruct xprt_createstruct xprt_classenum rpc_display_format_tenum xprtsec_policiesenum xprt_transportsfunction xprt_rqst_add_seqnofunction bc_preallocfunction bc_preallocfunction xprt_enable_swapfunction xprt_disable_swapfunction xprt_set_connectedfunction xprt_clear_connectedfunction xprt_connectedfunction xprt_test_and_set_connectedfunction xprt_test_and_clear_connectedfunction xprt_clear_connectingfunction xprt_connectingfunction xprt_test_and_set_connectingfunction xprt_set_boundfunction xprt_boundfunction xprt_clear_boundfunction xprt_clear_bindingfunction xprt_test_and_set_binding
Annotated Snippet
struct rpc_rqst {
/*
* This is the user-visible part
*/
struct rpc_xprt * rq_xprt; /* RPC client */
struct xdr_buf rq_snd_buf; /* send buffer */
struct xdr_buf rq_rcv_buf; /* recv buffer */
/*
* This is the private part
*/
struct rpc_task * rq_task; /* RPC task data */
struct rpc_cred * rq_cred; /* Bound cred */
__be32 rq_xid; /* request XID */
int rq_cong; /* has incremented xprt->cong */
u32 rq_seqnos[RPC_GSS_SEQNO_ARRAY_SIZE]; /* past gss req seq nos. */
unsigned int rq_seqno_count; /* number of entries in rq_seqnos */
int rq_enc_pages_num;
struct page **rq_enc_pages; /* scratch pages for use by
gss privacy code */
void (*rq_release_snd_buf)(struct rpc_rqst *); /* release rq_enc_pages */
union {
struct list_head rq_list; /* Slot allocation list */
struct rb_node rq_recv; /* Receive queue */
};
struct list_head rq_xmit; /* Send queue */
struct list_head rq_xmit2; /* Send queue */
void *rq_buffer; /* Call XDR encode buffer */
size_t rq_callsize;
void *rq_rbuffer; /* Reply XDR decode buffer */
size_t rq_rcvsize;
size_t rq_xmit_bytes_sent; /* total bytes sent */
size_t rq_reply_bytes_recvd; /* total reply bytes */
/* received */
struct xdr_buf rq_private_buf; /* The receive buffer
* used in the softirq.
*/
unsigned long rq_majortimeo; /* major timeout alarm */
unsigned long rq_minortimeo; /* minor timeout alarm */
unsigned long rq_timeout; /* Current timeout value */
ktime_t rq_rtt; /* round-trip time */
unsigned int rq_retries; /* # of retries */
unsigned int rq_connect_cookie;
/* A cookie used to track the
state of the transport
connection */
atomic_t rq_pin;
/*
* Partial send handling
*/
u32 rq_bytes_sent; /* Bytes we have sent */
ktime_t rq_xtime; /* transmit time stamp */
int rq_ntrans;
#if defined(CONFIG_SUNRPC_BACKCHANNEL)
struct lwq_node rq_bc_list; /* Callback service list */
unsigned long rq_bc_pa_state; /* Backchannel prealloc state */
struct list_head rq_bc_pa_list; /* Backchannel prealloc list */
#endif /* CONFIG_SUNRPC_BACKCHANEL */
};
#define rq_svec rq_snd_buf.head
#define rq_slen rq_snd_buf.len
static inline int xprt_rqst_add_seqno(struct rpc_rqst *req, u32 seqno)
{
if (likely(req->rq_seqno_count < RPC_GSS_SEQNO_ARRAY_SIZE))
req->rq_seqno_count++;
/* Shift array to make room for the newest element at the beginning */
memmove(&req->rq_seqnos[1], &req->rq_seqnos[0],
(RPC_GSS_SEQNO_ARRAY_SIZE - 1) * sizeof(req->rq_seqnos[0]));
req->rq_seqnos[0] = seqno;
return 0;
}
/* RPC transport layer security policies */
enum xprtsec_policies {
RPC_XPRTSEC_NONE = 0,
RPC_XPRTSEC_TLS_ANON,
RPC_XPRTSEC_TLS_X509,
};
struct xprtsec_parms {
enum xprtsec_policies policy;
Annotation
- Immediate include surface: `linux/uio.h`, `linux/socket.h`, `linux/in.h`, `linux/ktime.h`, `linux/kref.h`, `linux/sunrpc/sched.h`, `linux/sunrpc/xdr.h`, `linux/sunrpc/msg_prot.h`.
- Detected declarations: `struct rpc_task`, `struct rpc_xprt`, `struct xprt_class`, `struct seq_file`, `struct svc_serv`, `struct net`, `struct rpc_rqst`, `struct xprtsec_parms`, `struct rpc_xprt_ops`, `struct rpc_sysfs_xprt`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.