Skip to content

Commit 49ca214

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: 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: Stefan Metzmacher <metze@samba.org> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 8f0b4cc commit 49ca214

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

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)