include/linux/sunrpc/svc_xprt.h
Source file repositories/reference/linux-study-clean/include/linux/sunrpc/svc_xprt.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/sunrpc/svc_xprt.h- Extension
.h- Size
- 8414 bytes
- Lines
- 273
- 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/sunrpc/svc.h
Detected Declarations
struct modulestruct svc_xprt_opsstruct svc_xprt_classstruct svc_xpt_userstruct svc_xprtfunction svc_xprt_set_validfunction unregister_xpt_userfunction register_xpt_userfunction svc_xprt_is_deadfunction svc_xprt_getfunction svc_xprt_set_localfunction svc_xprt_set_remotefunction svc_addr_portfunction svc_addr_lenfunction svc_xprt_local_portfunction svc_xprt_remote_port
Annotated Snippet
struct svc_xprt_ops {
struct svc_xprt *(*xpo_create)(struct svc_serv *,
struct net *net,
struct sockaddr *, int,
int);
struct svc_xprt *(*xpo_accept)(struct svc_xprt *);
int (*xpo_has_wspace)(struct svc_xprt *);
int (*xpo_recvfrom)(struct svc_rqst *);
int (*xpo_sendto)(struct svc_rqst *);
int (*xpo_result_payload)(struct svc_rqst *, unsigned int,
unsigned int);
void (*xpo_release_ctxt)(struct svc_xprt *xprt, void *ctxt);
void (*xpo_detach)(struct svc_xprt *);
void (*xpo_free)(struct svc_xprt *);
void (*xpo_kill_temp_xprt)(struct svc_xprt *);
void (*xpo_handshake)(struct svc_xprt *xprt);
};
struct svc_xprt_class {
const char *xcl_name;
struct module *xcl_owner;
const struct svc_xprt_ops *xcl_ops;
struct list_head xcl_list;
u32 xcl_max_payload;
int xcl_ident;
};
/*
* This is embedded in an object that wants a callback before deleting
* an xprt; intended for use by NFSv4.1, which needs to know when a
* client's tcp connection (and hence possibly a backchannel) goes away.
*/
struct svc_xpt_user {
struct list_head list;
void (*callback)(struct svc_xpt_user *);
};
struct svc_xprt {
struct svc_xprt_class *xpt_class;
const struct svc_xprt_ops *xpt_ops;
struct kref xpt_ref;
ktime_t xpt_qtime;
struct list_head xpt_list;
struct lwq_node xpt_ready;
unsigned long xpt_flags;
struct svc_serv *xpt_server; /* service for transport */
atomic_t xpt_reserved; /* space on outq that is rsvd */
atomic_t xpt_nr_rqsts; /* Number of requests */
struct mutex xpt_mutex; /* to serialize sending data */
spinlock_t xpt_lock; /* protects sk_deferred
* and xpt_auth_cache */
void *xpt_auth_cache;/* auth cache */
struct list_head xpt_deferred; /* deferred requests that need
* to be revisted */
struct sockaddr_storage xpt_local; /* local address */
size_t xpt_locallen; /* length of address */
struct sockaddr_storage xpt_remote; /* remote peer's address */
size_t xpt_remotelen; /* length of address */
char xpt_remotebuf[INET6_ADDRSTRLEN + 10];
struct list_head xpt_users; /* callbacks on free */
struct net *xpt_net;
netns_tracker ns_tracker;
const struct cred *xpt_cred;
struct rpc_xprt *xpt_bc_xprt; /* NFSv4.1 backchannel */
struct rpc_xprt_switch *xpt_bc_xps; /* NFSv4.1 backchannel */
};
/* flag bits for xpt_flags */
enum {
XPT_BUSY, /* enqueued/receiving */
XPT_CONN, /* conn pending */
XPT_CLOSE, /* dead or dying */
XPT_DATA, /* data pending */
XPT_TEMP, /* connected transport */
XPT_DEAD, /* transport closed */
XPT_CHNGBUF, /* need to change snd/rcv buf sizes */
XPT_DEFERRED, /* deferred request pending */
XPT_OLD, /* used for xprt aging mark+sweep */
XPT_LISTENER, /* listening endpoint */
XPT_CACHE_AUTH, /* cache auth info */
XPT_LOCAL, /* connection from loopback interface */
XPT_KILL_TEMP, /* call xpo_kill_temp_xprt before closing */
XPT_CONG_CTRL, /* has congestion control */
XPT_HANDSHAKE, /* xprt requests a handshake */
XPT_TLS_SESSION, /* transport-layer security established */
XPT_PEER_AUTH, /* peer has been authenticated */
XPT_PEER_VALID, /* peer has presented a filehandle that
* it has access to. It is NOT counted
Annotation
- Immediate include surface: `linux/sunrpc/svc.h`.
- Detected declarations: `struct module`, `struct svc_xprt_ops`, `struct svc_xprt_class`, `struct svc_xpt_user`, `struct svc_xprt`, `function svc_xprt_set_valid`, `function unregister_xpt_user`, `function register_xpt_user`, `function svc_xprt_is_dead`, `function svc_xprt_get`.
- 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.