mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 16:01:44 -04:00
smb: server: make use of smbdirect_socket_prepare_create()
This prepares the use of functions from smbdirect_connection.c. Cc: Namjae Jeon <linkinjeon@kernel.org> Cc: Steve French <smfrench@gmail.com> Cc: Tom Talpey <tom@talpey.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>
This commit is contained in:
committed by
Steve French
parent
6acc747906
commit
4624f1bf1b
@@ -422,20 +422,14 @@ static struct smb_direct_transport *alloc_transport(struct rdma_cm_id *cm_id)
|
||||
{
|
||||
struct smb_direct_transport *t;
|
||||
struct smbdirect_socket *sc;
|
||||
struct smbdirect_socket_parameters init_params = {};
|
||||
struct smbdirect_socket_parameters *sp;
|
||||
struct ksmbd_conn *conn;
|
||||
|
||||
t = kzalloc_obj(*t, KSMBD_DEFAULT_GFP);
|
||||
if (!t)
|
||||
return NULL;
|
||||
sc = &t->socket;
|
||||
smbdirect_socket_init(sc);
|
||||
sp = &sc->parameters;
|
||||
|
||||
sc->workqueue = smb_direct_wq;
|
||||
|
||||
INIT_WORK(&sc->disconnect_work, smb_direct_disconnect_rdma_work);
|
||||
|
||||
/*
|
||||
* Create the initial parameters
|
||||
*/
|
||||
sp = &init_params;
|
||||
sp->negotiate_timeout_msec = SMB_DIRECT_NEGOTIATE_TIMEOUT * 1000;
|
||||
sp->initiator_depth = SMB_DIRECT_CM_INITIATOR_DEPTH;
|
||||
sp->responder_resources = 1;
|
||||
@@ -448,6 +442,18 @@ static struct smb_direct_transport *alloc_transport(struct rdma_cm_id *cm_id)
|
||||
sp->keepalive_interval_msec = SMB_DIRECT_KEEPALIVE_SEND_INTERVAL * 1000;
|
||||
sp->keepalive_timeout_msec = SMB_DIRECT_KEEPALIVE_RECV_TIMEOUT * 1000;
|
||||
|
||||
t = kzalloc_obj(*t, KSMBD_DEFAULT_GFP);
|
||||
if (!t)
|
||||
return NULL;
|
||||
sc = &t->socket;
|
||||
smbdirect_socket_prepare_create(sc, sp, smb_direct_wq);
|
||||
/*
|
||||
* from here we operate on the copy.
|
||||
*/
|
||||
sp = &sc->parameters;
|
||||
|
||||
INIT_WORK(&sc->disconnect_work, smb_direct_disconnect_rdma_work);
|
||||
|
||||
sc->rdma.cm_id = cm_id;
|
||||
cm_id->context = sc;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user