summaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2018-05-18 17:47:13 +0200
committerTejun Heo <tj@kernel.org>2018-05-18 17:47:13 +0200
commit88b72b31e15f9dfed069ede5416bb71040e0d299 (patch)
tree0965c46c2b8daeed787781fd0ee62b6333ec513f /fs/proc/base.c
parentworkqueue: Set worker->desc to workqueue name by default (diff)
downloadlinux-88b72b31e15f9dfed069ede5416bb71040e0d299.tar.xz
linux-88b72b31e15f9dfed069ede5416bb71040e0d299.zip
proc: Consolidate task->comm formatting into proc_task_name()
proc shows task->comm in three places - comm, stat, status - and each is fetching and formatting task->comm slighly differently. This patch renames task_name() to proc_task_name(), makes it more generic, and updates all three paths to use it. This will enable expanding comm reporting for workqueue workers. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r--fs/proc/base.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 1b2ede6abcdf..bb192a699bce 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1565,9 +1565,8 @@ static int comm_show(struct seq_file *m, void *v)
if (!p)
return -ESRCH;
- task_lock(p);
- seq_printf(m, "%s\n", p->comm);
- task_unlock(p);
+ proc_task_name(m, p, false);
+ seq_putc(m, '\n');
put_task_struct(p);