Skip to content

Commit 0d57cb1

Browse files
metze-sambasmfrench
authored andcommitted
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: Steve French <smfrench@gmail.com> Cc: Tom Talpey <tom@talpey.com> Cc: Long Li <longli@microsoft.com> Cc: Namjae Jeon <linkinjeon@kernel.org> Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent ebc84a2 commit 0d57cb1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

fs/smb/common/smbdirect/smbdirect_socket.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ struct smbdirect_socket {
132132

133133
struct smbdirect_socket_parameters parameters;
134134

135+
/*
136+
* The state for connect/negotiation
137+
*/
138+
struct {
139+
spinlock_t lock;
140+
struct work_struct work;
141+
} connect;
142+
135143
/*
136144
* The state for keepalive and timeout handling
137145
*/
@@ -353,6 +361,10 @@ static __always_inline void smbdirect_socket_init(struct smbdirect_socket *sc)
353361
INIT_WORK(&sc->disconnect_work, __smbdirect_socket_disabled_work);
354362
disable_work_sync(&sc->disconnect_work);
355363

364+
spin_lock_init(&sc->connect.lock);
365+
INIT_WORK(&sc->connect.work, __smbdirect_socket_disabled_work);
366+
disable_work_sync(&sc->connect.work);
367+
356368
INIT_WORK(&sc->idle.immediate_work, __smbdirect_socket_disabled_work);
357369
disable_work_sync(&sc->idle.immediate_work);
358370
INIT_DELAYED_WORK(&sc->idle.timer_work, __smbdirect_socket_disabled_work);

0 commit comments

Comments
 (0)