fs/smb/smbdirect/socket.h

Source file repositories/reference/linux-study-clean/fs/smb/smbdirect/socket.h

File Facts

System
Linux kernel
Corpus path
fs/smb/smbdirect/socket.h
Extension
.h
Size
20789 bytes
Lines
833
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct smbdirect_socket {
	enum smbdirect_socket_status status;
	wait_queue_head_t status_wait;
	int first_error;

	/*
	 * This points to the workqueues to
	 * be used for this socket.
	 */
	struct {
		struct workqueue_struct *accept;
		struct workqueue_struct *connect;
		struct workqueue_struct *idle;
		struct workqueue_struct *refill;
		struct workqueue_struct *immediate;
		struct workqueue_struct *cleanup;
	} workqueues;

	struct work_struct disconnect_work;

	/*
	 * The reference counts.
	 */
	struct {
		/*
		 * This holds the references by the
		 * frontend, typically the smb layer.
		 *
		 * It is typically 1 and a disconnect
		 * will happen if it reaches 0.
		 */
		struct kref disconnect;

		/*
		 * This holds the reference by the
		 * backend, the code that manages
		 * the lifetime of the whole
		 * struct smbdirect_socket,
		 * if this reaches 0 it can will
		 * be freed.
		 *
		 * Can be REFCOUNT_MAX is part
		 * of another structure.
		 *
		 * This is equal or higher than
		 * the disconnect refcount.
		 */
		struct kref destroy;
	} refs;

	/* RDMA related */
	struct {
		struct rdma_cm_id *cm_id;
		/*
		 * The expected event in our current
		 * cm_id->event_handler, all other events
		 * are treated as an error.
		 */
		enum rdma_cm_event_type expected_event;
		/*
		 * This is for iWarp MPA v1
		 */
		bool legacy_iwarp;
	} rdma;

	/* IB verbs related */
	struct {
		struct ib_pd *pd;
		enum ib_poll_context poll_ctx;
		struct ib_cq *send_cq;
		struct ib_cq *recv_cq;

		/*
		 * shortcuts for rdma.cm_id->{qp,device};
		 */
		struct ib_qp *qp;
		struct ib_device *dev;
	} ib;

	struct smbdirect_socket_parameters parameters;

	/*
	 * The state for connect/negotiation
	 */
	struct {
		spinlock_t lock;
		struct work_struct work;
	} connect;

	/*

Annotation

Implementation Notes