Age | Commit message (Collapse) | Author |
|
Just a basic test case that does various forms of linked nops, and
a sample bare bones copy program using linked reads and writes.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Make header includable from C++ projects.
Signed-off-by: Kevin Vigor <kvigor@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Static libraries are generally built without -fPIC for slight
performance gain, make that the case for liburing.
Signed-off-by: Kevin Vigor <kvigor@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
'make install' did not install all the headers necessary to use the
library; fix.
Additionally allow specifying the install prefix, which was previously
hardcoded to /usr.
Signed-off-by: Kevin Vigor <kvigor@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
We have io_uring_get_sqe() on the submission side, yet the completion
side is named _completion. Rename as follows:
io_uring_get_completion() io_uring_peek_cqe()
iO_uring_wait_completion() io_uring_wait_cqe()
This better tells the user what the _get variant does by calling it
_peek instead, and we move to using _cqe() as the postfix instead
of _completion.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
There's a failure case where an application gets a cqe entry, but
the kernel can then overwrite it before the application is done
reading it. This can happen since the io_uring_{get,wait}_completion()
interface both returns a CQE pointer AND increments the ring index.
If the kernel reuses this entry before the applications is done reading
it, the contents may be corrupted.
Remove the CQ head increment from the CQE retrieval, and put it into
a separate helper, io_uring_cqe_seen(). The application must call this
helper when it got a new CQE entry through one of the above calls, and
it's now done reading it.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
I generalized the barrier flag to be applicable to all commands, so
let's drop the fsync special flag.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Zach Bjornson <zbbjornson@gmail.com>
Add uintptr_t cast to avoid 32-bit warnings.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Also changes the fsync prep helper to require passing in the actual
flag, not just a boolean for fsync vs fdatasync.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
This cache hint has been removed from the io_uring series, as there's
some hesitation to leak this information to userspace. Remove it from
the header file and the man page. We can always re-introduce it later,
if we get some variant of this included.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
A previous fix that ensured we pass back the right error messed
up the normal return, which is number of entries submitted.
This makes the poll test cases fail.
Fixes: 8260029608b9 ("queue: ensure io_uring_submit() returns the right error")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
We weren't passing back -errno for the system call failure.
This meant any error got turned into EPERM as far as the
caller was concerned.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Also unify the setup, all the read/write variants can use the same
helper.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
This really wants to be a "will we over-fill the ring?" kind of
check, but the sqe_head/sqe_tail should not be that far apart. If they
are, that's a bug elsewhere. So just kill the check.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
io_uring_queue_init does not allow the caller to specify sq_thread_cpu
or sq_thread_idle. Users that want to specify those parameters need to
call io_uring_setup(2) themselves. Add a helper so that they don't also
have to hand-craft the code to map the submission and completion queues,
and setup the sqe ring. This allows those applications to still make
use of io_uring_submit and get/wait_completion.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Applications should not need to care about this, we can pass it in
ourselves. Once the libc support is there, we won't expose this
parameter either.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Update liburing and io_uring_enter.2 to match the kernel.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
We would randomly fail depending on what garbage was passed in
the two sigset related fields.
Reported-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Just a removal of the IORING_MAX_ENTRIES user visible define.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
- struct io_uring_params changed (u16 -> u32 for sq options)
- Use unsigned for the flag types
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Let's have the various helpers be in usefully named functions, no
need to bundle them all into the same one.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Some older installs don't have __kernel_rwf_t in linux/fs.h, so
add a check for that.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Missed this part when the switch was made to full 'sqe'.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
We don't need any of the information in there in the caller, and
this makes it harder to abuse as we don't require the caller to
have memset() the struct first.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
- Fixed buffers are now available through io_uring_register()
- Various thread/wq options are now dead and automatic instead
- sqe->index is now sqe->buf_index
- Fixed buffers require flag, not separate opcode
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
- io_uring_sqe added a data field that's passed back at completion
- io_uring_sqe added an index field, for fixed buffer locations
- io_uring_setup(2) system call added a 'nr_iovecs' field
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
No point in keeping these separate.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
This is cleaner than having the app juggle an SQ and CQ ring,
just wrap them in struct io_uring and have the API always take
that. This means the app doesn't need to worry about the different
types of rings, and that we only need to pass in one argument
for setup/teardown.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Returns the iocb associated with a completion event.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
This now exposes two helpers:
io_uring_get_completion()
Return a completion, if we have one (or more) available in
the ring
io_uring_wait_completion()
Return a completion, waiting for it if necessary
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|