diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/cgroup.h | 20 | ||||
-rw-r--r-- | include/linux/list.h | 15 | ||||
-rw-r--r-- | include/linux/suspend.h | 26 | ||||
-rw-r--r-- | include/linux/tracepoint.h | 1 |
4 files changed, 43 insertions, 19 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 0c621604baa1..e3d00fdb858d 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -525,13 +525,21 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state( | |||
525 | return cgrp->subsys[subsys_id]; | 525 | return cgrp->subsys[subsys_id]; |
526 | } | 526 | } |
527 | 527 | ||
528 | static inline struct cgroup_subsys_state *task_subsys_state( | 528 | /* |
529 | struct task_struct *task, int subsys_id) | 529 | * function to get the cgroup_subsys_state which allows for extra |
530 | * rcu_dereference_check() conditions, such as locks used during the | ||
531 | * cgroup_subsys::attach() methods. | ||
532 | */ | ||
533 | #define task_subsys_state_check(task, subsys_id, __c) \ | ||
534 | rcu_dereference_check(task->cgroups->subsys[subsys_id], \ | ||
535 | rcu_read_lock_held() || \ | ||
536 | lockdep_is_held(&task->alloc_lock) || \ | ||
537 | cgroup_lock_is_held() || (__c)) | ||
538 | |||
539 | static inline struct cgroup_subsys_state * | ||
540 | task_subsys_state(struct task_struct *task, int subsys_id) | ||
530 | { | 541 | { |
531 | return rcu_dereference_check(task->cgroups->subsys[subsys_id], | 542 | return task_subsys_state_check(task, subsys_id, false); |
532 | rcu_read_lock_held() || | ||
533 | lockdep_is_held(&task->alloc_lock) || | ||
534 | cgroup_lock_is_held()); | ||
535 | } | 543 | } |
536 | 544 | ||
537 | static inline struct cgroup* task_cgroup(struct task_struct *task, | 545 | static inline struct cgroup* task_cgroup(struct task_struct *task, |
diff --git a/include/linux/list.h b/include/linux/list.h index 8392884a2977..5d57a3a1fa1b 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -544,6 +544,21 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
544 | &pos->member != (head); \ | 544 | &pos->member != (head); \ |
545 | pos = n, n = list_entry(n->member.prev, typeof(*n), member)) | 545 | pos = n, n = list_entry(n->member.prev, typeof(*n), member)) |
546 | 546 | ||
547 | /** | ||
548 | * list_safe_reset_next - reset a stale list_for_each_entry_safe loop | ||
549 | * @pos: the loop cursor used in the list_for_each_entry_safe loop | ||
550 | * @n: temporary storage used in list_for_each_entry_safe | ||
551 | * @member: the name of the list_struct within the struct. | ||
552 | * | ||
553 | * list_safe_reset_next is not safe to use in general if the list may be | ||
554 | * modified concurrently (eg. the lock is dropped in the loop body). An | ||
555 | * exception to this is if the cursor element (pos) is pinned in the list, | ||
556 | * and list_safe_reset_next is called after re-taking the lock and before | ||
557 | * completing the current iteration of the loop body. | ||
558 | */ | ||
559 | #define list_safe_reset_next(pos, n, member) \ | ||
560 | n = list_entry(pos->member.next, typeof(*pos), member) | ||
561 | |||
547 | /* | 562 | /* |
548 | * Double linked lists with a single pointer list head. | 563 | * Double linked lists with a single pointer list head. |
549 | * Mostly useful for hash tables where the two pointer list head is | 564 | * Mostly useful for hash tables where the two pointer list head is |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 5e781d824e6d..bc7d6bb4cd8e 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -256,22 +256,22 @@ static inline int hibernate(void) { return -ENOSYS; } | |||
256 | static inline bool system_entering_hibernation(void) { return false; } | 256 | static inline bool system_entering_hibernation(void) { return false; } |
257 | #endif /* CONFIG_HIBERNATION */ | 257 | #endif /* CONFIG_HIBERNATION */ |
258 | 258 | ||
259 | #ifdef CONFIG_HIBERNATION_NVS | 259 | #ifdef CONFIG_SUSPEND_NVS |
260 | extern int hibernate_nvs_register(unsigned long start, unsigned long size); | 260 | extern int suspend_nvs_register(unsigned long start, unsigned long size); |
261 | extern int hibernate_nvs_alloc(void); | 261 | extern int suspend_nvs_alloc(void); |
262 | extern void hibernate_nvs_free(void); | 262 | extern void suspend_nvs_free(void); |
263 | extern void hibernate_nvs_save(void); | 263 | extern void suspend_nvs_save(void); |
264 | extern void hibernate_nvs_restore(void); | 264 | extern void suspend_nvs_restore(void); |
265 | #else /* CONFIG_HIBERNATION_NVS */ | 265 | #else /* CONFIG_SUSPEND_NVS */ |
266 | static inline int hibernate_nvs_register(unsigned long a, unsigned long b) | 266 | static inline int suspend_nvs_register(unsigned long a, unsigned long b) |
267 | { | 267 | { |
268 | return 0; | 268 | return 0; |
269 | } | 269 | } |
270 | static inline int hibernate_nvs_alloc(void) { return 0; } | 270 | static inline int suspend_nvs_alloc(void) { return 0; } |
271 | static inline void hibernate_nvs_free(void) {} | 271 | static inline void suspend_nvs_free(void) {} |
272 | static inline void hibernate_nvs_save(void) {} | 272 | static inline void suspend_nvs_save(void) {} |
273 | static inline void hibernate_nvs_restore(void) {} | 273 | static inline void suspend_nvs_restore(void) {} |
274 | #endif /* CONFIG_HIBERNATION_NVS */ | 274 | #endif /* CONFIG_SUSPEND_NVS */ |
275 | 275 | ||
276 | #ifdef CONFIG_PM_SLEEP | 276 | #ifdef CONFIG_PM_SLEEP |
277 | void save_processor_state(void); | 277 | void save_processor_state(void); |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 9a59d1f98cd4..103d1b61aacb 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -14,6 +14,7 @@ | |||
14 | * See the file COPYING for more details. | 14 | * See the file COPYING for more details. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/errno.h> | ||
17 | #include <linux/types.h> | 18 | #include <linux/types.h> |
18 | #include <linux/rcupdate.h> | 19 | #include <linux/rcupdate.h> |
19 | 20 | ||