summaryrefslogtreecommitdiffstats
path: root/fs/eventfd.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-08 04:21:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-08 04:21:35 +0000
commit7b642cd94bb96385cbdbb36a1952f129af6b1bbb (patch)
treee7c4209372da8a2fa745aaa3e99d062e54d0f556 /fs/eventfd.c
parentAdding debian version 4.19.289-2. (diff)
downloadlinux-7b642cd94bb96385cbdbb36a1952f129af6b1bbb.tar.xz
linux-7b642cd94bb96385cbdbb36a1952f129af6b1bbb.zip
Merging upstream version 4.19.304.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fs/eventfd.c')
-rw-r--r--fs/eventfd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/eventfd.c b/fs/eventfd.c
index ce1d1711f..66864100b 100644
--- a/fs/eventfd.c
+++ b/fs/eventfd.c
@@ -174,11 +174,14 @@ static __poll_t eventfd_poll(struct file *file, poll_table *wait)
return events;
}
-static void eventfd_ctx_do_read(struct eventfd_ctx *ctx, __u64 *cnt)
+void eventfd_ctx_do_read(struct eventfd_ctx *ctx, __u64 *cnt)
{
- *cnt = (ctx->flags & EFD_SEMAPHORE) ? 1 : ctx->count;
+ lockdep_assert_held(&ctx->wqh.lock);
+
+ *cnt = ((ctx->flags & EFD_SEMAPHORE) && ctx->count) ? 1 : ctx->count;
ctx->count -= *cnt;
}
+EXPORT_SYMBOL_GPL(eventfd_ctx_do_read);
/**
* eventfd_ctx_remove_wait_queue - Read the current counter and removes wait queue.