]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/tsacct.c
stop_machine: Wean existing callers off stop_machine_run()
[linux-2.6-omap-h63xx.git] / kernel / tsacct.c
index 1da6990af8e066d4be1d7d0f8b73d5a739f8dbb0..f9cd2561689c66b0ed30e71d86fd0e3c61666e2c 100644 (file)
 void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk)
 {
        struct timespec uptime, ts;
-       s64 ac_etime;
+       u64 ac_etime;
 
        BUILD_BUG_ON(TS_COMM_LEN < TASK_COMM_LEN);
 
        /* calculate task elapsed time in timespec */
        do_posix_clock_monotonic_gettime(&uptime);
        ts = timespec_sub(uptime, tsk->start_time);
-       /* rebase elapsed time to usec */
+       /* rebase elapsed time to usec (should never be negative) */
        ac_etime = timespec_to_ns(&ts);
        do_div(ac_etime, NSEC_PER_USEC);
        stats->ac_etime = ac_etime;
@@ -94,14 +94,14 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p)
                stats->hiwater_vm    = mm->hiwater_vm * PAGE_SIZE / KB;
                mmput(mm);
        }
-       stats->read_char        = p->rchar;
-       stats->write_char       = p->wchar;
-       stats->read_syscalls    = p->syscr;
-       stats->write_syscalls   = p->syscw;
+       stats->read_char        = p->ioac.chr.rchar;
+       stats->write_char       = p->ioac.chr.wchar;
+       stats->read_syscalls    = p->ioac.chr.syscr;
+       stats->write_syscalls   = p->ioac.chr.syscw;
 #ifdef CONFIG_TASK_IO_ACCOUNTING
-       stats->read_bytes       = p->ioac.read_bytes;
-       stats->write_bytes      = p->ioac.write_bytes;
-       stats->cancelled_write_bytes = p->ioac.cancelled_write_bytes;
+       stats->read_bytes       = p->ioac.blk.read_bytes;
+       stats->write_bytes      = p->ioac.blk.write_bytes;
+       stats->cancelled_write_bytes = p->ioac.blk.cancelled_write_bytes;
 #else
        stats->read_bytes       = 0;
        stats->write_bytes      = 0;