include/net/9p/client.h

Source file repositories/reference/linux-study-clean/include/net/9p/client.h

File Facts

System
Linux kernel
Corpus path
include/net/9p/client.h
Extension
.h
Size
11932 bytes
Lines
401
Domain
Networking Core
Bucket
Sockets, Protocols, Packet Path, And Network Policy
Inferred role
Networking Core: implementation source
Status
source implementation candidate

Why This File Exists

Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.

Dependency Surface

Detected Declarations

Annotated Snippet

struct p9_req_t {
	int status;
	int t_err;
	refcount_t refcount;
	wait_queue_head_t wq;
	struct p9_fcall tc;
	struct p9_fcall rc;
	struct list_head req_list;
};

/**
 * struct p9_client - per client instance state
 * @lock: protect @fids and @reqs
 * @msize: maximum data size negotiated by protocol
 * @proto_version: 9P protocol version to use
 * @trans_mod: module API instantiated with this client
 * @status: connection state
 * @trans: tranport instance state and API
 * @fids: All active FID handles
 * @reqs: All active requests.
 * @name: node name used as client id
 *
 * The client structure is used to keep track of various per-client
 * state that has been instantiated.
 */
struct p9_client {
	spinlock_t lock;
	unsigned int msize;
	unsigned char proto_version;
	struct p9_trans_module *trans_mod;
	enum p9_trans_status status;
	void *trans;
	struct kmem_cache *fcall_cache;

	union {
		struct {
			int rfd;
			int wfd;
		} fd;
		struct {
			u16 port;
			bool privport;

		} tcp;
	} trans_opts;

	struct idr fids;
	struct idr reqs;

	char name[__NEW_UTS_LEN + 1];
};

/**
 * struct p9_fd_opts - holds client options during parsing
 * @msize: maximum data size negotiated by protocol
 * @prot-Oversion: 9P protocol version to use
 * @trans_mod: module API instantiated with this client
 *
 * These parsed options get transferred into client in
 * apply_client_options()
 */
struct p9_client_opts {
	unsigned int msize;
	unsigned char proto_version;
	struct p9_trans_module *trans_mod;
};

/**
 * struct p9_fd_opts - per-transport options for fd transport
 * @rfd: file descriptor for reading (trans=fd)
 * @wfd: file descriptor for writing (trans=fd)
 * @port: port to connect to (trans=tcp)
 * @privport: port is privileged
 */
struct p9_fd_opts {
	int rfd;
	int wfd;
	u16 port;
	bool privport;
};

/**
 * struct p9_rdma_opts - Collection of mount options for rdma transport
 * @port: port of connection
 * @privport: Whether a privileged port may be used
 * @sq_depth: The requested depth of the SQ. This really doesn't need
 * to be any deeper than the number of threads used in the client
 * @rq_depth: The depth of the RQ. Should be greater than or equal to SQ depth
 * @timeout: Time to wait in msecs for CM events
 */

Annotation

Implementation Notes