diff options
| author | Stefan Metzmacher <metze@samba.org> | 2025-08-26 16:32:48 +0300 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2026-04-16 05:58:20 +0300 |
| commit | dd43c2227394472aa6e438ddffc2f58028de7531 (patch) | |
| tree | e94ec57699a56082d50a2557bda391777a8f17ce | |
| parent | f9a804da479cc41172f1039b4ffde06a09920506 (diff) | |
| download | linux-dd43c2227394472aa6e438ddffc2f58028de7531.tar.xz | |
smb: client: make use of smbdirect_socket_prepare_create()
This prepares the use of functions from smbdirect_connection.c.
Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>
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>
| -rw-r--r-- | fs/smb/client/smbdirect.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c index f5ba33460723..2d6d8a1e2d99 100644 --- a/fs/smb/client/smbdirect.c +++ b/fs/smb/client/smbdirect.c @@ -2111,6 +2111,7 @@ static struct smbd_connection *_smbd_get_connection( int rc; struct smbd_connection *info; struct smbdirect_socket *sc; + struct smbdirect_socket_parameters init_params = {}; struct smbdirect_socket_parameters *sp; struct rdma_conn_param conn_param; struct ib_qp_cap qp_cap; @@ -2121,20 +2122,10 @@ static struct smbd_connection *_smbd_get_connection( char wq_name[80]; struct workqueue_struct *workqueue; - info = kzalloc_obj(struct smbd_connection); - if (!info) - return NULL; - sc = &info->socket; - scnprintf(wq_name, ARRAY_SIZE(wq_name), "smbd_%p", sc); - workqueue = create_workqueue(wq_name); - if (!workqueue) - goto create_wq_failed; - smbdirect_socket_init(sc); - sc->workqueue = workqueue; - sp = &sc->parameters; - - INIT_WORK(&sc->disconnect_work, smbd_disconnect_rdma_work); - + /* + * Create the initial parameters + */ + sp = &init_params; sp->resolve_addr_timeout_msec = RDMA_RESOLVE_TIMEOUT; sp->resolve_route_timeout_msec = RDMA_RESOLVE_TIMEOUT; sp->rdma_connect_timeout_msec = RDMA_RESOLVE_TIMEOUT; @@ -2150,6 +2141,22 @@ static struct smbd_connection *_smbd_get_connection( sp->keepalive_interval_msec = smbd_keep_alive_interval * 1000; sp->keepalive_timeout_msec = KEEPALIVE_RECV_TIMEOUT * 1000; + info = kzalloc_obj(*info); + if (!info) + return NULL; + sc = &info->socket; + scnprintf(wq_name, ARRAY_SIZE(wq_name), "smbd_%p", sc); + workqueue = create_workqueue(wq_name); + if (!workqueue) + goto create_wq_failed; + smbdirect_socket_prepare_create(sc, sp, workqueue); + /* + * from here we operate on the copy. + */ + sp = &sc->parameters; + + INIT_WORK(&sc->disconnect_work, smbd_disconnect_rdma_work); + rc = smbd_ia_open(sc, dstaddr, port); if (rc) { log_rdma_event(INFO, "smbd_ia_open rc=%d\n", rc); |
