From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF137C77B73 for ; Mon, 22 May 2023 07:55:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7274B6B0074; Mon, 22 May 2023 03:55:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6D5EC6B0075; Mon, 22 May 2023 03:55:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 59D66900003; Mon, 22 May 2023 03:55:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 473E66B0074 for ; Mon, 22 May 2023 03:55:26 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 19CCE1A049D for ; Mon, 22 May 2023 07:55:26 +0000 (UTC) X-FDA: 80817131052.06.ABFCF2A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf12.hostedemail.com (Postfix) with ESMTP id 2333B40014 for ; Mon, 22 May 2023 07:55:22 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eMbDg5xA; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf12.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684742123; a=rsa-sha256; cv=none; b=KQo6QZc8ryRHNjSwmda+mU+JOVOLmJD1NeV/dInMRnBV/5tYxwJoqJUFv+AaDIlBjXrS4a rlcQohQHb+LLPG3clYja1s3HRBFAzQMegEbMnPmHSSejAY96i7DhJDfGFs1LzYMzinoB3I HpugZ5OdBCce5wQm3gXF9PzygU8+aM0= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eMbDg5xA; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf12.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684742123; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=i+Y/VY/1bCM7OTbyEqv3AVM1otfl3olIIYs7Uq2R/A4=; b=71P+kX3HZRg3wComJCpPOOAtbrk4AlwaTS3jJZ5HAxQIof/zkEtOE756XqNkQcYih4/s43 MNR4cVQTxC4smFcsIdrR74vKgqlWxaU4E0xDjQSt513viyX/4gbYoTnfQjaZp9YRrQf8z8 eg5BL+2nszHM7Fdm/MOmRWaCgMao1t8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684742122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i+Y/VY/1bCM7OTbyEqv3AVM1otfl3olIIYs7Uq2R/A4=; b=eMbDg5xAKGdJl2tm1AIKB0GoEs4r8mppejEXja9rAtila+a4CooQnfB92mToBRUSRxbnqj lNp3gEiqHCi96ZykRL7eeWLgSSDPZ52psSaMl1KU1mVzTFlHqD/fulPEeIpd05Ca9T/yIo 4R/kc/KVgFWCuS1aYzZJdFyUjyg58Ek= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-638-Fp-BK7lKNVK23BF0WPdKPQ-1; Mon, 22 May 2023 03:55:19 -0400 X-MC-Unique: Fp-BK7lKNVK23BF0WPdKPQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 129AC1C02D2D; Mon, 22 May 2023 07:55:18 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.39.192.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18E20C54184; Mon, 22 May 2023 07:55:14 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20230520-sekunde-vorteil-f2d588e40b68@brauner> References: <20230520-sekunde-vorteil-f2d588e40b68@brauner> <20230520000049.2226926-1-dhowells@redhat.com> <20230520000049.2226926-4-dhowells@redhat.com> To: Christian Brauner Cc: dhowells@redhat.com, Jens Axboe , Al Viro , Christoph Hellwig , Matthew Wilcox , Jan Kara , Jeff Layton , David Hildenbrand , Jason Gunthorpe , Logan Gunthorpe , Hillf Danton , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Christoph Hellwig , Steve French , linux-cifs@vger.kernel.org Subject: Re: [PATCH v21 03/30] splice: Rename direct_splice_read() to copy_splice_read() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2468126.1684742114.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Mon, 22 May 2023 08:55:14 +0100 Message-ID: <2468127.1684742114@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 2333B40014 X-Stat-Signature: s6961nm73ryydax1uq4yz75jbf9ozo5c X-HE-Tag: 1684742122-273284 X-HE-Meta: U2FsdGVkX1+K930A//1OXI4NUXLdbnZbThFF2Tv1tR+BOrBlGrcOIvSPesmlyfQTDNbUgYvldKkS4LxUV/kFg+ABOzlNFpzSjb2/pWabTyDVruCbfhUMJ21+cupccDvYl00mXh4aRDMGA7CDffUknE0bF5FOQPZONmmoSHieXAOpOFXX5z0lFZpVAJACBt7rto0Z/xDEEfOdDEZNGDi9qRoyJEn2rEQjF2dXbZ73M2Xk0mkgIcX2atEFBNgVKP9j5GpjqpsctTB69Ve7BNDKtnYgIVmgzs+NTuGb9dULAzOUoZjmXKRaPe9mN37t+mCePmbd9gnrv8kOi+Dyp/CEggPGTReD/XROuFRUGEr8+CuK96uGjlerT0onOczL2VbuJv2fxeBQQsU/DryQxz5QxkfaOubKWaXxeUtCC2lJ6J2yca3QygQGUCJ5iL0Lx83vjjeCkQk90Zu7o2UC/u+hLwJyWUV/N4ZORdfkYOZUsPEEOieXgMFrHNbejuOEB6re/FnlKpqym5Qk0K4VxC4EfdhSjXYgf7bHkYQvxEBWLZkvIe8A/h51KM5Xo/x5Xf0Ks2lJcthQ9k8GjEFRdRahb/Sm96UMITPGB8IIxUwTah710aTSJgap4k6v1NXNdrx+AuBmaBHs7eljplVyhRs4K09Bovl1/+LaMQKArDkiz1DcFIHAU5ZT0YQBaiYSrNWvGRQjbQscrS0a5vDNjhDQljixGFMqJ4lHxh9iXaQ9CIq4H59+RlPIW+aYdbr/J0yKegiiB8TVSejMBenqLbG/7iSEw+Utl2raEnqaCdB1MH7AtWVzy3RLB8kvuxGNzEagxVu5MZdcNu5JsDLP1zolw0E2W7PNZg8xF6/u6VHPBL7XFqRN66On4gp0hzm98o+5YRp/IOeAnHN3zEgooeLigHQbp8xtPjrJjC1E8yaK/2YxMat4WNhCDJ65oXGLssELJDqJxJPTTd59ityAk2+ 1ttC2v4v tSm0qWOu1rbm0UyEHpkQEMmLhmVG5JV7xDbrCKOaP9pBDTp9BC6ayi7fkfOVNb4EdtXXi+4z0m3LX6kVOEZb5AmP8jVY0HJRn12HS2vIJE1tcF0FQzLI+m0/+Ki5MtS4e5iPOhG/26Mv1CawitqnvWeKqncti/17Z1YdQ4aDCSrrKJVuv58wJOrUdE30ok+dA0Cm92DHt4N1JeVpqJ4YeoLAFDl1LClLK+dG7PlAHqSe3b7xUzdEoAJe5E8ddkFAlDIsinxMFzil/4ZPYqW2OBGy2d9BvFCzZycSkp7REaXvoHr0jQIkCXilergQbRsAzK0uOtOSvZxBkG4vLv704oju3lRzVHvobJh9RV0R2EiYTLllg2Y3AGUSNcf6YKqATwXcbdjxWZ+SajFQsuTm5/ZHRhOM/tInoPSKigIExt8sHBw4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > For the future it'd be nice if exported functions would always get > proper kernel doc, Something like the attached? David --- commit 0362042ba0751fc5457b0548fb9006f9d7dfbeca Author: David Howells Date: Mon May 22 08:34:24 2023 +0100 splice: kdoc for filemap_splice_read() and copy_splice_read() = Provide kerneldoc comments for filemap_splice_read() and copy_splice_read(). = Signed-off-by: David Howells cc: Christian Brauner cc: Christoph Hellwig cc: Jens Axboe cc: Steve French cc: Al Viro cc: linux-mm@kvack.org cc: linux-block@vger.kernel.org cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org diff --git a/fs/splice.c b/fs/splice.c index 9be4cb3b9879..5292a8fa929d 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -299,8 +299,25 @@ void splice_shrink_spd(struct splice_pipe_desc *spd) kfree(spd->partial); } = -/* - * Copy data from a file into pages and then splice those into the output= pipe. +/** + * copy_splice_read - Copy data from a file and splice the copy into a p= ipe + * @in: The file to read from + * @ppos: Pointer to the file position to read from + * @pipe: The pipe to splice into + * @len: The amount to splice + * @flags: The SPLICE_F_* flags + * + * This function allocates a bunch of pages sufficient to hold the reques= ted + * amount of data (but limited by the remaining pipe capacity), passes it= to + * the file's ->read_iter() to read into and then splices the used pages = into + * the pipe. + * + * On success, the number of bytes read will be returned and *@ppos will = be + * updated if appropriate; 0 will be returned if there is no more data to= be + * read; -EAGAIN will be returned if the pipe had no space, and some othe= r + * negative error code will be returned on error. A short read may occur= if + * the pipe has insufficient space, we reach the end of the data or we hi= t a + * hole. */ ssize_t copy_splice_read(struct file *in, loff_t *ppos, struct pipe_inode_info *pipe, diff --git a/mm/filemap.c b/mm/filemap.c index 603b562d69b1..1f235a6430fd 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2871,9 +2871,24 @@ size_t splice_folio_into_pipe(struct pipe_inode_inf= o *pipe, return spliced; } = -/* - * Splice folios from the pagecache of a buffered (ie. non-O_DIRECT) file= into - * a pipe. +/** + * filemap_splice_read - Splice data from a file's pagecache into a pipe + * @in: The file to read from + * @ppos: Pointer to the file position to read from + * @pipe: The pipe to splice into + * @len: The amount to splice + * @flags: The SPLICE_F_* flags + * + * This function gets folios from a file's pagecache and splices them int= o the + * pipe. Readahead will be called as necessary to fill more folios. Thi= s may + * be used for blockdevs also. + * + * On success, the number of bytes read will be returned and *@ppos will = be + * updated if appropriate; 0 will be returned if there is no more data to= be + * read; -EAGAIN will be returned if the pipe had no space, and some othe= r + * negative error code will be returned on error. A short read may occur= if + * the pipe has insufficient space, we reach the end of the data or we hi= t a + * hole. */ ssize_t filemap_splice_read(struct file *in, loff_t *ppos, struct pipe_inode_info *pipe,