summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-01-16 08:41:05 -0700
committerJens Axboe <axboe@kernel.dk>2019-01-16 09:00:50 -0700
commitb93edf5b9eb6f392d40585e26df1663fccc0c09d (patch)
tree55f8cb83aa3cb6e1e738230d1ef9f9f07db38e9a
parentf16b83b29349dae16f07aae9a1709aed0dff247d (diff)
Sync with upstream API
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/io_uring.h21
-rw-r--r--src/syscall.c5
-rw-r--r--test/io_uring-cp.c4
-rw-r--r--test/io_uring-test.c2
4 files changed, 7 insertions, 25 deletions
diff --git a/src/io_uring.h b/src/io_uring.h
index 71e9202..9bb7181 100644
--- a/src/io_uring.h
+++ b/src/io_uring.h
@@ -20,10 +20,7 @@ struct io_uring_sqe {
__u16 ioprio; /* ioprio for the request */
__s32 fd; /* file descriptor to do IO on */
__u64 off; /* offset into file */
- union {
- void *addr; /* buffer or iovecs */
- __u64 __pad;
- };
+ __u64 addr; /* pointer to buffer or iovecs */
__u32 len; /* buffer size or number of iovecs */
union {
__kernel_rwf_t rw_flags;
@@ -136,20 +133,4 @@ struct io_uring_params {
#define IORING_REGISTER_FILES 2
#define IORING_UNREGISTER_FILES 3
-struct io_uring_register_buffers {
- union {
- struct iovec *iovecs;
- __u64 pad;
- };
- __u32 nr_iovecs;
-};
-
-struct io_uring_register_files {
- union {
- __s32 *fds;
- __u64 pad;
- };
- __u32 nr_fds;
-};
-
#endif
diff --git a/src/syscall.c b/src/syscall.c
index 7097c46..d0e35d2 100644
--- a/src/syscall.c
+++ b/src/syscall.c
@@ -31,9 +31,10 @@
#error "Arch not supported yet"
#endif
-int io_uring_register(int fd, unsigned int opcode, void *arg)
+int io_uring_register(int fd, unsigned int opcode, void *arg,
+ unsigned int nr_args)
{
- return syscall(__NR_sys_io_uring_register, fd, opcode, arg);
+ return syscall(__NR_sys_io_uring_register, fd, opcode, arg, nr_args);
}
int io_uring_setup(unsigned int entries, struct io_uring_params *p)
diff --git a/test/io_uring-cp.c b/test/io_uring-cp.c
index ce624c5..5f928c0 100644
--- a/test/io_uring-cp.c
+++ b/test/io_uring-cp.c
@@ -73,7 +73,7 @@ static int queue_read(int fd, off_t size, off_t offset)
sqe->ioprio = 0;
sqe->fd = fd;
sqe->off = offset;
- sqe->addr = data->iov;
+ sqe->addr = (unsigned long) data->iov;
sqe->buf_index = 0;
sqe->user_data = (unsigned long) data;
iovecs[sqe_index(sqe)].iov_len = size;
@@ -123,7 +123,7 @@ static void queue_write(int fd, struct io_uring_cqe *cqe)
sqe->ioprio = 0;
sqe->fd = fd;
sqe->off = data->offset;
- sqe->addr = data->iov;
+ sqe->addr = (unsigned long) data->iov;
sqe->buf_index = 0;
sqe->user_data = 0;
data->iov->iov_len = cqe->res;
diff --git a/test/io_uring-test.c b/test/io_uring-test.c
index 42a8745..a8e8cdf 100644
--- a/test/io_uring-test.c
+++ b/test/io_uring-test.c
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
sqe->ioprio = 0;
sqe->fd = fd;
sqe->off = offset;
- sqe->addr = &iovecs[i];
+ sqe->addr = (unsigned long) &iovecs[i];
sqe->len = 1;
sqe->buf_index = 0;
offset += iovecs[i].iov_len;