Re: [PATCH v6 03/34] iov_iter: Pass I/O direction into iov_iter_get_pages*()

From: Christoph Hellwig
Date: Tue Jan 17 2023 - 03:10:09 EST


On Tue, Jan 17, 2023 at 09:07:48AM +0100, David Hildenbrand wrote:
> Agreed. What I understand, David considers that confusing when considering
> the I/O side of things.
>
> I recall that there is
>
> DMA_BIDIRECTIONAL -> FOLL_WRITE
> DMA_TO_DEVICE -> !FOLL_WRITE
> DMA_FROM_DEVICE -> FOLL_WRITE
>
> that used different defines for a different API. Such terminology would be
> easier to get ... but then, again, not sure if we really need acronyms here.
>
> We're pinning pages and FOLL_WRITE defines how we (pinning the page) are
> going to access these pages: R/O or R/W. So the read vs. write is never from
> the POC of the device (DMA read will write to the page).

Yes. Maybe the name could be a little more verboe, FOLL_MEM_WRITE or
FOLL_WRITE_TO_MEM. But I'd really prefer any renaming to be split from
logic changes.