diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-04 12:36:54 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-04 12:36:54 -0800 |
commit | c5974b835a909ff15c3b7e6cf6789b5eb919f419 (patch) | |
tree | 959088bbf10da0d8496b1310fd6f3be6ea11966e /include/linux/sched.h | |
parent | 14107c750b840d6efd7fdf2f6d513f35e2eb6230 (diff) | |
parent | 3e10e716abf3c71bdb5d86b8f507f9e72236c9cd (diff) |
Merge branch 'limits_cleanup' of git://decibel.fi.muni.cz/~xslaby/linux
* 'limits_cleanup' of git://decibel.fi.muni.cz/~xslaby/linux:
resource: add helpers for fetching rlimits
resource: move kernel function inside __KERNEL__
SECURITY: selinux, fix update_rlimit_cpu parameter
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index f2f842db03c..8d4991be9d5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2601,6 +2601,28 @@ static inline void mm_init_owner(struct mm_struct *mm, struct task_struct *p) } #endif /* CONFIG_MM_OWNER */ +static inline unsigned long task_rlimit(const struct task_struct *tsk, + unsigned int limit) +{ + return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_cur); +} + +static inline unsigned long task_rlimit_max(const struct task_struct *tsk, + unsigned int limit) +{ + return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_max); +} + +static inline unsigned long rlimit(unsigned int limit) +{ + return task_rlimit(current, limit); +} + +static inline unsigned long rlimit_max(unsigned int limit) +{ + return task_rlimit_max(current, limit); +} + #endif /* __KERNEL__ */ #endif |