hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/linux/eventfd.h
....@@ -14,6 +14,7 @@
1414 #include <linux/err.h>
1515 #include <linux/percpu-defs.h>
1616 #include <linux/percpu.h>
17
+#include <linux/sched.h>
1718
1819 /*
1920 * CAREFUL: Check include/uapi/asm-generic/fcntl.h when defining
....@@ -39,14 +40,13 @@
3940 struct eventfd_ctx *eventfd_ctx_fdget(int fd);
4041 struct eventfd_ctx *eventfd_ctx_fileget(struct file *file);
4142 __u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n);
43
+__u64 eventfd_signal_mask(struct eventfd_ctx *ctx, __u64 n, unsigned mask);
4244 int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, wait_queue_entry_t *wait,
4345 __u64 *cnt);
4446
45
-DECLARE_PER_CPU(int, eventfd_wake_count);
46
-
47
-static inline bool eventfd_signal_count(void)
47
+static inline bool eventfd_signal_allowed(void)
4848 {
49
- return this_cpu_read(eventfd_wake_count);
49
+ return !current->in_eventfd_signal;
5050 }
5151
5252 #else /* CONFIG_EVENTFD */
....@@ -66,6 +66,12 @@
6666 return -ENOSYS;
6767 }
6868
69
+static inline int eventfd_signal_mask(struct eventfd_ctx *ctx, __u64 n,
70
+ unsigned mask)
71
+{
72
+ return -ENOSYS;
73
+}
74
+
6975 static inline void eventfd_ctx_put(struct eventfd_ctx *ctx)
7076 {
7177
....@@ -77,9 +83,9 @@
7783 return -ENOSYS;
7884 }
7985
80
-static inline bool eventfd_signal_count(void)
86
+static inline bool eventfd_signal_allowed(void)
8187 {
82
- return false;
88
+ return true;
8389 }
8490
8591 #endif