Skip to content

Commit a51c67d

Browse files
metze-sambasmfrench
authored andcommitted
smb: client: make use of smbdirect_socket.disconnect_work
Cc: Steve French <smfrench@gmail.com> Cc: Tom Talpey <tom@talpey.com> Cc: Long Li <longli@microsoft.com> Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 7360778 commit a51c67d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

fs/smb/client/smbdirect.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,8 @@ do { \
157157

158158
static void smbd_disconnect_rdma_work(struct work_struct *work)
159159
{
160-
struct smbd_connection *info =
161-
container_of(work, struct smbd_connection, disconnect_work);
162-
struct smbdirect_socket *sc = &info->socket;
160+
struct smbdirect_socket *sc =
161+
container_of(work, struct smbdirect_socket, disconnect_work);
163162

164163
switch (sc->status) {
165164
case SMBDIRECT_SOCKET_NEGOTIATE_NEEDED:
@@ -197,7 +196,9 @@ static void smbd_disconnect_rdma_work(struct work_struct *work)
197196

198197
static void smbd_disconnect_rdma_connection(struct smbd_connection *info)
199198
{
200-
queue_work(info->workqueue, &info->disconnect_work);
199+
struct smbdirect_socket *sc = &info->socket;
200+
201+
queue_work(info->workqueue, &sc->disconnect_work);
201202
}
202203

203204
/* Upcall from RDMA CM */
@@ -1705,6 +1706,8 @@ static struct smbd_connection *_smbd_get_connection(
17051706
info->initiator_depth = 1;
17061707
info->responder_resources = SMBD_CM_RESPONDER_RESOURCES;
17071708

1709+
INIT_WORK(&sc->disconnect_work, smbd_disconnect_rdma_work);
1710+
17081711
rc = smbd_ia_open(info, dstaddr, port);
17091712
if (rc) {
17101713
log_rdma_event(INFO, "smbd_ia_open rc=%d\n", rc);
@@ -1850,7 +1853,6 @@ static struct smbd_connection *_smbd_get_connection(
18501853

18511854
init_waitqueue_head(&info->wait_post_send);
18521855

1853-
INIT_WORK(&info->disconnect_work, smbd_disconnect_rdma_work);
18541856
INIT_WORK(&info->post_send_credits_work, smbd_post_send_credits);
18551857
info->new_credits_offered = 0;
18561858
spin_lock_init(&info->lock_new_credits_offered);

fs/smb/client/smbdirect.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ enum keep_alive_status {
4545
struct smbd_connection {
4646
struct smbdirect_socket socket;
4747

48-
struct work_struct disconnect_work;
4948
struct work_struct post_send_credits_work;
5049

5150
spinlock_t lock_new_credits_offered;

0 commit comments

Comments
 (0)