Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp650930rwb; Thu, 12 Jan 2023 10:27:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXtXaVjm0HqWleNujAV3yjxAcj/JcoXAjaTXz57WHzdHa9SlUvmZu910qKTLr0djQwWShZQA X-Received: by 2002:a17:902:e948:b0:191:309a:d752 with SMTP id b8-20020a170902e94800b00191309ad752mr83789549pll.47.1673548070818; Thu, 12 Jan 2023 10:27:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673548070; cv=none; d=google.com; s=arc-20160816; b=SiM0xu5a+IbuDGlpmc7rjqnMHV4mfGD5Kan96zcXsAahynq7QTvSXV5Jt3tNLg1lzJ rGytmWvzQQri3dUCWTbAfNS6NzCti9FR4FMpitTMUNCdYBdhNiYCmwpw3nS39mThrwV/ uk/8PiaVU/yvdDkknO5X4b9aANFg0gKCqxTTjC0dDNMh3CdStKxzOKsIXsdIq+wEMsGF Zk9LieZbsOiG7TFeg88XvSM259KKhZQULLNdU33Qx/GhGAMI9wwqU9o8+dwqVX9pp44o OqIXazoEtC0SvgETPBtWfbhRjsNe30IAb8zWko7kJlMoYg/SVoYvGrxlrTEe/P6JrkrN F6Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature:dkim-signature; bh=13mFpbAeeYwt0IwkwBLytkgPA4Usq0Z/P4b7FvTHZQM=; b=fzQV1+cLiQ2W2KYa4LkJZ/uFLUbkz2XagBmEs24nga3GNCJsi+hcZ7Z8tARYbZkvD+ xpbQcMpfk9jzT7v2n3tEsFtB7KNf85ZNQRxPkowmJALBoHfJ/t2e+LetDlze3uP3mi6X /GJ2wshfis/a6FVM3rudVI8/NUScDLTvUi8Dc57crX8iVTFc+qAKLJMe+U9O945wXAhH fftAmgtc26281GwFHi0rs/9rJrDQn6EyyZ0nuJDY01V8T15b60KFnrMmTKJ+su9aZtsV YRTbzM/5zeALDT8rvGRyYqVWcWYgCrd/BgPEHJb7QKDpNZlMI6BnHwhbeObkFycPZMEq DJew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=rTKHe3GU; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q1-20020a170902dac100b00194635a92fdsi1787657plx.525.2023.01.12.10.27.44; Thu, 12 Jan 2023 10:27:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=rTKHe3GU; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239858AbjALSD4 (ORCPT + 50 others); Thu, 12 Jan 2023 13:03:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231924AbjALSCg (ORCPT ); Thu, 12 Jan 2023 13:02:36 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 227AF5832D; Thu, 12 Jan 2023 09:26:04 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 77A4D5BDE4; Thu, 12 Jan 2023 17:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1673544363; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=13mFpbAeeYwt0IwkwBLytkgPA4Usq0Z/P4b7FvTHZQM=; b=rTKHe3GU6XbeSqAawnhZSLi6p54Kb5E2qYI/xtRYsK4af7OwIUBZU3Gj8oCsNeYjuMGcpO hIMc4u6i657AesvbiuLq+9S/ScGHuPth148Obo6ocuqEM9WgOHz7DGjOOIxcrDBvaX8OXQ uU8IChx0ofV9TISxH72TT7jyV6bES7E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1673544363; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=13mFpbAeeYwt0IwkwBLytkgPA4Usq0Z/P4b7FvTHZQM=; b=QzXAGegBDUHxE2R9W2/gozyBw28D8YhcSt59GkK42hm3oSZzSqY+iPnXtJSN4f77WIV1PD nqSr7ZMWU25JRDDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id EF5D813776; Thu, 12 Jan 2023 17:26:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 3MOcLKpCwGOAYAAAMHmgww (envelope-from ); Thu, 12 Jan 2023 17:26:02 +0000 From: Gabriel Krisman Bertazi To: Ammar Faizi Cc: Jens Axboe , Pavel Begunkov , Breno Leitao , Christian Mazakas , Gilang Fachrezy , VNLX Kernel Department , io-uring Mailing List , Linux Kernel Mailing List , GNU/Weeb Mailing List Subject: Re: [PATCH liburing v1 4/4] man/io_uring_prep_splice.3: Explain more about io_uring_prep_splice() References: <20230112155709.303615-1-ammar.faizi@intel.com> <20230112155709.303615-5-ammar.faizi@intel.com> Date: Thu, 12 Jan 2023 14:26:00 -0300 In-Reply-To: <20230112155709.303615-5-ammar.faizi@intel.com> (Ammar Faizi's message of "Thu, 12 Jan 2023 22:57:09 +0700") Message-ID: <87bkn3ekbb.fsf@suse.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ammar Faizi writes: > From: Ammar Faizi > > 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