Skip to content
Discussion options

You must be logged in to vote

Never mind, I eventually figured it out (brute forcing my way through all possible combinations :-) ).

This works:

int fds[4] = {src_fd, dst_fd, pipefd[0], pipefd[1]};

io_uring_prep_splice(sqe1, 0, offset, 3, -1, to_copy, SPLICE_F_FD_IN_FIXED);
sqe1->flags |= IOSQE_FIXED_FILE;
sqe1->flags |= IOSQE_IO_LINK;  // Link to next

io_uring_prep_splice(sqe2, 2, -1, 1, offset, to_copy, SPLICE_F_FD_IN_FIXED);
sqe2->flags |= IOSQE_FIXED_FILE;

And it seems to be reliably faster than using FileDescriptors and on par with CoreUtils cp:

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by manticore-projects
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant