summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smbdirect.c
diff options
context:
space:
mode:
authorLong Li <longli@microsoft.com>2017-11-22 17:38:37 -0700
committerSteve French <smfrench@gmail.com>2018-01-24 19:49:06 -0600
commit8ef130f9ec27973f7b49e20c5a3b9134ca33026c (patch)
tree563cf221e25dab8743dabf4e3cd42e04c5fc8e23 /fs/cifs/smbdirect.c
parent781a8050f2a8e1474a75122b7d940959cc579e14 (diff)
downloadlinux-8ef130f9ec27973f7b49e20c5a3b9134ca33026c.tar.bz2
CIFS: SMBD: Implement function to destroy a SMB Direct connection
Add function to tear down a SMB Direct connection. This is used by upper layer to free all SMB Direct connection and transport resources. Signed-off-by: Long Li <longli@microsoft.com> Signed-off-by: Steve French <smfrench@gmail.com> Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Diffstat (limited to 'fs/cifs/smbdirect.c')
-rw-r--r--fs/cifs/smbdirect.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c
index a96058a3ad87..b462a2f3863b 100644
--- a/fs/cifs/smbdirect.c
+++ b/fs/cifs/smbdirect.c
@@ -1387,6 +1387,22 @@ static void idle_connection_timer(struct work_struct *work)
info->keep_alive_interval*HZ);
}
+/* Destroy this SMBD connection, called from upper layer */
+void smbd_destroy(struct smbd_connection *info)
+{
+ log_rdma_event(INFO, "destroying rdma session\n");
+
+ /* Kick off the disconnection process */
+ smbd_disconnect_rdma_connection(info);
+
+ log_rdma_event(INFO, "wait for transport being destroyed\n");
+ wait_event(info->wait_destroy,
+ info->transport_status == SMBD_DESTROYED);
+
+ destroy_workqueue(info->workqueue);
+ kfree(info);
+}
+
/*
* Reconnect this SMBD connection, called from upper layer
* return value: 0 on success, or actual error code