From: Gabriel Krisman Bertazi <krisman@suse.de>
To: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Cc: Jens Axboe <axboe@kernel.dk>,
Pavel Begunkov <asml.silence@gmail.com>,
Breno Leitao <leitao@debian.org>,
Christian Mazakas <christian.mazakas@gmail.com>,
Gilang Fachrezy <gilang4321@gmail.com>,
VNLX Kernel Department <kernel@vnlx.org>,
io-uring Mailing List <io-uring@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>
Subject: Re: [PATCH liburing v1 4/4] man/io_uring_prep_splice.3: Explain more about io_uring_prep_splice()
Date: Thu, 12 Jan 2023 14:26:00 -0300 [thread overview]
Message-ID: <87bkn3ekbb.fsf@suse.de> (raw)
In-Reply-To: <20230112155709.303615-5-ammar.faizi@intel.com> (Ammar Faizi's message of "Thu, 12 Jan 2023 22:57:09 +0700")
Ammar Faizi <ammarfaizi2@gnuweeb.org> writes:
> From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
>
> I have found two people confused about the io_uring_prep_splice()
> function, especially on the offset part. The current manpage for
> io_uring_prep_splice() doesn't tell about the rules of the offset
> arguments.
>
> Despite these rules are already noted in "man 2 io_uring_enter",
> people who want to know about this prep function will prefer to read
> "man 3 io_uring_prep_splice".
>
> Let's explain it there!
Hi Ammar,
A few suggestions below:
> --- a/man/io_uring_prep_splice.3
> +++ b/man/io_uring_prep_splice.3
> @@ -52,6 +52,34 @@ and
> .I fd_in
> given as a registered file descriptor offset.
>
> +If
> +.I fd_in
> +refers to a pipe,
> +.IR off_in
> +must be -1.
Maybe
"off_in is ignored and must be set to -1."
> +
> +If
> +.I fd_in
> +does not refer to a pipe and
> +.I off_in
> +is -1, then bytes are read from
bytes -> nbytes ?
> +.I fd_in
> +starting from the file offset and it is adjusted appropriately.
What do you think:
starting from the file offset, which is incremented by the number of
bytes read.
> +If
> +.I fd_in
> +does not refer to a pipe and
> +.I off_in
> +is not -1, then the starting offset of
> +.I fd_in
> +will be
> +.IR off_in .
> +
> +The same rules apply to
> +.I fd_out
> +and
> +.IR off_out .
> +
> This function prepares an async
> .BR splice (2)
> request. See that man page for details.
> @@ -78,3 +106,13 @@ field.
> .BR io_uring_submit (3),
> .BR io_uring_register (2),
> .BR splice (2)
> +
> +.SH NOTES
> +Note that even if
> +.I fd_in
> +or
> +.I fd_out
> +refers to a pipe, the splice operation can still failed with
failed -> fail
Thanks,
--
Gabriel Krisman Bertazi
next prev parent reply other threads:[~2023-01-12 18:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-12 15:57 [PATCH liburing v1 0/4] liburing updates for 2.4 Ammar Faizi
2023-01-12 15:57 ` [PATCH liburing v1 1/4] liburing-ffi.map: Add io_uring_prep_msg_ring_cqe_flags() function Ammar Faizi
2023-01-12 15:57 ` [PATCH liburing v1 2/4] CHANGELOG: Note about --nolibc configure option deprecation Ammar Faizi
2023-01-12 15:57 ` [PATCH liburing v1 3/4] liburing.h: 's/is adjust/is adjusted/' and fix indentation Ammar Faizi
2023-01-12 15:57 ` [PATCH liburing v1 4/4] man/io_uring_prep_splice.3: Explain more about io_uring_prep_splice() Ammar Faizi
2023-01-12 17:26 ` Gabriel Krisman Bertazi [this message]
2023-01-12 17:49 ` Jens Axboe
2023-01-12 17:49 ` [PATCH liburing v1 0/4] liburing updates for 2.4 Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bkn3ekbb.fsf@suse.de \
--to=krisman@suse.de \
--cc=ammarfaizi2@gnuweeb.org \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=christian.mazakas@gmail.com \
--cc=gilang4321@gmail.com \
--cc=gwml@vger.gnuweeb.org \
--cc=io-uring@vger.kernel.org \
--cc=kernel@vnlx.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.