From patchwork Mon May 22 13:49:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13250583 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 A826EC77B75 for ; Mon, 22 May 2023 13:50:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47E4F280001; Mon, 22 May 2023 09:50:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 42EA6900002; Mon, 22 May 2023 09:50:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F6FB280001; Mon, 22 May 2023 09:50:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1D123900002 for ; Mon, 22 May 2023 09:50:49 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id EE9B21C6FA6 for ; Mon, 22 May 2023 13:50:48 +0000 (UTC) X-FDA: 80818026576.28.D7BA609 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf07.hostedemail.com (Postfix) with ESMTP id 1C51840019 for ; Mon, 22 May 2023 13:50:44 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UOPa6WCG; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf07.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.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=1684763446; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IqkXhDjcGTp5qgC2QwXKM8JLGfM3IWsybre/9cqiJ5w=; b=nA2+F0yKDE/GkNz5+9dlwAFLA6mERgqNJoLmA6VvUtOqRdqpXcPLCtrqMeNmzUYCyOMzyv e0fYR2f1Mt8H11sgHQ3a9vBOcoLbHeCfpqhyWvGlUZ1+EnTlkjLpArsftlan2+oTbqs9eg 3AWuy13ui4tiiKPQuDQ9Jaza/ct1duQ= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UOPa6WCG; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf07.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684763446; a=rsa-sha256; cv=none; b=dj/tGjApToTf3shxxZ8Zcml+jOVos1F2MAMvfySNI2fAKgH9qEpocMuMODR78Cq7/Dl40A JlacsnhIUvWbD0w3M6OnCTiw4KFVRRaSDtY/RM4iDyJBx5XDHug5BPwV4pv4jrxaH/0bem vEB3aYwOfqJ0/e25Z8jEwl+ZcNxnwjc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684763444; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IqkXhDjcGTp5qgC2QwXKM8JLGfM3IWsybre/9cqiJ5w=; b=UOPa6WCGKsICfK4xajaNPVhgj1XfQya/cNfqkodrf7+3fiBUMmQCiBxN8525IUpLGvsO7S Sqg+IQ7+Z9iKI0gPkkG/84O+ctWRujOXlzZ71bxTvin00oBayXfmFj1vqphgwC5nwZBc92 pgZGi+oqaVsvXNxmzUUi9peN82YzEDw= 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-383-QM4O9WzdNfyEMQKKRbb3Hw-1; Mon, 22 May 2023 09:50:40 -0400 X-MC-Unique: QM4O9WzdNfyEMQKKRbb3Hw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 695863C025AD; Mon, 22 May 2023 13:50:37 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.39.192.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 88BEA2166B25; Mon, 22 May 2023 13:50:34 +0000 (UTC) From: David Howells To: Jens Axboe , Al Viro , Christoph Hellwig Cc: David Howells , Matthew Wilcox , Jan Kara , Jeff Layton , David Hildenbrand , Jason Gunthorpe , Logan Gunthorpe , Hillf Danton , Christian Brauner , 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: [PATCH v22 03/31] splice: Rename direct_splice_read() to copy_splice_read() Date: Mon, 22 May 2023 14:49:50 +0100 Message-Id: <20230522135018.2742245-4-dhowells@redhat.com> In-Reply-To: <20230522135018.2742245-1-dhowells@redhat.com> References: <20230522135018.2742245-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Rspamd-Queue-Id: 1C51840019 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 7c4e3t4m9t8ggmtoayxwymd7n4d4p41u X-HE-Tag: 1684763444-905129 X-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EzPiU5rKW6zaBYkhdblqnKADWazPwVzvvjHBjgV80GUBP/uukceL+9BQbvn13fMUPNOQn9rJMo6Y4SfXBrar0JL48yxoNYOBPcJSW5rMTm78KkkY50/NMnnMwlnlmDASl3YTc6RJ1HasFhWYvz+DV60XE7n+Uaki3XfGlFgVqlRQYUcQB19XH7adSiTP7H1pr5oYqR56NhRqIIQYzJOIcTOunjuzy9NF5WGZhXkFyBwIzU8oKTDeXi+35Gn5YHARW04FQzwAI2+9uc/ZpBOywebWzifwVPfEPWzP9AIuAIc3Bt4jRbQBsj2yX9DBFARNlN5AhN+egW4mSrNmm8mGClNnvAyvGRryeRQ9SCKgMxo11qPM41z0YA= 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: Rename direct_splice_read() to copy_splice_read() to better reflect as to what it does. Suggested-by: Christoph Hellwig Signed-off-by: David Howells Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner cc: Steve French cc: Jens Axboe cc: Al Viro cc: linux-cifs@vger.kernel.org cc: linux-mm@kvack.org cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org --- Notes: ver #21) - Rename direct_splice_read() to copy_splice_read(). fs/cifs/cifsfs.c | 4 ++-- fs/cifs/file.c | 2 +- fs/splice.c | 11 +++++------ include/linux/fs.h | 6 +++--- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 43a4d8603db3..fa2477bbcc86 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -1416,7 +1416,7 @@ const struct file_operations cifs_file_direct_ops = { .fsync = cifs_fsync, .flush = cifs_flush, .mmap = cifs_file_mmap, - .splice_read = direct_splice_read, + .splice_read = copy_splice_read, .splice_write = iter_file_splice_write, .unlocked_ioctl = cifs_ioctl, .copy_file_range = cifs_copy_file_range, @@ -1470,7 +1470,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = { .fsync = cifs_fsync, .flush = cifs_flush, .mmap = cifs_file_mmap, - .splice_read = direct_splice_read, + .splice_read = copy_splice_read, .splice_write = iter_file_splice_write, .unlocked_ioctl = cifs_ioctl, .copy_file_range = cifs_copy_file_range, diff --git a/fs/cifs/file.c b/fs/cifs/file.c index c5fcefdfd797..023496207c18 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -5091,6 +5091,6 @@ ssize_t cifs_splice_read(struct file *in, loff_t *ppos, if (unlikely(!len)) return 0; if (in->f_flags & O_DIRECT) - return direct_splice_read(in, ppos, pipe, len, flags); + return copy_splice_read(in, ppos, pipe, len, flags); return filemap_splice_read(in, ppos, pipe, len, flags); } diff --git a/fs/splice.c b/fs/splice.c index 3e06611d19ae..2478e065bc53 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -300,12 +300,11 @@ void splice_shrink_spd(struct splice_pipe_desc *spd) } /* - * Splice data from an O_DIRECT file into pages and then add them to the output - * pipe. + * Copy data from a file into pages and then splice those into the output pipe. */ -ssize_t direct_splice_read(struct file *in, loff_t *ppos, - struct pipe_inode_info *pipe, - size_t len, unsigned int flags) +ssize_t copy_splice_read(struct file *in, loff_t *ppos, + struct pipe_inode_info *pipe, + size_t len, unsigned int flags) { struct iov_iter to; struct bio_vec *bv; @@ -390,7 +389,7 @@ ssize_t direct_splice_read(struct file *in, loff_t *ppos, kfree(bv); return ret; } -EXPORT_SYMBOL(direct_splice_read); +EXPORT_SYMBOL(copy_splice_read); /** * generic_file_splice_read - splice data from file to a pipe diff --git a/include/linux/fs.h b/include/linux/fs.h index 21a981680856..e3c22efa413e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2752,9 +2752,9 @@ ssize_t vfs_iocb_iter_write(struct file *file, struct kiocb *iocb, ssize_t filemap_splice_read(struct file *in, loff_t *ppos, struct pipe_inode_info *pipe, size_t len, unsigned int flags); -ssize_t direct_splice_read(struct file *in, loff_t *ppos, - struct pipe_inode_info *pipe, - size_t len, unsigned int flags); +ssize_t copy_splice_read(struct file *in, loff_t *ppos, + struct pipe_inode_info *pipe, + size_t len, unsigned int flags); extern ssize_t generic_file_splice_read(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); extern ssize_t iter_file_splice_write(struct pipe_inode_info *,