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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E478C7EE26 for ; Mon, 22 May 2023 07:57:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230042AbjEVH5P (ORCPT ); Mon, 22 May 2023 03:57:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229996AbjEVH4m (ORCPT ); Mon, 22 May 2023 03:56:42 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 146E7BF for ; Mon, 22 May 2023 00:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684742123; 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=cyj+TIQeAsw2R5WfDV7uTV2pdiVZWfSmwgvoemsnNzgrHxvZvY6L66DwlYwoBcfy5R82qf W/mWZo+lHAIyHgyM7aIiq+uG3j0cTdfx3oeJa2ZT9zgxtPO1fHxDKmK8Yq3kjTvca3ZvDS SRbojQvCIOi46vZYksZ6LGz5GLDG+YQ= 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 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org > 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,