kernel/tsacct.c | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/kernel/tsacct.c b/kernel/tsacct.c index 24dc60d9fa1f..197749dbe0f0 100644 --- a/kernel/tsacct.c +++ b/kernel/tsacct.c @@ -76,8 +76,10 @@ void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk) #ifdef CONFIG_TASK_XACCT +/* Expose things in kB granularity */ #define KB 1024 #define MB (1024*KB) +#define MASKED(x) (x & ~(KB-1)) /* * fill in extended accounting fields */ @@ -95,14 +97,14 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p) stats->hiwater_vm = get_mm_hiwater_vm(mm) * PAGE_SIZE / KB; mmput(mm); } - stats->read_char = p->ioac.rchar; - stats->write_char = p->ioac.wchar; - stats->read_syscalls = p->ioac.syscr; - stats->write_syscalls = p->ioac.syscw; + stats->read_char = MASKED(p->ioac.rchar); + stats->write_char = MASKED(p->ioac.wchar); + stats->read_syscalls = MASKED(p->ioac.syscr); + stats->write_syscalls = MASKED(p->ioac.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 = MASKED(p->ioac.read_bytes); + stats->write_bytes = MASKED(p->ioac.write_bytes); + stats->cancelled_write_bytes = MASKED(p->ioac.cancelled_write_bytes); #else stats->read_bytes = 0; stats->write_bytes = 0; @@ -111,6 +113,7 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p) } #undef KB #undef MB +#undef MASKED /** * acct_update_integrals - update mm integral fields in task_struct