Age | Commit message (Collapse) | Author |
|
In case malloc fails, the fix returns NULL to avoid NULL pointer
dereference.
Signed-off-by: zhangliguang <zhangliguang@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Weiping Zhang <zhangweiping@didiglobal.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Use proper unsigned math to figure out how many entries we have. If
we have head and tail on either side of UINT_MAX, then we currently
don't submit anything as:
while (head < tail) {
is never true.
Reported-by: Weiping Zhang <zhangweiping@didiglobal.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
If the ring setup fails, close the fd before returning failure.
Reported-by: Kornilios Kourtis <kkourt@kkourt.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
We really should use a ';' to terminate the line. This is just a
cosmetic issue, no functional changes.
Signed-off-by: Weiping Zhang <zhangweiping@didiglobal.com>
Modified wording
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Some of the symbols were missing from linker version
script so they weren't exported in the dynamic library.
Signed-off-by: Hrvoje Zeba <zeba.hrvoje@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Fortunately, all architectures except alpha have common numbers
for new system calls nowadays, so support of non-alpha architectures
is as simple as support of x86.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Rename __NR_sys_io_uring* to __NR_io_uring* to match kernel headers.
The prefix traditionally used for macros describing syscall numbers
is "__NR_", not "__NR_sys_".
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
* 'const-matching' of https://github.com/flamingcow66/liburing:
Match const signatures in io_uring_prep_* to native functions
|
|
io_uring_prep_{readv,writev,read_fixed,write_fixed}() take
non-const arguments that are const in the native functions
that they mimic. Make those arguments const.
Signed-off-by: Ian Gulliver <git@flamingcow.io>
|
|
* 'missing-header' of https://github.com/flamingcow66/liburing:
Fix liburing.h memset() missing declaration
|
|
liburing.h uses memset() but doesn't include string.h.
If nothing else includes it, this causes compile errors.
Add the include.
Signed-off-by: Ian Gulliver <git@flamingcow.io>
|
|
Add sync_range_file opcode and related fields, and the
io_uring_register(2) commands for eventfd registration.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
The examples in the io_uring_setup.2 man patch erroneously ORs
the protection bits and mmap flags, fix it up.
Signed-off-by: Ian Gulliver <git@flamingcow.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Also kill reference to long dead TODO file.
Patch from Hrvoje Zeba <zeba.hrvoje@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Put the data at the end so we don't have to offset the actual buffer.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Add short read requeue and abort on error.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Still need to handle broken chains, must resubmit those.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
We need a lot of RAM for this case, my vm always fails it. Don't
hard fail due to ENOMEM, just skip the test.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
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>
|
|
Older installs/distros don't have this in fs.h.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
SQPOLL requires root, if the tests are run as a user, we'll get
EPERM instead of EINVAL. Don't fail the test because of that, just
mention it in the log.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
With the recent change to ensure that submission side errors that
happen on behalf of an sqe are returned in the form of a cqe rather
than -1/errno from the system call, make sure that the man page
reflects that.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
For the IORING_SETUP_SQPOLL|IORING_SETUP_SQ_AFF test case, add_pipe is
not set, and the output is like:
"...flags: IORING_SETUP_SQPOLLIORING_SETUP_SQ_AFF...".
Set add_pipe for IORING_SETUP_SQPOLL flag so that the output is like:
"...flags: IORING_SETUP_SQPOLL|IORING_SETUP_SQ_AFF...".
Acked-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Install man pages on running 'make install', so that
we can run commands like 'man 2 io_uring_setup'.
Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
This adds the missing shell script that runs the tests.
Fixes: 4916320ec374 ("Separate test cases from examples")
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 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>
|
|
Also adds a runtests makefile target.
|
|
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>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
This failure is expected on kernels that don't support the DRAIN
primitive.
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: Jens Axboe <axboe@kernel.dk>
|
|
Replace all cqe->user_data casts with io_uring_cqe_get_data().
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>
|