From patchwork Sat May 20 00:00:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13248984 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 D108DC7EE23 for ; Sat, 20 May 2023 00:01:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AD89E900003; Fri, 19 May 2023 20:01:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A5F15280001; Fri, 19 May 2023 20:01:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 88B13900007; Fri, 19 May 2023 20:01:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 771B3900003 for ; Fri, 19 May 2023 20:01:09 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 270081C7B4E for ; Sat, 20 May 2023 00:01:09 +0000 (UTC) X-FDA: 80808678258.14.9A2F954 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf08.hostedemail.com (Postfix) with ESMTP id 75402160019 for ; Sat, 20 May 2023 00:01:07 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WtvG+3pf; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf08.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=1684540867; 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=f+CzZRPIOEI63Yig5Ocd0qzQo9k6vKIgNZsTOkrOnGQ=; b=6CAs3xM/J6vEmo3XMRxYQTwPJTFYlGwasj1Vc+Zjgj/wAh+I/DDyCrmNpf7sGwshN7ajJ9 R3qhH/hmp2j6sGA22vIKuTCmP8BtAbIkU//YZrZj84APiFw107nlkBwvyS9I9Vb2JUPk3t qkcAwJ58XtJZ+Rj9EAuIR7i/GeJRuW4= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WtvG+3pf; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf08.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=1684540867; a=rsa-sha256; cv=none; b=BV70Uh5SRASUBuRbvCt9KEIUCc2uDnn8L1tbD+2BtgbUR+mVVTMEgd/rWPDo3pD4v8OEzk 5NGlZjR2BNpMPZUD7Inecyp/CDUJsjVi5jiYNZs+Q6Or/EqaHWeD7kwuPLgmp41YUNR+65 kph28GbD+s5+4pVb8+xdVA/MuP32kFQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684540866; 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=f+CzZRPIOEI63Yig5Ocd0qzQo9k6vKIgNZsTOkrOnGQ=; b=WtvG+3pf44siRJcG4gqfF+5jvpTWZAzq4t7bV6QUGmB8J1qukzEnSNhOxBAvJrv6ME1rTZ FWJkM2pq56oHbxaOCxRC7jRkSijtBvIwVwD1lR/mqHxQYYKNAHMHgbBQt+PoijeOc9vlP6 dFbVZXY1wQeGsJ4fEaDNnBayI2HTzu8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-56-YEHt9biKO1iJWTOezthP0Q-1; Fri, 19 May 2023 20:01:03 -0400 X-MC-Unique: YEHt9biKO1iJWTOezthP0Q-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9CA87811E86; Sat, 20 May 2023 00:01:02 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 614E94F2DE6; Sat, 20 May 2023 00:01:00 +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 v21 03/30] splice: Rename direct_splice_read() to copy_splice_read() Date: Sat, 20 May 2023 01:00:22 +0100 Message-Id: <20230520000049.2226926-4-dhowells@redhat.com> In-Reply-To: <20230520000049.2226926-1-dhowells@redhat.com> References: <20230520000049.2226926-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Rspam-User: X-Stat-Signature: ucgbm1zszutdarr93m53urkdtn8bercc X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 75402160019 X-HE-Tag: 1684540867-883761 X-HE-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/3x1NM03SayDuubp8qdoAKFLhwb22kyIy3ulHGcOC7C4d3g4QDwhlr5jNv+Isb3eH5mu8dO/Oz4ahlpxJSB56ILz5AfYw0LWoqakH9wfUXtDOcJ5dZYboXJUYxSakLsJtZVDr84Ry/CiQeMKThlEgnOTnpjD6V4GBJIql3o/B3JhYOPpgs7JW7oXWbN8w+GEi8oihmR+Ggr+JbWJMGJWgOH+7SROxwgeJhnNY1tpXL3NunIeaVW3E6kUGD9elPyDBpFuCA81N+9CnvHVKzbSXOhk/7eiGoTR1c3Sc1E9ob5WeRKKkhsdIvhOmb2IADgy9jNxp7691H6VtYwuVHBE/8DTRkwvFN8FcFrQ2nOUOCSbRtJU= 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 cc: Christoph Hellwig 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 Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner --- 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 *,