[PATCH v4 138/145] smb: client: no longer use smbdirect_socket_set_custom_workqueue()

Stefan Metzmacher metze at samba.org
Tue Nov 25 17:56:24 UTC 2025


smbdirect.ko has global workqueues now, so we should use these
default once.

Cc: Steve French <smfrench at gmail.com>
Cc: Tom Talpey <tom at talpey.com>
Cc: Long Li <longli at microsoft.com>
Cc: Namjae Jeon <linkinjeon at kernel.org>
Cc: linux-cifs at vger.kernel.org
Cc: samba-technical at lists.samba.org
Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 fs/smb/client/smbdirect.c | 12 ------------
 fs/smb/client/smbdirect.h |  1 -
 2 files changed, 13 deletions(-)

diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c
index 0c3a4b6aa03f..4b9ae71c323b 100644
--- a/fs/smb/client/smbdirect.c
+++ b/fs/smb/client/smbdirect.c
@@ -196,7 +196,6 @@ void smbd_destroy(struct TCP_Server_Info *server)
 
 	smbdirect_socket_release(info->socket);
 
-	destroy_workqueue(info->workqueue);
 	kfree(info);
 	server->smbd_conn = NULL;
 }
@@ -245,7 +244,6 @@ static struct smbd_connection *_smbd_get_connection(
 	struct smbdirect_socket_parameters init_params = {};
 	struct smbdirect_socket_parameters *sp;
 	__be16 *sport;
-	char wq_name[80];
 	int ret;
 
 	/*
@@ -270,10 +268,6 @@ static struct smbd_connection *_smbd_get_connection(
 	info = kzalloc(sizeof(struct smbd_connection), GFP_KERNEL);
 	if (!info)
 		return NULL;
-	scnprintf(wq_name, ARRAY_SIZE(wq_name), "smbd_%p", info);
-	info->workqueue = create_workqueue(wq_name);
-	if (!info->workqueue)
-		goto create_wq_failed;
 	ret = smbdirect_socket_create_kern(net, &sc);
 	if (ret)
 		goto socket_init_failed;
@@ -284,9 +278,6 @@ static struct smbd_connection *_smbd_get_connection(
 	ret = smbdirect_socket_set_kernel_settings(sc, IB_POLL_SOFTIRQ, GFP_KERNEL);
 	if (ret)
 		goto set_settings_failed;
-	ret = smbdirect_socket_set_custom_workqueue(sc, info->workqueue);
-	if (ret)
-		goto set_workqueue_failed;
 
 	if (dstaddr->sa_family == AF_INET6)
 		sport = &((struct sockaddr_in6 *)dstaddr)->sin6_port;
@@ -306,13 +297,10 @@ static struct smbd_connection *_smbd_get_connection(
 	return info;
 
 connect_failed:
-set_workqueue_failed:
 set_settings_failed:
 set_params_failed:
 	smbdirect_socket_release(sc);
 socket_init_failed:
-	destroy_workqueue(info->workqueue);
-create_wq_failed:
 	kfree(info);
 	return NULL;
 }
diff --git a/fs/smb/client/smbdirect.h b/fs/smb/client/smbdirect.h
index bd03ae72e9c8..0017d5b2de44 100644
--- a/fs/smb/client/smbdirect.h
+++ b/fs/smb/client/smbdirect.h
@@ -25,7 +25,6 @@ extern int smbd_receive_credit_max;
 
 struct smbd_connection {
 	struct smbdirect_socket *socket;
-	struct workqueue_struct *workqueue;
 };
 
 /* Create a SMBDirect session */
-- 
2.43.0




More information about the samba-technical mailing list