Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp923085imm; Thu, 13 Sep 2018 09:44:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZNIeeb2CexrQTFaNB4nztEM6J1cNKhKlklwmsf/FAR4xGWtD65Lv9RDtSm0hrNdmab3Zql X-Received: by 2002:a62:54c7:: with SMTP id i190-v6mr8237563pfb.155.1536857079817; Thu, 13 Sep 2018 09:44:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536857079; cv=none; d=google.com; s=arc-20160816; b=Y08QOjkw7iCgF7XIohrr2FpcEiUHILrCiAYjI7XbjReHggGvTTGtEkGHLZcStjb9yo XFAI+NlIjLduZ+JNT+fnB072wNdGjaoSGgUPJjlg13AJUwyaWgtMcHr14j1NVKUz7YFC ba3e4IXE8Mc2nw90BaP7YCepYJ8iTRh6tNTG1bec949Rv6BeJ40igYGb9ZXrQhVOcI3n IYd4TkiYbNFFxjv7SWZQXs8toYudA0l4y15yUOSw1ikRXd8+qduGr8FRclEliUlWW44f rNsmQ9S7j4/FENx82vmqpOJYzl1ohtNNRbjr6ENvX1O7b/CR9ODZ0SR9G1rjcUhiKVpD RmNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=iW/SHZTSr7gGv2AfhcLoYSYAlYTZnC4UlMyDA5tr40A=; b=zWOPPmdt7nriEEdgGuzOg4Gr+2p5tpB2GdUqImLifzpWA/A8X6BfZkx9VC/C3b/Z4L Bip3J/ATncZ0hcLBtJQiWPIP5h+1gHDxfpN+3hsPg+NOVRudFwQvX11314oYtoTHUhzx AYr2gk8Cl5tCb2/+1417XPwPdpgnOTNa2QtKQ+0BA6kJM1NtSBYuR+I62uzeupD7WjBb m8podDk53y2RvpDTsjHZML6cWtg2ZFgB31cK83plrGcBA9IfVWWw1063ikR0tLWi2Amw 9bXXT97cn2c9sfY3EGfo8k3fwrfujjywkz6dHnBnfYG4aKDEgHq4pFIzyfBwxJDTcJNN Wc/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=B9ZpzvhH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l18-v6si4365374pgk.663.2018.09.13.09.44.24; Thu, 13 Sep 2018 09:44:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=B9ZpzvhH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728524AbeIMVyK (ORCPT + 99 others); Thu, 13 Sep 2018 17:54:10 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:50020 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727417AbeIMVyK (ORCPT ); Thu, 13 Sep 2018 17:54:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=iW/SHZTSr7gGv2AfhcLoYSYAlYTZnC4UlMyDA5tr40A=; b=B9ZpzvhHysnpv71M2UKyLfov7 SmG5zzT9vT0od398PSrNnyU3gDJm+/6YV5gmcpvQs//JwnhatllKETM+gBtxKU3U0Kc6QZP5omfzU u2bPclM06MWmBUTHxvHfrO037fLmonqhIEC9ynhmObbvjTYcZvyKCsF0cz1/vpox5yMgk8t0ZzzRL 5bjHMm8i0kkdlGK+GwqHKHq2mG845USlqm+xM5QzCreHCctVySMCGdAemGdsArm+uoXDIZuJ4KCix 8SexCwqT08LbAyp9sNl134CpVQKd0XZZfIkxvjem6v5s0JmTBBwC9q+hRrjjk5iOULqYNmUMKwype 8Ju31Jqmw==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0Uid-00006j-UE; Thu, 13 Sep 2018 16:43:51 +0000 Date: Thu, 13 Sep 2018 09:43:51 -0700 From: Matthew Wilcox To: David Howells Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/10] iov_iter: Add new iters and use with AFS Message-ID: <20180913164351.GC11574@bombadil.infradead.org> References: <20180913161054.GB11574@bombadil.infradead.org> <153685389564.14766.11306559824641824935.stgit@warthog.procyon.org.uk> <17352.1536855503@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17352.1536855503@warthog.procyon.org.uk> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 13, 2018 at 05:18:23PM +0100, David Howells wrote: > Matthew Wilcox wrote: > > > > (5) Add an ITER_DISCARD iterator type. This provides an iterator that > > > simply discards anything written to it. It cannot be used as a data > > > source. > > > > May I suggest an ITER_ZERO iterator type instead? It acts like /dev/zero; > > writes are discarded (as you have here) and reads return zeroes. > > I've wanted such a thing in the past, but got distracted away from > > that project. > > I thought about that, but the zero-filling is not as easy to implement as the > discard side - plus I don't have any use case to test it with. > > Do you have a use case in mind? At the time I did it, it was useful in dax, but I don't know if it is any more. It might serve to replace iov_iter_zero().