• Home
  • Raw
  • Download

Lines Matching refs:nr_events

121 	unsigned		nr_events;  member
461 static int aio_setup_ring(struct kioctx *ctx, unsigned int nr_events) in aio_setup_ring() argument
471 nr_events += 2; /* 1 is required, 2 for good luck */ in aio_setup_ring()
474 size += sizeof(struct io_event) * nr_events; in aio_setup_ring()
487 nr_events = (PAGE_SIZE * nr_pages - sizeof(struct aio_ring)) in aio_setup_ring()
542 ctx->nr_events = nr_events; /* trusted copy */ in aio_setup_ring()
545 ring->nr = nr_events; /* user copy */ in aio_setup_ring()
702 static struct kioctx *ioctx_alloc(unsigned nr_events) in ioctx_alloc() argument
712 unsigned int max_reqs = nr_events; in ioctx_alloc()
723 nr_events = max(nr_events, num_possible_cpus() * 4); in ioctx_alloc()
724 nr_events *= 2; in ioctx_alloc()
727 if (nr_events > (0x10000000U / sizeof(struct io_event))) { in ioctx_alloc()
732 if (!nr_events || (unsigned long)max_reqs > aio_max_nr) in ioctx_alloc()
761 err = aio_setup_ring(ctx, nr_events); in ioctx_alloc()
765 atomic_set(&ctx->reqs_available, ctx->nr_events - 1); in ioctx_alloc()
766 ctx->req_batch = (ctx->nr_events - 1) / (num_possible_cpus() * 4); in ioctx_alloc()
792 ctx, ctx->user_id, mm, ctx->nr_events); in ioctx_alloc()
963 head %= ctx->nr_events; in refill_reqs_available()
967 events_in_ring = ctx->nr_events - (head - tail); in refill_reqs_available()
1107 if (++tail >= ctx->nr_events) in aio_complete()
1203 pr_debug("h%u t%u m%u\n", head, tail, ctx->nr_events); in aio_read_events_ring()
1208 head %= ctx->nr_events; in aio_read_events_ring()
1209 tail %= ctx->nr_events; in aio_read_events_ring()
1216 avail = (head <= tail ? tail : ctx->nr_events) - head; in aio_read_events_ring()
1239 head %= ctx->nr_events; in aio_read_events_ring()
1313 SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp) in SYSCALL_DEFINE2() argument
1324 if (unlikely(ctx || nr_events == 0)) { in SYSCALL_DEFINE2()
1326 ctx, nr_events); in SYSCALL_DEFINE2()
1330 ioctx = ioctx_alloc(nr_events); in SYSCALL_DEFINE2()
1344 COMPAT_SYSCALL_DEFINE2(io_setup, unsigned, nr_events, u32 __user *, ctx32p) in COMPAT_SYSCALL_DEFINE2() argument
1355 if (unlikely(ctx || nr_events == 0)) { in COMPAT_SYSCALL_DEFINE2()
1357 ctx, nr_events); in COMPAT_SYSCALL_DEFINE2()
1361 ioctx = ioctx_alloc(nr_events); in COMPAT_SYSCALL_DEFINE2()
2045 if (nr > ctx->nr_events) in SYSCALL_DEFINE3()
2046 nr = ctx->nr_events; in SYSCALL_DEFINE3()
2087 if (nr > ctx->nr_events) in COMPAT_SYSCALL_DEFINE3()
2088 nr = ctx->nr_events; in COMPAT_SYSCALL_DEFINE3()