Lines Matching defs:count
35 * value of the __u64 being written is added to "count" and a
37 * specified, a read(2) will return the "count" value to userspace,
38 * and will reset "count" to zero. The kernel side eventfd_signal()
39 * also, adds to the "count" counter and issue a wakeup.
41 __u64 count;
63 if (ULLONG_MAX - ctx->count < n)
64 n = ULLONG_MAX - ctx->count;
65 ctx->count += n;
134 u64 count;
139 * All writes to ctx->count occur within ctx->wqh.lock. This read
151 * count = ctx->count
155 * ctx->count += n
165 * count = ctx->count (INVALID!)
167 * ctx->count += n
176 count = READ_ONCE(ctx->count);
178 if (count > 0)
180 if (count == ULLONG_MAX)
182 if (ULLONG_MAX - 1 > count)
192 *cnt = ((ctx->flags & EFD_SEMAPHORE) && ctx->count) ? 1 : ctx->count;
193 ctx->count -= *cnt;
235 if (!ctx->count) {
242 if (wait_event_interruptible_locked_irq(ctx->wqh, ctx->count)) {
259 static ssize_t eventfd_write(struct file *file, const char __user *buf, size_t count,
266 if (count < sizeof(ucnt))
274 if (ULLONG_MAX - ctx->count > ucnt)
278 ULLONG_MAX - ctx->count > ucnt);
283 ctx->count += ucnt;
300 seq_printf(m, "eventfd-count: %16llx\n",
301 (unsigned long long)ctx->count);
389 static int do_eventfd(unsigned int count, int flags)
408 ctx->count = count;
433 SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags)
435 return do_eventfd(count, flags);
438 SYSCALL_DEFINE1(eventfd, unsigned int, count)
440 return do_eventfd(count, 0);