From: Stefan Metzmacher Date: Thu, 23 Oct 2025 11:40:43 +0000 (+0200) Subject: smb: smbdirect: introduce smbdirect_socket_set_logging() X-Git-Tag: v7.1-rc1~128^2~138 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=036614cb738a9d092814eba48286da6e1c63f704;p=thirdparty%2Fkernel%2Flinux.git smb: smbdirect: introduce smbdirect_socket_set_logging() This will be used by client and server in order to setup their own logging functions. 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_socket.c b/fs/smb/common/smbdirect/smbdirect_socket.c index 421a5c2c705eb..6c2732496cf73 100644 --- a/fs/smb/common/smbdirect/smbdirect_socket.c +++ b/fs/smb/common/smbdirect/smbdirect_socket.c @@ -24,3 +24,23 @@ static void smbdirect_socket_prepare_create(struct smbdirect_socket *sc, */ sc->workqueue = workqueue; } + +__maybe_unused /* this is temporary while this file is included in others */ +static void smbdirect_socket_set_logging(struct smbdirect_socket *sc, + void *private_ptr, + bool (*needed)(struct smbdirect_socket *sc, + void *private_ptr, + unsigned int lvl, + unsigned int cls), + void (*vaprintf)(struct smbdirect_socket *sc, + const char *func, + unsigned int line, + void *private_ptr, + unsigned int lvl, + unsigned int cls, + struct va_format *vaf)) +{ + sc->logging.private_ptr = private_ptr; + sc->logging.needed = needed; + sc->logging.vaprintf = vaprintf; +}