Lines Matching refs:count
43 __u64 count; member
65 if (ULLONG_MAX - ctx->count < n) in eventfd_signal_mask()
66 n = ULLONG_MAX - ctx->count; in eventfd_signal_mask()
67 ctx->count += n; in eventfd_signal_mask()
136 u64 count; in eventfd_poll() local
178 count = READ_ONCE(ctx->count); in eventfd_poll()
180 if (count > 0) in eventfd_poll()
182 if (count == ULLONG_MAX) in eventfd_poll()
184 if (ULLONG_MAX - 1 > count) in eventfd_poll()
194 *cnt = ((ctx->flags & EFD_SEMAPHORE) && ctx->count) ? 1 : ctx->count; in eventfd_ctx_do_read()
195 ctx->count -= *cnt; in eventfd_ctx_do_read()
238 if (!ctx->count) { in eventfd_read()
247 if (ctx->count) in eventfd_read()
272 static ssize_t eventfd_write(struct file *file, const char __user *buf, size_t count, in eventfd_write() argument
280 if (count < sizeof(ucnt)) in eventfd_write()
288 if (ULLONG_MAX - ctx->count > ucnt) in eventfd_write()
294 if (ULLONG_MAX - ctx->count > ucnt) { in eventfd_write()
310 ctx->count += ucnt; in eventfd_write()
326 (unsigned long long)ctx->count); in eventfd_show_fdinfo()
412 static int do_eventfd(unsigned int count, int flags) in do_eventfd() argument
431 ctx->count = count; in do_eventfd()
456 SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags) in SYSCALL_DEFINE2() argument
458 return do_eventfd(count, flags); in SYSCALL_DEFINE2()
461 SYSCALL_DEFINE1(eventfd, unsigned int, count) in SYSCALL_DEFINE1() argument
463 return do_eventfd(count, 0); in SYSCALL_DEFINE1()