mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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 <[email protected]> Signed-off-by: Steve French <[email protected]> Reviewed-by: Pavel Shilovsky <[email protected]>
This commit is contained in:
parent
f198186aa9
commit
399f9539d9
2 changed files with 23 additions and 0 deletions
|
|
@ -1646,3 +1646,20 @@ create_id_failed:
|
|||
kfree(info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct smbd_connection *smbd_get_connection(
|
||||
struct TCP_Server_Info *server, struct sockaddr *dstaddr)
|
||||
{
|
||||
struct smbd_connection *ret;
|
||||
int port = SMBD_PORT;
|
||||
|
||||
try_again:
|
||||
ret = _smbd_get_connection(server, dstaddr, port);
|
||||
|
||||
/* Try SMB_PORT if SMBD_PORT doesn't work */
|
||||
if (!ret && port == SMBD_PORT) {
|
||||
port = SMB_PORT;
|
||||
goto try_again;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -243,9 +243,15 @@ struct smbd_response {
|
|||
u8 packet[];
|
||||
};
|
||||
|
||||
/* Create a SMBDirect session */
|
||||
struct smbd_connection *smbd_get_connection(
|
||||
struct TCP_Server_Info *server, struct sockaddr *dstaddr);
|
||||
|
||||
#else
|
||||
#define cifs_rdma_enabled(server) 0
|
||||
struct smbd_connection {};
|
||||
static inline void *smbd_get_connection(
|
||||
struct TCP_Server_Info *server, struct sockaddr *dstaddr) {return NULL;}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue