diff options
Diffstat (limited to 'kernel/acct.c')
-rw-r--r-- | kernel/acct.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/kernel/acct.c b/kernel/acct.c index 6312d6bd43e3..065d8b4e51ef 100644 --- a/kernel/acct.c +++ b/kernel/acct.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <linux/mm.h> | 47 | #include <linux/mm.h> |
48 | #include <linux/slab.h> | 48 | #include <linux/slab.h> |
49 | #include <linux/acct.h> | 49 | #include <linux/acct.h> |
50 | #include <linux/capability.h> | ||
50 | #include <linux/file.h> | 51 | #include <linux/file.h> |
51 | #include <linux/tty.h> | 52 | #include <linux/tty.h> |
52 | #include <linux/security.h> | 53 | #include <linux/security.h> |
@@ -427,6 +428,7 @@ static void do_acct_process(long exitcode, struct file *file) | |||
427 | u64 elapsed; | 428 | u64 elapsed; |
428 | u64 run_time; | 429 | u64 run_time; |
429 | struct timespec uptime; | 430 | struct timespec uptime; |
431 | unsigned long jiffies; | ||
430 | 432 | ||
431 | /* | 433 | /* |
432 | * First check to see if there is enough free_space to continue | 434 | * First check to see if there is enough free_space to continue |
@@ -467,12 +469,12 @@ static void do_acct_process(long exitcode, struct file *file) | |||
467 | #endif | 469 | #endif |
468 | do_div(elapsed, AHZ); | 470 | do_div(elapsed, AHZ); |
469 | ac.ac_btime = xtime.tv_sec - elapsed; | 471 | ac.ac_btime = xtime.tv_sec - elapsed; |
470 | ac.ac_utime = encode_comp_t(jiffies_to_AHZ( | 472 | jiffies = cputime_to_jiffies(cputime_add(current->group_leader->utime, |
471 | current->signal->utime + | 473 | current->signal->utime)); |
472 | current->group_leader->utime)); | 474 | ac.ac_utime = encode_comp_t(jiffies_to_AHZ(jiffies)); |
473 | ac.ac_stime = encode_comp_t(jiffies_to_AHZ( | 475 | jiffies = cputime_to_jiffies(cputime_add(current->group_leader->stime, |
474 | current->signal->stime + | 476 | current->signal->stime)); |
475 | current->group_leader->stime)); | 477 | ac.ac_stime = encode_comp_t(jiffies_to_AHZ(jiffies)); |
476 | /* we really need to bite the bullet and change layout */ | 478 | /* we really need to bite the bullet and change layout */ |
477 | ac.ac_uid = current->uid; | 479 | ac.ac_uid = current->uid; |
478 | ac.ac_gid = current->gid; | 480 | ac.ac_gid = current->gid; |
@@ -580,7 +582,8 @@ void acct_process(long exitcode) | |||
580 | void acct_update_integrals(struct task_struct *tsk) | 582 | void acct_update_integrals(struct task_struct *tsk) |
581 | { | 583 | { |
582 | if (likely(tsk->mm)) { | 584 | if (likely(tsk->mm)) { |
583 | long delta = tsk->stime - tsk->acct_stimexpd; | 585 | long delta = |
586 | cputime_to_jiffies(tsk->stime) - tsk->acct_stimexpd; | ||
584 | 587 | ||
585 | if (delta == 0) | 588 | if (delta == 0) |
586 | return; | 589 | return; |