sysfs: Remove support for tagged directories with untagged members (again)
[linux-btrfs-devel.git] / include / linux / user-return-notifier.h
blob9c4a445bb43c69999eb29303e9d8a0c4c6412c89
1 #ifndef _LINUX_USER_RETURN_NOTIFIER_H
2 #define _LINUX_USER_RETURN_NOTIFIER_H
4 #ifdef CONFIG_USER_RETURN_NOTIFIER
6 #include <linux/list.h>
7 #include <linux/sched.h>
9 struct user_return_notifier {
10 void (*on_user_return)(struct user_return_notifier *urn);
11 struct hlist_node link;
15 void user_return_notifier_register(struct user_return_notifier *urn);
16 void user_return_notifier_unregister(struct user_return_notifier *urn);
18 static inline void propagate_user_return_notify(struct task_struct *prev,
19 struct task_struct *next)
21 if (test_tsk_thread_flag(prev, TIF_USER_RETURN_NOTIFY)) {
22 clear_tsk_thread_flag(prev, TIF_USER_RETURN_NOTIFY);
23 set_tsk_thread_flag(next, TIF_USER_RETURN_NOTIFY);
27 void fire_user_return_notifiers(void);
29 static inline void clear_user_return_notifier(struct task_struct *p)
31 clear_tsk_thread_flag(p, TIF_USER_RETURN_NOTIFY);
34 #else
36 struct user_return_notifier {};
38 static inline void propagate_user_return_notify(struct task_struct *prev,
39 struct task_struct *next)
43 static inline void fire_user_return_notifiers(void) {}
45 static inline void clear_user_return_notifier(struct task_struct *p) {}
47 #endif
49 #endif