diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mm_types.h | 2 | ||||
-rw-r--r-- | include/linux/resource.h | 8 | ||||
-rw-r--r-- | include/linux/sched.h | 22 |
3 files changed, 30 insertions, 2 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 84a524afb3dc..84d020bed083 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -123,6 +123,8 @@ struct vm_region { | |||
123 | struct file *vm_file; /* the backing file or NULL */ | 123 | struct file *vm_file; /* the backing file or NULL */ |
124 | 124 | ||
125 | atomic_t vm_usage; /* region usage count */ | 125 | atomic_t vm_usage; /* region usage count */ |
126 | bool vm_icache_flushed : 1; /* true if the icache has been flushed for | ||
127 | * this region */ | ||
126 | }; | 128 | }; |
127 | 129 | ||
128 | /* | 130 | /* |
diff --git a/include/linux/resource.h b/include/linux/resource.h index 40fc7e626082..f1e914eefeab 100644 --- a/include/linux/resource.h +++ b/include/linux/resource.h | |||
@@ -3,8 +3,6 @@ | |||
3 | 3 | ||
4 | #include <linux/time.h> | 4 | #include <linux/time.h> |
5 | 5 | ||
6 | struct task_struct; | ||
7 | |||
8 | /* | 6 | /* |
9 | * Resource control/accounting header file for linux | 7 | * Resource control/accounting header file for linux |
10 | */ | 8 | */ |
@@ -70,6 +68,12 @@ struct rlimit { | |||
70 | */ | 68 | */ |
71 | #include <asm/resource.h> | 69 | #include <asm/resource.h> |
72 | 70 | ||
71 | #ifdef __KERNEL__ | ||
72 | |||
73 | struct task_struct; | ||
74 | |||
73 | int getrusage(struct task_struct *p, int who, struct rusage __user *ru); | 75 | int getrusage(struct task_struct *p, int who, struct rusage __user *ru); |
74 | 76 | ||
77 | #endif /* __KERNEL__ */ | ||
78 | |||
75 | #endif | 79 | #endif |
diff --git a/include/linux/sched.h b/include/linux/sched.h index f2f842db03ce..8d4991be9d53 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) | |||
2601 | } | 2601 | } |
2602 | #endif /* CONFIG_MM_OWNER */ | 2602 | #endif /* CONFIG_MM_OWNER */ |
2603 | 2603 | ||
2604 | static inline unsigned long task_rlimit(const struct task_struct *tsk, | ||
2605 | unsigned int limit) | ||
2606 | { | ||
2607 | return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_cur); | ||
2608 | } | ||
2609 | |||
2610 | static inline unsigned long task_rlimit_max(const struct task_struct *tsk, | ||
2611 | unsigned int limit) | ||
2612 | { | ||
2613 | return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_max); | ||
2614 | } | ||
2615 | |||
2616 | static inline unsigned long rlimit(unsigned int limit) | ||
2617 | { | ||
2618 | return task_rlimit(current, limit); | ||
2619 | } | ||
2620 | |||
2621 | static inline unsigned long rlimit_max(unsigned int limit) | ||
2622 | { | ||
2623 | return task_rlimit_max(current, limit); | ||
2624 | } | ||
2625 | |||
2604 | #endif /* __KERNEL__ */ | 2626 | #endif /* __KERNEL__ */ |
2605 | 2627 | ||
2606 | #endif | 2628 | #endif |