summaryrefslogtreecommitdiff
path: root/include/linux/task_io_accounting_ops.h
diff options
context:
space:
mode:
authorAndrea Righi <righi.andrea@gmail.com>2008-07-28 02:48:12 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-28 03:12:28 +0400
commit940389b8afad6495211614c13eb91ef7001773ec (patch)
tree92c581cc9dc7a067899a6a28e382e4099dfe8ead /include/linux/task_io_accounting_ops.h
parent837b41b5de356aa67abb2cadb5eef3efc7776f91 (diff)
downloadlinux-940389b8afad6495211614c13eb91ef7001773ec.tar.xz
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.h48
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 @@
#ifdef CONFIG_TASK_IO_ACCOUNTING
static inline void task_io_account_read(size_t bytes)
{
- current->ioac.blk.read_bytes += bytes;
+ current->ioac.read_bytes += bytes;
}
/*
@@ -18,12 +18,12 @@ static inline void task_io_account_read(size_t bytes)
*/
static inline unsigned long task_io_get_inblock(const struct task_struct *p)
{
- return p->ioac.blk.read_bytes >> 9;
+ return p->ioac.read_bytes >> 9;
}
static inline void task_io_account_write(size_t bytes)
{
- current->ioac.blk.write_bytes += bytes;
+ current->ioac.write_bytes += bytes;
}
/*
@@ -32,25 +32,25 @@ static inline void task_io_account_write(size_t bytes)
*/
static inline unsigned long task_io_get_oublock(const struct task_struct *p)
{
- return p->ioac.blk.write_bytes >> 9;
+ return p->ioac.write_bytes >> 9;
}
static inline void task_io_account_cancelled_write(size_t bytes)
{
- current->ioac.blk.cancelled_write_bytes += bytes;
+ current->ioac.cancelled_write_bytes += bytes;
}
-static inline void task_io_accounting_init(struct proc_io_accounting *ioac)
+static inline void task_io_accounting_init(struct task_io_accounting *ioac)
{
memset(ioac, 0, sizeof(*ioac));
}
-static inline void task_blk_io_accounting_add(struct proc_io_accounting *dst,
- struct proc_io_accounting *src)
+static inline void task_blk_io_accounting_add(struct task_io_accounting *dst,
+ struct task_io_accounting *src)
{
- dst->blk.read_bytes += src->blk.read_bytes;
- dst->blk.write_bytes += src->blk.write_bytes;
- dst->blk.cancelled_write_bytes += src->blk.cancelled_write_bytes;
+ dst->read_bytes += src->read_bytes;
+ dst->write_bytes += src->write_bytes;
+ dst->cancelled_write_bytes += src->cancelled_write_bytes;
}
#else
@@ -77,35 +77,35 @@ static inline void task_io_account_cancelled_write(size_t bytes)
{
}
-static inline void task_io_accounting_init(struct proc_io_accounting *ioac)
+static inline void task_io_accounting_init(struct task_io_accounting *ioac)
{
}
-static inline void task_blk_io_accounting_add(struct proc_io_accounting *dst,
- struct proc_io_accounting *src)
+static inline void task_blk_io_accounting_add(struct task_io_accounting *dst,
+ struct task_io_accounting *src)
{
}
#endif /* CONFIG_TASK_IO_ACCOUNTING */
#ifdef CONFIG_TASK_XACCT
-static inline void task_chr_io_accounting_add(struct proc_io_accounting *dst,
- struct proc_io_accounting *src)
+static inline void task_chr_io_accounting_add(struct task_io_accounting *dst,
+ struct task_io_accounting *src)
{
- dst->chr.rchar += src->chr.rchar;
- dst->chr.wchar += src->chr.wchar;
- dst->chr.syscr += src->chr.syscr;
- dst->chr.syscw += src->chr.syscw;
+ dst->rchar += src->rchar;
+ dst->wchar += src->wchar;
+ dst->syscr += src->syscr;
+ dst->syscw += src->syscw;
}
#else
-static inline void task_chr_io_accounting_add(struct proc_io_accounting *dst,
- struct proc_io_accounting *src)
+static inline void task_chr_io_accounting_add(struct task_io_accounting *dst,
+ struct task_io_accounting *src)
{
}
#endif /* CONFIG_TASK_XACCT */
-static inline void task_io_accounting_add(struct proc_io_accounting *dst,
- struct proc_io_accounting *src)
+static inline void task_io_accounting_add(struct task_io_accounting *dst,
+ struct task_io_accounting *src)
{
task_chr_io_accounting_add(dst, src);
task_blk_io_accounting_add(dst, src);