| .. | .. |
|---|
| 14 | 14 | #include <linux/err.h> |
|---|
| 15 | 15 | #include <linux/percpu-defs.h> |
|---|
| 16 | 16 | #include <linux/percpu.h> |
|---|
| 17 | | -#include <linux/sched.h> |
|---|
| 18 | 17 | |
|---|
| 19 | 18 | /* |
|---|
| 20 | 19 | * CAREFUL: Check include/uapi/asm-generic/fcntl.h when defining |
|---|
| .. | .. |
|---|
| 43 | 42 | __u64 eventfd_signal_mask(struct eventfd_ctx *ctx, __u64 n, unsigned mask); |
|---|
| 44 | 43 | int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, wait_queue_entry_t *wait, |
|---|
| 45 | 44 | __u64 *cnt); |
|---|
| 45 | +void eventfd_ctx_do_read(struct eventfd_ctx *ctx, __u64 *cnt); |
|---|
| 46 | 46 | |
|---|
| 47 | | -static inline bool eventfd_signal_allowed(void) |
|---|
| 47 | +DECLARE_PER_CPU(int, eventfd_wake_count); |
|---|
| 48 | + |
|---|
| 49 | +static inline bool eventfd_signal_count(void) |
|---|
| 48 | 50 | { |
|---|
| 49 | | - return !current->in_eventfd_signal; |
|---|
| 51 | + return this_cpu_read(eventfd_wake_count); |
|---|
| 50 | 52 | } |
|---|
| 51 | 53 | |
|---|
| 52 | 54 | #else /* CONFIG_EVENTFD */ |
|---|
| .. | .. |
|---|
| 61 | 63 | return ERR_PTR(-ENOSYS); |
|---|
| 62 | 64 | } |
|---|
| 63 | 65 | |
|---|
| 64 | | -static inline int eventfd_signal(struct eventfd_ctx *ctx, int n) |
|---|
| 66 | +static inline int eventfd_signal(struct eventfd_ctx *ctx, __u64 n) |
|---|
| 65 | 67 | { |
|---|
| 66 | 68 | return -ENOSYS; |
|---|
| 67 | 69 | } |
|---|
| .. | .. |
|---|
| 83 | 85 | return -ENOSYS; |
|---|
| 84 | 86 | } |
|---|
| 85 | 87 | |
|---|
| 86 | | -static inline bool eventfd_signal_allowed(void) |
|---|
| 88 | +static inline bool eventfd_signal_count(void) |
|---|
| 87 | 89 | { |
|---|
| 88 | | - return true; |
|---|
| 90 | + return false; |
|---|
| 91 | +} |
|---|
| 92 | + |
|---|
| 93 | +static inline void eventfd_ctx_do_read(struct eventfd_ctx *ctx, __u64 *cnt) |
|---|
| 94 | +{ |
|---|
| 95 | + |
|---|
| 89 | 96 | } |
|---|
| 90 | 97 | |
|---|
| 91 | 98 | #endif |
|---|