[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20241213054918.56441-1-laoar.shao@gmail.com>
Date: Fri, 13 Dec 2024 13:49:18 +0800
From: Yafang Shao <laoar.shao@...il.com>
To: torvalds@...ux-foundation.org,
akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org,
linux-security-module@...r.kernel.org,
x86@...nel.org,
linux-snps-arc@...ts.infradead.org,
linux-wireless@...r.kernel.org,
intel-gfx@...ts.freedesktop.org,
intel-xe@...ts.freedesktop.org,
nouveau@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org,
ocfs2-devel@...ts.linux.dev,
Yafang Shao <laoar.shao@...il.com>,
Mark Fasheh <mark@...heh.com>,
Joel Becker <jlbec@...lplan.org>,
Joseph Qi <joseph.qi@...ux.alibaba.com>
Subject: [PATCH 7/7] fs: Use %pTN to print task name
Since task->comm is guaranteed to be NUL-terminated, we can print it
directly without the need to copy it into a separate buffer. This
simplifies the code and avoids unnecessary operations.
Signed-off-by: Yafang Shao <laoar.shao@...il.com>
Cc: Mark Fasheh <mark@...heh.com>
Cc: Joel Becker <jlbec@...lplan.org>
Cc: Joseph Qi <joseph.qi@...ux.alibaba.com>
---
fs/ocfs2/cluster/netdebug.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/ocfs2/cluster/netdebug.c b/fs/ocfs2/cluster/netdebug.c
index bc27301eab6d..039d99f951ea 100644
--- a/fs/ocfs2/cluster/netdebug.c
+++ b/fs/ocfs2/cluster/netdebug.c
@@ -122,11 +122,10 @@ static int nst_seq_show(struct seq_file *seq, void *v)
send = ktime_to_us(ktime_sub(now, nst->st_send_time));
status = ktime_to_us(ktime_sub(now, nst->st_status_time));
- /* get_task_comm isn't exported. oh well. */
seq_printf(seq, "%p:\n"
" pid: %lu\n"
" tgid: %lu\n"
- " process name: %s\n"
+ " process name: %pTN\n"
" node: %u\n"
" sc: %p\n"
" message id: %d\n"
@@ -137,7 +136,7 @@ static int nst_seq_show(struct seq_file *seq, void *v)
" wait start: %lld usecs ago\n",
nst, (unsigned long)task_pid_nr(nst->st_task),
(unsigned long)nst->st_task->tgid,
- nst->st_task->comm, nst->st_node,
+ nst->st_task, nst->st_node,
nst->st_sc, nst->st_id, nst->st_msg_type,
nst->st_msg_key,
(long long)sock,
--
2.43.5
Powered by blists - more mailing lists