Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2497742pxb; Mon, 18 Jan 2021 21:14:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJweK+31Fm+S95yZVsOWFD8EFJWW/2VM4xU7jymXdEtSrADrlR8mrVS4Glk+pp7C3oSr9lyx X-Received: by 2002:aa7:d919:: with SMTP id a25mr2029999edr.243.1611033255993; Mon, 18 Jan 2021 21:14:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611033255; cv=none; d=google.com; s=arc-20160816; b=RJkkQDdFyq/MUXEDvG0Pyjz0lTRIonS2wNTBu6gPhowrN8BQ/2nUkbtXas3QI1DJoQ oMZCTpeokT8RIMFocy99svfrWfTejAfouw9KiC/rCFfAWBA3almA25gOVPsQ4uYrKI67 q+FSnKWaHj7gg4Xu8iXNw94WuoP4oTZBVajTZ5eRrcrHPM+Kos7QzeqE/k9MiFkTm2WD IIcfCv6nmvbM26+Sd+L3QVNFDYigfwIfq8TByHuchuGdSXiwHwy86hDVf9srbHd3F7lr 1tVv5m+otR5LqrnHExcmPeaGJ9A1J9hcAW3rXZQOMohnxg7Un0wTocvk3EGHaEYl+LP6 ZQiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=mO/OeIPlqdZ+ljMCwIdqlTwqUwPwjOpA79dtKGXnu2A=; b=l/lfTK5zbfyQtise9+g/8fuMNai/Ge1mngQLGJQs1VHGjyHV2uhQxmNwva1OtDx5y+ eIUYj4b5gUp2+0f0Ar7L4Lh+93EheRwMKsE21+YwuhQB7Yk2WsFgo+iJ4lyExrm+A/H9 DBRUViBqQLb2wbN45I9BbUjIO5SoDojzcE48f4HjZPJwZEmiBEnQiC1p36fm8m+vMo2H /sBKwlImvaX//iKp8yDIhCmPRswIap0Zw3M/qqwuPT5gHVpkAMUncw8PKJq2I7G266AH Wbk+jxyM/B8v4qQxCIgmmU1oM8fKbfltm2FbITVegbaVhOgSkVoijtEvW8/xZQZKM0mi YDkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j8si4039374edv.130.2021.01.18.21.13.53; Mon, 18 Jan 2021 21:14:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437778AbhART4F (ORCPT + 99 others); Mon, 18 Jan 2021 14:56:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393997AbhARTyr (ORCPT ); Mon, 18 Jan 2021 14:54:47 -0500 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B655C061573 for ; Mon, 18 Jan 2021 11:54:07 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1l1abA-0036Xa-LY; Mon, 18 Jan 2021 19:54:00 +0000 Date: Mon, 18 Jan 2021 19:54:00 +0000 From: Al Viro To: Linus Torvalds Cc: Al Viro , Christoph Hellwig , Johannes Berg , Oliver Giles , Linux Kernel Mailing List , Greg Kroah-Hartman Subject: Re: Splicing to/from a tty Message-ID: <20210118195400.GC736435@zeniv-ca> References: <20210118085311.GA2735@lst.de> <20210118193457.GA736435@zeniv-ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 18, 2021 at 11:46:42AM -0800, Linus Torvalds wrote: > On Mon, Jan 18, 2021 at 11:35 AM Al Viro wrote: > > > > I'd rather have sendfile(2) do what splice(2) does and handle pipes > > directly. Let me take a look,,, > > It's not technically just the sendfile() thing. Some things do > sendfile "internally" (ie they use do_splice_direct()). > > Although maybe they always happen just on non-pipe destinations (ie > file-to-file copy). I didn't check. > > But particularly if it can be handled in do_splice_direct(), that > would be a good thing. FWIW, it might make sense to merge do_splice_direct() and do_splice(); interfaces are very similar and do_splice() is basically if both are pipes .... else if input is pipe .... else if output is pipe .... else return -EINVAL with do_splice_direct() being fairly close to the missing case.