diff options
| author | Grant Likely <grant.likely@secretlab.ca> | 2011-10-05 10:52:27 -0600 |
|---|---|---|
| committer | Grant Likely <grant.likely@secretlab.ca> | 2011-10-05 10:52:27 -0600 |
| commit | 9514a56753a8d379db36bed424588e1842f2bfcc (patch) | |
| tree | d13cdfcd9473f521c3b108770dba57e81e557a30 /kernel/tsacct.c | |
| parent | 4cd7f7a31178ff8a15ad2bc1258b9b2bf2cf51a4 (diff) | |
| parent | 6add6967a4a57e2156b96e62f28bcbe1901d16c1 (diff) | |
Merge branch 'for-grant' of git://git.jdl.com/software/linux-3.0 into devicetree/next
Diffstat (limited to 'kernel/tsacct.c')
| -rw-r--r-- | kernel/tsacct.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/kernel/tsacct.c b/kernel/tsacct.c index 24dc60d9fa1..5bbfac85866 100644 --- a/kernel/tsacct.c +++ b/kernel/tsacct.c @@ -78,6 +78,7 @@ void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk) #define KB 1024 #define MB (1024*KB) +#define KB_MASK (~(KB-1)) /* * fill in extended accounting fields */ @@ -95,14 +96,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 = p->ioac.rchar & KB_MASK; + stats->write_char = p->ioac.wchar & KB_MASK; + stats->read_syscalls = p->ioac.syscr & KB_MASK; + stats->write_syscalls = p->ioac.syscw & KB_MASK; #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.read_bytes & KB_MASK; + stats->write_bytes = p->ioac.write_bytes & KB_MASK; + stats->cancelled_write_bytes = p->ioac.cancelled_write_bytes & KB_MASK; #else stats->read_bytes = 0; stats->write_bytes = 0; |
