From patchwork Fri May 19 07:40:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13247765 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 8F4A9C7EE2A for ; Fri, 19 May 2023 07:41:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 28441900010; Fri, 19 May 2023 03:41:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 20E60900003; Fri, 19 May 2023 03:41:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01163900010; Fri, 19 May 2023 03:41:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E72B7900003 for ; Fri, 19 May 2023 03:41:45 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B742E120683 for ; Fri, 19 May 2023 07:41:45 +0000 (UTC) X-FDA: 80806210170.11.87CC9EF Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf06.hostedemail.com (Postfix) with ESMTP id 70306180005 for ; Fri, 19 May 2023 07:41:42 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UjgRJ0Le; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf06.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=1684482102; 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=ronE9gr+sRXtILb6fInqA45jNbZvtaGttVkSNNlZgW8=; b=QvHNEstWYkoIr9vmaPhZhNvCN+ovWM3E2ByoMoQaVIvx0+sNW5/CGh3tCGOtU9KfeknR9C 910Ki5EpfWC/7pSOQvIh5C392V/f4j0H2m92zswDshDbOIjQFlVeUscrLH9vws1EtRoha0 dtsOAnKSAVHsmIQYMkPGm7PRarwQ9io= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UjgRJ0Le; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf06.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=1684482102; a=rsa-sha256; cv=none; b=Cz8OIBHGDbNPZBXbduUtXG+fDhu5fdOkB+q+EllQsNeJI4WrsaauHWEmZXARB1XFLwx5K+ UUHa9iacbvCTVLj2Lim0ZrFdkSNWHYtPFMzx138IaOxQTxCMDUPMGdpbnjA2quOvLt+pT+ K2hkvVZENjKvSbnIYrtYDRmUDYMifcY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684482101; 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=ronE9gr+sRXtILb6fInqA45jNbZvtaGttVkSNNlZgW8=; b=UjgRJ0LeK/qsAUp6X1o/IDJbDD8ZC616UKIcLlXTsHSK/RegjmuwIFH0v+HiO88Px52G2T 21XVii48iv1vLuWi4QSIE64TJwg1cAsYLUC8CcW+BurYNGYBqxLmeYzLAhQ+ExN+R0+lXF bObd0ihqR1QjT6ws8LVcx8HWYAW35NQ= 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-274-frHc13ceOAyBYDJKrmNfcw-1; Fri, 19 May 2023 03:41:37 -0400 X-MC-Unique: frHc13ceOAyBYDJKrmNfcw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 39B0C80120A; Fri, 19 May 2023 07:41:36 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id A860140CFD45; Fri, 19 May 2023 07:41:33 +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, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Christoph Hellwig , netdev@vger.kernel.org Subject: [PATCH v20 10/32] net: Make sock_splice_read() use direct_splice_read() by default Date: Fri, 19 May 2023 08:40:25 +0100 Message-Id: <20230519074047.1739879-11-dhowells@redhat.com> In-Reply-To: <20230519074047.1739879-1-dhowells@redhat.com> References: <20230519074047.1739879-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Rspamd-Queue-Id: 70306180005 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: i5yqt6ebn6dhjkpbw9f6watgehn5rera X-HE-Tag: 1684482102-221342 X-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CWLvy85iuisIz7x3R7Pn60lACYP4ESwmCvADIj/BIh3XitWJ1ocLY79qow9bnFR2ow0niQFrPa6Dv9cOb1V54bkFLq+cNvpKley0Ghd6apMXNEvsAv97AOCX20g0uUgy2OsBcRMGWrQPrTiuz5/Zgkszxa1jbddx53OE9C7v8K8XhkTVgt7NPLAaej86ZgVG+x5cF/4aa4936Gm0KQlqnjm8MpyHP3tJA9Iv17waC15qCBHMKBJtiDRXIphDd1dkzv+5C6IaOIfE7szgorNDF+IxyHlzrPnblEM+RKL5NXqySL9Lj7fPoTFVrPn8sYMAriIyg0/J0DSDlgFUh0fLYCqEZB+3sEV/gWSJsM94gk85A8KL2I4xJy 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: Make sock_splice_read() use direct_splice_read() by default as file_splice_read() will return immediately with 0 as a socket has no pagecache and is a zero-size file. Signed-off-by: David Howells cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: netdev@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org --- net/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/socket.c b/net/socket.c index b7e01d0fe082..40b204a47aba 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1093,7 +1093,7 @@ static ssize_t sock_splice_read(struct file *file, loff_t *ppos, struct socket *sock = file->private_data; if (unlikely(!sock->ops->splice_read)) - return generic_file_splice_read(file, ppos, pipe, len, flags); + return direct_splice_read(file, ppos, pipe, len, flags); return sock->ops->splice_read(sock, ppos, pipe, len, flags); }