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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14BF2C433E6 for ; Mon, 18 Jan 2021 19:56:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D069522D08 for ; Mon, 18 Jan 2021 19:56:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437795AbhART4H (ORCPT ); Mon, 18 Jan 2021 14:56:07 -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.