]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cifs: SMB1 split: cifs_debug.c
authorDavid Howells <dhowells@redhat.com>
Wed, 17 Dec 2025 12:53:23 +0000 (12:53 +0000)
committerSteve French <stfrench@microsoft.com>
Sun, 8 Feb 2026 23:07:45 +0000 (17:07 -0600)
Split SMB1 bits from cifs_debug.c to smb1debug.c.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Enzo Matsumiya <ematsumiya@suse.de>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-kernel@vger.kernel.org
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/Makefile
fs/smb/client/cifs_debug.c
fs/smb/client/cifs_debug.h
fs/smb/client/smb1debug.c [new file with mode: 0644]
fs/smb/client/smb1proto.h
fs/smb/common/smb2pdu.h

index 9754b4776df8459b9ad0761a5e57e2859b6c7b91..c51f67a5caaa150a43d9357400452231a240c84d 100644 (file)
@@ -34,6 +34,7 @@ cifs-$(CONFIG_CIFS_ROOT) += cifsroot.o
 
 cifs-$(CONFIG_CIFS_ALLOW_INSECURE_LEGACY) += \
        cifssmb.o \
+       smb1debug.o \
        smb1ops.o \
        smb1transport.o
 
index ed23a0db1456828a820d325a9fe0bedf45534ca5..217444e3e6d0181f44565bfb98db8b1d7a072438 100644 (file)
@@ -36,21 +36,6 @@ cifs_dump_mem(char *label, void *data, int length)
                       data, length, true);
 }
 
-void cifs_dump_detail(void *buf, size_t buf_len, struct TCP_Server_Info *server)
-{
-#ifdef CONFIG_CIFS_DEBUG2
-       struct smb_hdr *smb = buf;
-
-       cifs_dbg(VFS, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d Wct: %d\n",
-                smb->Command, smb->Status.CifsError, smb->Flags,
-                smb->Flags2, smb->Mid, smb->Pid, smb->WordCount);
-       if (!server->ops->check_message(buf, buf_len, server->total_read, server)) {
-               cifs_dbg(VFS, "smb buf %p len %u\n", smb,
-                        server->ops->calc_smb_size(smb));
-       }
-#endif /* CONFIG_CIFS_DEBUG2 */
-}
-
 void cifs_dump_mids(struct TCP_Server_Info *server)
 {
 #ifdef CONFIG_CIFS_DEBUG2
index 35bd5c8e1d71f2a46ede7a90b431bd53509e559d..00650929a133985352337636df5766baa6fc5a8c 100644 (file)
@@ -15,8 +15,6 @@
 #define pr_fmt(fmt) "CIFS: " fmt
 
 void cifs_dump_mem(char *label, void *data, int length);
-void cifs_dump_detail(void *buf, size_t buf_len,
-                     struct TCP_Server_Info *server);
 void cifs_dump_mids(struct TCP_Server_Info *server);
 extern bool traceSMB;          /* flag which enables the function below */
 void dump_smb(void *buf, int smb_buf_length);
diff --git a/fs/smb/client/smb1debug.c b/fs/smb/client/smb1debug.c
new file mode 100644 (file)
index 0000000..e2d013e
--- /dev/null
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ *
+ *   Copyright (C) International Business Machines  Corp., 2000,2005
+ *
+ *   Modified by Steve French (sfrench@us.ibm.com)
+ */
+#include "cifsproto.h"
+#include "smb1proto.h"
+#include "cifs_debug.h"
+
+void cifs_dump_detail(void *buf, size_t buf_len, struct TCP_Server_Info *server)
+{
+#ifdef CONFIG_CIFS_DEBUG2
+       struct smb_hdr *smb = buf;
+
+       cifs_dbg(VFS, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d Wct: %d\n",
+                smb->Command, smb->Status.CifsError, smb->Flags,
+                smb->Flags2, smb->Mid, smb->Pid, smb->WordCount);
+       if (!server->ops->check_message(buf, buf_len, server->total_read, server)) {
+               cifs_dbg(VFS, "smb buf %p len %u\n", smb,
+                        server->ops->calc_smb_size(smb));
+       }
+#endif /* CONFIG_CIFS_DEBUG2 */
+}
index d683ffafd7067a0668d48ffc4e8c32e82e66233f..24aefcbf96af49d2e38ba5fe636d0b8d1d242825 100644 (file)
@@ -8,8 +8,10 @@
 #ifndef _SMB1PROTO_H
 #define _SMB1PROTO_H
 
+#include <linux/uidgid_types.h>
 #include <linux/unaligned.h>
 #include "../common/smb2pdu.h"
+#include "cifsglob.h"
 
 struct cifs_unix_set_info_args {
        __u64   ctime;
@@ -211,6 +213,12 @@ int CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon,
                 const struct nls_table *nls_codepage,
                 struct cifs_sb_info *cifs_sb);
 
+/*
+ * smb1debug.c
+ */
+void cifs_dump_detail(void *buf, size_t buf_len,
+                     struct TCP_Server_Info *server);
+
 /*
  * smb1ops.c
  */
index f5ebbe31384aea9fb9f533a778adf39c5d49a749..e482c86ceb00d25bae68f3dbd2d8a564c9b271b7 100644 (file)
@@ -2,6 +2,9 @@
 #ifndef _COMMON_SMB2PDU_H
 #define _COMMON_SMB2PDU_H
 
+#include <linux/types.h>
+#include <linux/build_bug.h>
+
 /*
  * Note that, due to trying to use names similar to the protocol specifications,
  * there are many mixed case field names in the structures below.  Although