From: Stefan Metzmacher Date: Fri, 17 Oct 2025 20:10:50 +0000 (+0200) Subject: smb: smbdirect: introduce smbdirect_connection_send_immediate_work() X-Git-Tag: v7.1-rc1~128^2~104 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=db3092ed2f0bec27eb289755173134e46e3ae7a4;p=thirdparty%2Flinux.git smb: smbdirect: introduce smbdirect_connection_send_immediate_work() This is a combination of smb_direct_send_immediate_work() in the server as well as send_immediate_empty_message() and smbd_post_send_empty() in the client. smbdirect_connection_send_immediate_work() replace all of them in client and server. Cc: Steve French Cc: Tom Talpey Cc: Long Li Cc: Namjae Jeon Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Signed-off-by: Stefan Metzmacher Acked-by: Namjae Jeon Signed-off-by: Steve French --- diff --git a/fs/smb/common/smbdirect/smbdirect_connection.c b/fs/smb/common/smbdirect/smbdirect_connection.c index bebee5bf072cd..69b00192cb081 100644 --- a/fs/smb/common/smbdirect/smbdirect_connection.c +++ b/fs/smb/common/smbdirect/smbdirect_connection.c @@ -1302,6 +1302,28 @@ skip_free: wake_up(&sc->send_io.pending.dec_wait_queue); } +__maybe_unused /* this is temporary while this file is included in others */ +static void smbdirect_connection_send_immediate_work(struct work_struct *work) +{ + struct smbdirect_socket *sc = + container_of(work, struct smbdirect_socket, idle.immediate_work); + int ret; + + if (sc->status != SMBDIRECT_SOCKET_CONNECTED) + return; + + smbdirect_log_keep_alive(sc, SMBDIRECT_LOG_INFO, + "send an empty message\n"); + sc->statistics.send_empty++; + ret = smbdirect_connection_send_single_iter(sc, NULL, NULL, 0, 0); + if (ret < 0) { + smbdirect_log_write(sc, SMBDIRECT_LOG_ERR, + "smbdirect_connection_send_single_iter ret=%1pe\n", + SMBDIRECT_DEBUG_ERR_PTR(ret)); + smbdirect_socket_schedule_cleanup(sc, ret); + } +} + __maybe_unused /* this is temporary while this file is included in others */ static int smbdirect_connection_post_recv_io(struct smbdirect_recv_io *msg) {