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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 383F6C43217 for ; Tue, 8 Nov 2022 08:30:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230154AbiKHIaw (ORCPT ); Tue, 8 Nov 2022 03:30:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233453AbiKHIas (ORCPT ); Tue, 8 Nov 2022 03:30:48 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A05F2791E for ; Tue, 8 Nov 2022 00:29:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667896186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lRojnfWUfsm0W6BCKt9OPdRubDtRX5uWnsoCtEuq6co=; b=N1/NSWHOnisRJBYRxR7NCre7Lg/3qthtP0GtT7frpcbrSLVatfJwZHyuiGvHCnfGsQlpCv wXW/udAF3v9NKxqqChcgvjtJXuIa1ULA++mvB18Xrcldfgr7YNBItvPnxD37hWX9Q3hVpb jW+MyQK/SXjOJFSiXFBf9Hqf2DxHZe0= 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-150-sZtXfLYaMcOmamX5MVNXpw-1; Tue, 08 Nov 2022 03:29:43 -0500 X-MC-Unique: sZtXfLYaMcOmamX5MVNXpw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D28ED101A52A; Tue, 8 Nov 2022 08:29:42 +0000 (UTC) Received: from T590 (ovpn-8-32.pek2.redhat.com [10.72.8.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A813440C94AA; Tue, 8 Nov 2022 08:29:30 +0000 (UTC) Date: Tue, 8 Nov 2022 16:29:24 +0800 From: Ming Lei To: Christoph Hellwig Cc: Jens Axboe , io-uring@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Miklos Szeredi , Stefan Hajnoczi , ZiyangZhang Subject: Re: [RFC PATCH 3/4] io_uring/splice: support splice from ->splice_read to ->splice_read Message-ID: References: <20221103085004.1029763-1-ming.lei@redhat.com> <20221103085004.1029763-4-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Nov 07, 2022 at 11:45:06PM -0800, Christoph Hellwig wrote: > On Thu, Nov 03, 2022 at 04:50:03PM +0800, Ming Lei wrote: > > The 1st ->splice_read produces buffer to the pipe of > > current->splice_pipe, and the 2nd ->splice_read consumes the buffer > > in this pipe. > > This looks really ugly. I think you want Linus and Al to look over > it at very least. OK, I will Cc Linus and Al in V2. It is just another case of pipe's producer/consumer model, IMO. > > Also, what is going to happen if your ->splice_read instance does not > support the flag to magically do something entirely different? If the ->splice_read() instance doesn't support this feature, then the new added pipe flag won't be set, this API will return -EINVAL. thanks, Ming