diff options
author | Andrea Righi <righi.andrea@gmail.com> | 2008-07-27 18:48:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-27 19:12:28 -0400 |
commit | 940389b8afad6495211614c13eb91ef7001773ec (patch) | |
tree | 92c581cc9dc7a067899a6a28e382e4099dfe8ead /include/linux/task_io_accounting_ops.h | |
parent | 837b41b5de356aa67abb2cadb5eef3efc7776f91 (diff) |
task IO accounting: move all IO statistics in struct task_io_accounting
Simplify the code of include/linux/task_io_accounting.h.
It is also more reasonable to have all the task i/o-related statistics in a
single struct (task_io_accounting).
Signed-off-by: Andrea Righi <righi.andrea@gmail.com>
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/task_io_accounting_ops.h')
-rw-r--r-- | include/linux/task_io_accounting_ops.h | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/include/linux/task_io_accounting_ops.h b/include/linux/task_io_accounting_ops.h index e6f958ebe97f..4d090f9ee608 100644 --- a/include/linux/task_io_accounting_ops.h +++ b/include/linux/task_io_accounting_ops.h | |||
@@ -9,7 +9,7 @@ | |||
9 | #ifdef CONFIG_TASK_IO_ACCOUNTING | 9 | #ifdef CONFIG_TASK_IO_ACCOUNTING |
10 | static inline void task_io_account_read(size_t bytes) | 10 | static inline void task_io_account_read(size_t bytes) |
11 | { | 11 | { |
12 | current->ioac.blk.read_bytes += bytes; | 12 | current->ioac.read_bytes += bytes; |
13 | } | 13 | } |
14 | 14 | ||
15 | /* | 15 | /* |
@@ -18,12 +18,12 @@ static inline void task_io_account_read(size_t bytes) | |||
18 | */ | 18 | */ |
19 | static inline unsigned long task_io_get_inblock(const struct task_struct *p) | 19 | static inline unsigned long task_io_get_inblock(const struct task_struct *p) |
20 | { | 20 | { |
21 | return p->ioac.blk.read_bytes >> 9; | 21 | return p->ioac.read_bytes >> 9; |
22 | } | 22 | } |
23 | 23 | ||
24 | static inline void task_io_account_write(size_t bytes) | 24 | static inline void task_io_account_write(size_t bytes) |
25 | { | 25 | { |
26 | current->ioac.blk.write_bytes += bytes; | 26 | current->ioac.write_bytes += bytes; |
27 | } | 27 | } |
28 | 28 | ||
29 | /* | 29 | /* |
@@ -32,25 +32,25 @@ static inline void task_io_account_write(size_t bytes) | |||
32 | */ | 32 | */ |
33 | static inline unsigned long task_io_get_oublock(const struct task_struct *p) | 33 | static inline unsigned long task_io_get_oublock(const struct task_struct *p) |
34 | { | 34 | { |
35 | return p->ioac.blk.write_bytes >> 9; | 35 | return p->ioac.write_bytes >> 9; |
36 | } | 36 | } |
37 | 37 | ||
38 | static inline void task_io_account_cancelled_write(size_t bytes) | 38 | static inline void task_io_account_cancelled_write(size_t bytes) |
39 | { | 39 | { |
40 | current->ioac.blk.cancelled_write_bytes += bytes; | 40 | current->ioac.cancelled_write_bytes += bytes; |
41 | } | 41 | } |
42 | 42 | ||
43 | static inline void task_io_accounting_init(struct proc_io_accounting *ioac) | 43 | static inline void task_io_accounting_init(struct task_io_accounting *ioac) |
44 | { | 44 | { |
45 | memset(ioac, 0, sizeof(*ioac)); | 45 | memset(ioac, 0, sizeof(*ioac)); |
46 | } | 46 | } |
47 | 47 | ||
48 | static inline void task_blk_io_accounting_add(struct proc_io_accounting *dst, | 48 | static inline void task_blk_io_accounting_add(struct task_io_accounting *dst, |
49 | struct proc_io_accounting *src) | 49 | struct task_io_accounting *src) |
50 | { | 50 | { |
51 | dst->blk.read_bytes += src->blk.read_bytes; | 51 | dst->read_bytes += src->read_bytes; |
52 | dst->blk.write_bytes += src->blk.write_bytes; | 52 | dst->write_bytes += src->write_bytes; |
53 | dst->blk.cancelled_write_bytes += src->blk.cancelled_write_bytes; | 53 | dst->cancelled_write_bytes += src->cancelled_write_bytes; |
54 | } | 54 | } |
55 | 55 | ||
56 | #else | 56 | #else |
@@ -77,35 +77,35 @@ static inline void task_io_account_cancelled_write(size_t bytes) | |||
77 | { | 77 | { |
78 | } | 78 | } |
79 | 79 | ||
80 | static inline void task_io_accounting_init(struct proc_io_accounting *ioac) | 80 | static inline void task_io_accounting_init(struct task_io_accounting *ioac) |
81 | { | 81 | { |
82 | } | 82 | } |
83 | 83 | ||
84 | static inline void task_blk_io_accounting_add(struct proc_io_accounting *dst, | 84 | static inline void task_blk_io_accounting_add(struct task_io_accounting *dst, |
85 | struct proc_io_accounting *src) | 85 | struct task_io_accounting *src) |
86 | { | 86 | { |
87 | } | 87 | } |
88 | 88 | ||
89 | #endif /* CONFIG_TASK_IO_ACCOUNTING */ | 89 | #endif /* CONFIG_TASK_IO_ACCOUNTING */ |
90 | 90 | ||
91 | #ifdef CONFIG_TASK_XACCT | 91 | #ifdef CONFIG_TASK_XACCT |
92 | static inline void task_chr_io_accounting_add(struct proc_io_accounting *dst, | 92 | static inline void task_chr_io_accounting_add(struct task_io_accounting *dst, |
93 | struct proc_io_accounting *src) | 93 | struct task_io_accounting *src) |
94 | { | 94 | { |
95 | dst->chr.rchar += src->chr.rchar; | 95 | dst->rchar += src->rchar; |
96 | dst->chr.wchar += src->chr.wchar; | 96 | dst->wchar += src->wchar; |
97 | dst->chr.syscr += src->chr.syscr; | 97 | dst->syscr += src->syscr; |
98 | dst->chr.syscw += src->chr.syscw; | 98 | dst->syscw += src->syscw; |
99 | } | 99 | } |
100 | #else | 100 | #else |
101 | static inline void task_chr_io_accounting_add(struct proc_io_accounting *dst, | 101 | static inline void task_chr_io_accounting_add(struct task_io_accounting *dst, |
102 | struct proc_io_accounting *src) | 102 | struct task_io_accounting *src) |
103 | { | 103 | { |
104 | } | 104 | } |
105 | #endif /* CONFIG_TASK_XACCT */ | 105 | #endif /* CONFIG_TASK_XACCT */ |
106 | 106 | ||
107 | static inline void task_io_accounting_add(struct proc_io_accounting *dst, | 107 | static inline void task_io_accounting_add(struct task_io_accounting *dst, |
108 | struct proc_io_accounting *src) | 108 | struct task_io_accounting *src) |
109 | { | 109 | { |
110 | task_chr_io_accounting_add(dst, src); | 110 | task_chr_io_accounting_add(dst, src); |
111 | task_blk_io_accounting_add(dst, src); | 111 | task_blk_io_accounting_add(dst, src); |