struct submitter {
pthread_t thread;
int ring_fd;
- struct drand48_data rand;
struct io_sq_ring sq_ring;
struct io_uring_sqe *sqes;
struct io_cq_ring cq_ring;
if (do_nop)
return 0;
- return syscall(__NR_sys_io_uring_register, s->ring_fd,
+ return syscall(__NR_io_uring_register, s->ring_fd,
IORING_REGISTER_BUFFERS, s->iovecs, depth);
}
s->files[i].fixed_fd = i;
}
- return syscall(__NR_sys_io_uring_register, s->ring_fd,
+ return syscall(__NR_io_uring_register, s->ring_fd,
IORING_REGISTER_FILES, s->fds, s->nr_files);
}
static int io_uring_setup(unsigned entries, struct io_uring_params *p)
{
- return syscall(__NR_sys_io_uring_setup, entries, p);
+ return syscall(__NR_io_uring_setup, entries, p);
}
static int io_uring_enter(struct submitter *s, unsigned int to_submit,
unsigned int min_complete, unsigned int flags)
{
- return syscall(__NR_sys_io_uring_enter, s->ring_fd, to_submit,
- min_complete, flags, NULL, 0);
+ return syscall(__NR_io_uring_enter, s->ring_fd, to_submit, min_complete,
+ flags, NULL, 0);
}
+#ifndef CONFIG_HAVE_GETTID
static int gettid(void)
{
return syscall(__NR_gettid);
}
+#endif
static unsigned file_depth(struct submitter *s)
{
}
f->pending_ios++;
- lrand48_r(&s->rand, &r);
+ r = lrand48();
offset = (r % (f->max_blocks - 1)) * BS;
if (register_files) {
} while (prepped < max_ios);
if (*ring->tail != tail) {
- /* order tail store with writes to sqes above */
- write_barrier();
*ring->tail = tail;
write_barrier();
}
if (cqe->res != BS) {
printf("io: unexpected ret=%d\n", cqe->res);
if (polled && cqe->res == -EOPNOTSUPP)
- printf("Your filesystem/device doesn't "
- "support polled IO\n");
+ printf("Your filesystem/driver/kernel doesn't support polled IO\n");
return -1;
}
}
printf("submitter=%d\n", gettid());
- srand48_r(pthread_self(), &s->rand);
+ srand48(pthread_self());
prepped = 0;
do {