Lines Matching defs:nr_events

115 	 * The real limit is nr_events - 1, which will be larger (see
121 unsigned nr_events;
465 static int aio_setup_ring(struct kioctx *ctx, unsigned int nr_events)
475 nr_events += 2; /* 1 is required, 2 for good luck */
478 size += sizeof(struct io_event) * nr_events;
491 nr_events = (PAGE_SIZE * nr_pages - sizeof(struct aio_ring))
546 ctx->nr_events = nr_events; /* trusted copy */
549 ring->nr = nr_events; /* user copy */
717 static struct kioctx *ioctx_alloc(unsigned nr_events)
724 * Store the original nr_events -- what userspace passed to io_setup(),
727 unsigned int max_reqs = nr_events;
734 * and unavailable, double nr_events so userspace sees what they
738 nr_events = max(nr_events, num_possible_cpus() * 4);
739 nr_events *= 2;
742 if (nr_events > (0x10000000U / sizeof(struct io_event))) {
743 pr_debug("ENOMEM: nr_events too high\n");
747 if (!nr_events || (unsigned long)max_reqs > aio_max_nr)
776 err = aio_setup_ring(ctx, nr_events);
780 atomic_set(&ctx->reqs_available, ctx->nr_events - 1);
781 ctx->req_batch = (ctx->nr_events - 1) / (num_possible_cpus() * 4);
807 ctx, ctx->user_id, mm, ctx->nr_events);
978 head %= ctx->nr_events;
982 events_in_ring = ctx->nr_events - (head - tail);
1122 if (++tail >= ctx->nr_events)
1218 pr_debug("h%u t%u m%u\n", head, tail, ctx->nr_events);
1223 head %= ctx->nr_events;
1224 tail %= ctx->nr_events;
1231 avail = (head <= tail ? tail : ctx->nr_events) - head;
1254 head %= ctx->nr_events;
1316 * Create an aio_context capable of receiving at least nr_events.
1321 * if the specified nr_events exceeds internal limits. May fail
1322 * with -EAGAIN if the specified nr_events exceeds the user's limit
1328 SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp)
1339 if (unlikely(ctx || nr_events == 0)) {
1340 pr_debug("EINVAL: ctx %lu nr_events %u\n",
1341 ctx, nr_events);
1345 ioctx = ioctx_alloc(nr_events);
1359 COMPAT_SYSCALL_DEFINE2(io_setup, unsigned, nr_events, u32 __user *, ctx32p)
1370 if (unlikely(ctx || nr_events == 0)) {
1371 pr_debug("EINVAL: ctx %lu nr_events %u\n",
1372 ctx, nr_events);
1376 ioctx = ioctx_alloc(nr_events);
2060 if (nr > ctx->nr_events)
2061 nr = ctx->nr_events;
2102 if (nr > ctx->nr_events)
2103 nr = ctx->nr_events;