kthread: dynamically allocate memory to store kthread's full name
[linux-2.6-microblaze.git] / fs / proc / array.c
index ff869a6..4321aa6 100644 (file)
@@ -92,6 +92,7 @@
 #include <linux/string_helpers.h>
 #include <linux/user_namespace.h>
 #include <linux/fs_struct.h>
+#include <linux/kthread.h>
 
 #include <asm/processor.h>
 #include "internal.h"
@@ -102,6 +103,8 @@ void proc_task_name(struct seq_file *m, struct task_struct *p, bool escape)
 
        if (p->flags & PF_WQ_WORKER)
                wq_worker_comm(tcomm, sizeof(tcomm), p);
+       else if (p->flags & PF_KTHREAD)
+               get_kthread_comm(tcomm, sizeof(tcomm), p);
        else
                __get_task_comm(tcomm, sizeof(tcomm), p);