sched/headers: Move CONFIG_TASK_XACCT bits from <linux/sched.h> to <linux/sched/xacct.h>
The CONFIG_TASK_XACCT=y accounting inline functions are only used by fs/read_write.c, so move them into their separate header. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -2104,44 +2104,6 @@ extern struct task_group root_task_group;
|
|||||||
extern int task_can_switch_user(struct user_struct *up,
|
extern int task_can_switch_user(struct user_struct *up,
|
||||||
struct task_struct *tsk);
|
struct task_struct *tsk);
|
||||||
|
|
||||||
#ifdef CONFIG_TASK_XACCT
|
|
||||||
static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
|
|
||||||
{
|
|
||||||
tsk->ioac.rchar += amt;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
|
|
||||||
{
|
|
||||||
tsk->ioac.wchar += amt;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void inc_syscr(struct task_struct *tsk)
|
|
||||||
{
|
|
||||||
tsk->ioac.syscr++;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void inc_syscw(struct task_struct *tsk)
|
|
||||||
{
|
|
||||||
tsk->ioac.syscw++;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void inc_syscr(struct task_struct *tsk)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void inc_syscw(struct task_struct *tsk)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef TASK_SIZE_OF
|
#ifndef TASK_SIZE_OF
|
||||||
#define TASK_SIZE_OF(tsk) TASK_SIZE
|
#define TASK_SIZE_OF(tsk) TASK_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,6 +1,48 @@
|
|||||||
#ifndef _LINUX_SCHED_XACCT_H
|
#ifndef _LINUX_SCHED_XACCT_H
|
||||||
#define _LINUX_SCHED_XACCT_H
|
#define _LINUX_SCHED_XACCT_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Extended task accounting methods:
|
||||||
|
*/
|
||||||
|
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_TASK_XACCT
|
||||||
|
static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
|
||||||
|
{
|
||||||
|
tsk->ioac.rchar += amt;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
|
||||||
|
{
|
||||||
|
tsk->ioac.wchar += amt;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void inc_syscr(struct task_struct *tsk)
|
||||||
|
{
|
||||||
|
tsk->ioac.syscr++;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void inc_syscw(struct task_struct *tsk)
|
||||||
|
{
|
||||||
|
tsk->ioac.syscw++;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void inc_syscr(struct task_struct *tsk)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void inc_syscw(struct task_struct *tsk)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _LINUX_SCHED_XACCT_H */
|
#endif /* _LINUX_SCHED_XACCT_H */
|
||||||
|
Reference in New Issue
Block a user