Merge branch 'misc.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-2.6-microblaze.git] / fs / proc / array.c
index 7ec5917..49be8c8 100644 (file)
 
 void proc_task_name(struct seq_file *m, struct task_struct *p, bool escape)
 {
-       char *buf;
-       size_t size;
        char tcomm[64];
-       int ret;
 
        if (p->flags & PF_WQ_WORKER)
                wq_worker_comm(tcomm, sizeof(tcomm), p);
        else
                __get_task_comm(tcomm, sizeof(tcomm), p);
 
-       size = seq_get_buf(m, &buf);
-       if (escape) {
-               ret = string_escape_str(tcomm, buf, size,
-                                       ESCAPE_SPACE | ESCAPE_SPECIAL, "\n\\");
-               if (ret >= size)
-                       ret = -1;
-       } else {
-               ret = strscpy(buf, tcomm, size);
-       }
-
-       seq_commit(m, ret);
+       if (escape)
+               seq_escape_str(m, tcomm, ESCAPE_SPACE | ESCAPE_SPECIAL, "\n\\");
+       else
+               seq_printf(m, "%.64s", tcomm);
 }
 
 /*
@@ -284,7 +274,7 @@ static inline void task_sig(struct seq_file *m, struct task_struct *p)
                collect_sigign_sigcatch(p, &ignored, &caught);
                num_threads = get_nr_threads(p);
                rcu_read_lock();  /* FIXME: is this correct? */
-               qsize = atomic_read(&__task_cred(p)->user->sigpending);
+               qsize = get_ucounts_value(task_ucounts(p), UCOUNT_RLIMIT_SIGPENDING);
                rcu_read_unlock();
                qlim = task_rlimit(p, RLIMIT_SIGPENDING);
                unlock_task_sighand(p, &flags);