diff options
| author | Long Li <longli@microsoft.com> | 2017-11-17 20:26:52 -0500 |
|---|---|---|
| committer | Steve French <smfrench@gmail.com> | 2018-01-24 20:49:05 -0500 |
| commit | 399f9539d951adf26a1078e38c1b0f10cf6c3e71 (patch) | |
| tree | e1f8475082fb3495674dc4a5459a4e78c46e28ec /fs/cifs/smbdirect.c | |
| parent | f198186aa9bbd60fae7a2061f4feec614d880299 (diff) | |
CIFS: SMBD: Implement function to create a SMB Direct connection
The upper layer calls this function to connect to peer through SMB Direct.
Each SMB Direct connection is based on a RDMA RC Queue Pair.
Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Diffstat (limited to 'fs/cifs/smbdirect.c')
| -rw-r--r-- | fs/cifs/smbdirect.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index 2ecd5c19d313..862cdf9424cb 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c | |||
| @@ -1646,3 +1646,20 @@ create_id_failed: | |||
| 1646 | kfree(info); | 1646 | kfree(info); |
| 1647 | return NULL; | 1647 | return NULL; |
| 1648 | } | 1648 | } |
| 1649 | |||
| 1650 | struct smbd_connection *smbd_get_connection( | ||
| 1651 | struct TCP_Server_Info *server, struct sockaddr *dstaddr) | ||
| 1652 | { | ||
| 1653 | struct smbd_connection *ret; | ||
| 1654 | int port = SMBD_PORT; | ||
| 1655 | |||
| 1656 | try_again: | ||
| 1657 | ret = _smbd_get_connection(server, dstaddr, port); | ||
| 1658 | |||
| 1659 | /* Try SMB_PORT if SMBD_PORT doesn't work */ | ||
| 1660 | if (!ret && port == SMBD_PORT) { | ||
| 1661 | port = SMB_PORT; | ||
| 1662 | goto try_again; | ||
| 1663 | } | ||
| 1664 | return ret; | ||
| 1665 | } | ||
