]> Pileus Git - ~andy/linux/blobdiff - kernel/tsacct.c
Merge tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[~andy/linux] / kernel / tsacct.c
index 23b4d784ebdd3e448ade6cb425e6ab3ba4e865fb..625df0b44690a67a1ca6d5f6e7f264fc1ac28fb5 100644 (file)
@@ -26,7 +26,9 @@
 /*
  * fill in basic accounting fields
  */
-void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk)
+void bacct_add_tsk(struct user_namespace *user_ns,
+                  struct pid_namespace *pid_ns,
+                  struct taskstats *stats, struct task_struct *tsk)
 {
        const struct cred *tcred;
        struct timespec uptime, ts;
@@ -55,13 +57,13 @@ void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk)
                stats->ac_flag |= AXSIG;
        stats->ac_nice   = task_nice(tsk);
        stats->ac_sched  = tsk->policy;
-       stats->ac_pid    = tsk->pid;
+       stats->ac_pid    = task_pid_nr_ns(tsk, pid_ns);
        rcu_read_lock();
        tcred = __task_cred(tsk);
-       stats->ac_uid    = tcred->uid;
-       stats->ac_gid    = tcred->gid;
+       stats->ac_uid    = from_kuid_munged(user_ns, tcred->uid);
+       stats->ac_gid    = from_kgid_munged(user_ns, tcred->gid);
        stats->ac_ppid   = pid_alive(tsk) ?
-                               rcu_dereference(tsk->real_parent)->tgid : 0;
+               task_tgid_nr_ns(rcu_dereference(tsk->real_parent), pid_ns) : 0;
        rcu_read_unlock();
        stats->ac_utime = cputime_to_usecs(tsk->utime);
        stats->ac_stime = cputime_to_usecs(tsk->stime);