On Thu, Sep 13, 2018 at 05:18:23PM +0100, David Howells wrote: > Matthew Wilcox <willy@xxxxxxxxxxxxx> 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().