Commit 49ca2147 authored by Stefan Metzmacher's avatar Stefan Metzmacher Committed by Steve French
Browse files

smb: smbdirect: introduce smbdirect_socket.connect.{lock,work}



This will first be used by the server in order to defer
the processing of the initial recv of the negotiation
request.

But in future it will also be used by the client in order
to implement an async connect.

Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Signed-off-by: default avatarStefan Metzmacher <metze@samba.org>
Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 8f0b4cce
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -132,6 +132,14 @@ struct smbdirect_socket {

	struct smbdirect_socket_parameters parameters;

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

	/*
	 * The state for keepalive and timeout handling
	 */
@@ -353,6 +361,10 @@ static __always_inline void smbdirect_socket_init(struct smbdirect_socket *sc)
	INIT_WORK(&sc->disconnect_work, __smbdirect_socket_disabled_work);
	disable_work_sync(&sc->disconnect_work);

	spin_lock_init(&sc->connect.lock);
	INIT_WORK(&sc->connect.work, __smbdirect_socket_disabled_work);
	disable_work_sync(&sc->connect.work);

	INIT_WORK(&sc->idle.immediate_work, __smbdirect_socket_disabled_work);
	disable_work_sync(&sc->idle.immediate_work);
	INIT_DELAYED_WORK(&sc->idle.timer_work, __smbdirect_socket_disabled_work);