[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251222223006.1075635-32-dhowells@redhat.com>
Date: Mon, 22 Dec 2025 22:29:56 +0000
From: David Howells <dhowells@...hat.com>
To: Steve French <sfrench@...ba.org>
Cc: David Howells <dhowells@...hat.com>,
Paulo Alcantara <pc@...guebit.org>,
Enzo Matsumiya <ematsumiya@...e.de>,
linux-cifs@...r.kernel.org,
linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 31/37] cifs: SMB1 split: cifs_debug.c
Split SMB1 bits from cifs_debug.c to smb1debug.c.
Signed-off-by: David Howells <dhowells@...hat.com>
cc: Steve French <sfrench@...ba.org>
cc: Paulo Alcantara <pc@...guebit.org>
cc: Enzo Matsumiya <ematsumiya@...e.de>
cc: linux-cifs@...r.kernel.org
cc: linux-fsdevel@...r.kernel.org
cc: linux-kernel@...r.kernel.org
---
fs/smb/client/Makefile | 1 +
fs/smb/client/cifs_debug.c | 15 ---------------
fs/smb/client/cifs_debug.h | 2 --
fs/smb/client/smb1debug.c | 25 +++++++++++++++++++++++++
fs/smb/client/smb1proto.h | 8 ++++++++
fs/smb/common/smb2pdu.h | 3 +++
6 files changed, 37 insertions(+), 17 deletions(-)
create mode 100644 fs/smb/client/smb1debug.c
diff --git a/fs/smb/client/Makefile b/fs/smb/client/Makefile
index 9754b4776df8..c51f67a5caaa 100644
--- a/fs/smb/client/Makefile
+++ b/fs/smb/client/Makefile
@@ -34,6 +34,7 @@ cifs-$(CONFIG_CIFS_ROOT) += cifsroot.o
cifs-$(CONFIG_CIFS_ALLOW_INSECURE_LEGACY) += \
cifssmb.o \
+ smb1debug.o \
smb1ops.o \
smb1transport.o
diff --git a/fs/smb/client/cifs_debug.c b/fs/smb/client/cifs_debug.c
index b21444777872..b5917329fd48 100644
--- a/fs/smb/client/cifs_debug.c
+++ b/fs/smb/client/cifs_debug.c
@@ -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
diff --git a/fs/smb/client/cifs_debug.h b/fs/smb/client/cifs_debug.h
index 35bd5c8e1d71..00650929a133 100644
--- a/fs/smb/client/cifs_debug.h
+++ b/fs/smb/client/cifs_debug.h
@@ -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
index 000000000000..e2d013e751e5
--- /dev/null
+++ b/fs/smb/client/smb1debug.c
@@ -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@...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 */
+}
diff --git a/fs/smb/client/smb1proto.h b/fs/smb/client/smb1proto.h
index abbc3db11743..de021e17dc4b 100644
--- a/fs/smb/client/smb1proto.h
+++ b/fs/smb/client/smb1proto.h
@@ -8,10 +8,12 @@
#ifndef _SMB1PROTO_H
#define _SMB1PROTO_H
+#include <linux/uidgid_types.h>
#include "../common/smb2pdu.h"
#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
+#include "cifsglob.h"
#include <linux/unaligned.h>
struct cifs_unix_set_info_args {
@@ -212,6 +214,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
*/
diff --git a/fs/smb/common/smb2pdu.h b/fs/smb/common/smb2pdu.h
index f5ebbe31384a..e482c86ceb00 100644
--- a/fs/smb/common/smb2pdu.h
+++ b/fs/smb/common/smb2pdu.h
@@ -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
Powered by blists - more mailing lists