All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Aptel <aaptel-IBi9RG/b67k@public.gmane.org>
To: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Aurelien Aptel <aaptel-IBi9RG/b67k@public.gmane.org>
Subject: [PATCH v3 3/3] CIFS: dump IPC tcon in debug proc file
Date: Wed, 24 Jan 2018 13:46:12 +0100	[thread overview]
Message-ID: <20180124124612.21993-4-aaptel@suse.com> (raw)
In-Reply-To: <20180124124612.21993-1-aaptel-IBi9RG/b67k@public.gmane.org>

dump it as first share with an "IPC: " prefix.

Signed-off-by: Aurelien Aptel <aaptel-IBi9RG/b67k@public.gmane.org>
---
 fs/cifs/cifs_debug.c | 61 ++++++++++++++++++++++++++++++----------------------
 1 file changed, 35 insertions(+), 26 deletions(-)

diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index 05be9b47eb0c..f491340f32ad 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -110,6 +110,32 @@ void cifs_dump_mids(struct TCP_Server_Info *server)
 }
 
 #ifdef CONFIG_PROC_FS
+static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon)
+{
+	__u32 dev_type = le32_to_cpu(tcon->fsDevInfo.DeviceType);
+
+	seq_printf(m, "%s Mounts: %d ", tcon->treeName, tcon->tc_count);
+	if (tcon->nativeFileSystem)
+		seq_printf(m, "Type: %s ", tcon->nativeFileSystem);
+	seq_printf(m, "DevInfo: 0x%x Attributes: 0x%x\n\tPathComponentMax: %d Status: %d",
+		   le32_to_cpu(tcon->fsDevInfo.DeviceCharacteristics),
+		   le32_to_cpu(tcon->fsAttrInfo.Attributes),
+		   le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength),
+		   tcon->tidStatus);
+	if (dev_type == FILE_DEVICE_DISK)
+		seq_puts(m, " type: DISK ");
+	else if (dev_type == FILE_DEVICE_CD_ROM)
+		seq_puts(m, " type: CDROM ");
+	else
+		seq_printf(m, " type: %d ", dev_type);
+	if (tcon->ses->server->ops->dump_share_caps)
+		tcon->ses->server->ops->dump_share_caps(m, tcon);
+
+	if (tcon->need_reconnect)
+		seq_puts(m, "\tDISCONNECTED ");
+	seq_putc(m, '\n');
+}
+
 static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
 {
 	struct list_head *tmp1, *tmp2, *tmp3;
@@ -118,7 +144,6 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
 	struct cifs_ses *ses;
 	struct cifs_tcon *tcon;
 	int i, j;
-	__u32 dev_type;
 
 	seq_puts(m,
 		    "Display Internal CIFS Data Structures for Debugging\n"
@@ -260,35 +285,19 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
 
 			seq_puts(m, "\n\tShares:");
 			j = 0;
+
+			seq_printf(m, "\n\t%d) IPC: ", j);
+			if (ses->tcon_ipc)
+				cifs_debug_tcon(m, ses->tcon_ipc);
+			else
+				seq_puts(m, "none\n");
+
 			list_for_each(tmp3, &ses->tcon_list) {
 				tcon = list_entry(tmp3, struct cifs_tcon,
 						  tcon_list);
 				++j;
-				dev_type = le32_to_cpu(tcon->fsDevInfo.DeviceType);
-				seq_printf(m, "\n\t%d) %s Mounts: %d ", j,
-					   tcon->treeName, tcon->tc_count);
-				if (tcon->nativeFileSystem) {
-					seq_printf(m, "Type: %s ",
-						   tcon->nativeFileSystem);
-				}
-				seq_printf(m, "DevInfo: 0x%x Attributes: 0x%x"
-					"\n\tPathComponentMax: %d Status: %d",
-					le32_to_cpu(tcon->fsDevInfo.DeviceCharacteristics),
-					le32_to_cpu(tcon->fsAttrInfo.Attributes),
-					le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength),
-					tcon->tidStatus);
-				if (dev_type == FILE_DEVICE_DISK)
-					seq_puts(m, " type: DISK ");
-				else if (dev_type == FILE_DEVICE_CD_ROM)
-					seq_puts(m, " type: CDROM ");
-				else
-					seq_printf(m, " type: %d ", dev_type);
-				if (server->ops->dump_share_caps)
-					server->ops->dump_share_caps(m, tcon);
-
-				if (tcon->need_reconnect)
-					seq_puts(m, "\tDISCONNECTED ");
-				seq_putc(m, '\n');
+				seq_printf(m, "\n\t%d) ", j);
+				cifs_debug_tcon(m, tcon);
 			}
 
 			seq_puts(m, "\n\tMIDs:\n");
-- 
2.12.3

  parent reply	other threads:[~2018-01-24 12:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17 17:21 [PATCH v1 0/3] Make IPC a regular tcon and fix SMB2 domain-based DFS Aurelien Aptel
     [not found] ` <20180117172200.3221-1-aaptel-IBi9RG/b67k@public.gmane.org>
2018-01-17 17:21   ` [PATCH v1 1/3] CIFS: set SERVER_NAME_LENGTH to serverName actual size Aurelien Aptel
2018-01-17 17:21   ` [PATCH v1 2/3] CIFS: make IPC a regular tcon Aurelien Aptel
     [not found]     ` <20180117172200.3221-3-aaptel-IBi9RG/b67k@public.gmane.org>
2018-01-18  0:27       ` Pavel Shilovskiy
     [not found]         ` <DM5PR2101MB0936C7D8EE43D6E069870B10B6E80-uvswG4RmAWieOSyIubIsYpz2gl+EIwcenBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2018-01-18 10:30           ` Aurélien Aptel
     [not found]             ` <87607z4fyr.fsf-IBi9RG/b67k@public.gmane.org>
2018-01-18 20:24               ` Pavel Shilovsky
     [not found]                 ` <CAKywueRdq2N=xaGuWrXiSMQkQ-TxcwTB7MirehtGbm7JexwMcQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-19 12:33                   ` Aurélien Aptel
2018-01-17 17:22   ` [PATCH v1 3/3] CIFS: use tcon_ipc instead of use_ipc parameter from SMB2_ioctl Aurelien Aptel
2018-01-17 23:08   ` [PATCH v1 0/3] Make IPC a regular tcon and fix SMB2 domain-based DFS Ronnie Sahlberg
2018-01-19 17:12   ` [PATCH v2 0/2] " Aurelien Aptel
     [not found]     ` <20180119171258.14244-1-aaptel-IBi9RG/b67k@public.gmane.org>
2018-01-19 17:12       ` [PATCH v2 1/2] CIFS: make IPC a regular tcon Aurelien Aptel
2018-01-19 17:12       ` [PATCH v2 2/2] CIFS: use tcon_ipc instead of use_ipc parameter of SMB2_ioctl Aurelien Aptel
     [not found]         ` <20180119171258.14244-3-aaptel-IBi9RG/b67k@public.gmane.org>
2018-01-20  0:36           ` Pavel Shilovsky
     [not found]             ` <CAKywueRY1G5GQznKtSiOuU8dtE6248h5+OfK7gC3154VwjSeaQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-22 16:27               ` Aurélien Aptel
2018-01-24 12:46   ` [PATCH v3 0/3] Make IPC a regular tcon and fix SMB2 domain-based DFS Aurelien Aptel
     [not found]     ` <20180124124612.21993-1-aaptel-IBi9RG/b67k@public.gmane.org>
2018-01-24 12:46       ` [PATCH v3 1/3] CIFS: make IPC a regular tcon Aurelien Aptel
     [not found]         ` <20180124124612.21993-2-aaptel-IBi9RG/b67k@public.gmane.org>
2018-01-26 22:57           ` Pavel Shilovskiy
2018-01-24 12:46       ` [PATCH v3 2/3] CIFS: use tcon_ipc instead of use_ipc parameter of SMB2_ioctl Aurelien Aptel
     [not found]         ` <20180124124612.21993-3-aaptel-IBi9RG/b67k@public.gmane.org>
2018-01-26 22:59           ` Pavel Shilovskiy
2018-01-24 12:46       ` Aurelien Aptel [this message]
     [not found]         ` <20180124124612.21993-4-aaptel-IBi9RG/b67k@public.gmane.org>
2018-01-26 23:00           ` [PATCH v3 3/3] CIFS: dump IPC tcon in debug proc file Pavel Shilovskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180124124612.21993-4-aaptel@suse.com \
    --to=aaptel-ibi9rg/b67k@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.