|
@@ -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
|