Re: [PATCH v5 3/9] iov_iter: Use IOCB/IOMAP_WRITE if available rather than iterator direction
From: Christoph Hellwig
Date: Fri Jan 13 2023 - 00:31:46 EST
On Thu, Jan 12, 2023 at 05:37:26PM +0000, Al Viro wrote:
> I have no problem with getting rid of iov_iter_rw(), but I would really like to
> keep ->data_source. If nothing else, any place getting direction wrong is
> a trouble waiting to happen - something that is currently dealing only with
> iovec and bvec might be given e.g. a pipe.
But the calling code knows the direction, in fact it is generally
encoded in the actual operation we do on the iov_iter. The only
exception is iov_iter_get_pages and friends. So I'd much rather pass
make the lass operation that does not explicitly encode a direction
explicit rather than carrying this duplicate information.
The direction of the iov_iter has been a major source of confusing,
and getting rid of it removes that confusion.