Re: [PATCH v8 02/10] iov_iter: Add a function to extract a page list from an iterator

From: David Hildenbrand
Date: Tue Jan 24 2023 - 09:53:50 EST


On 24.01.23 15:45, David Howells wrote:
David Hildenbrand <david@xxxxxxxxxx> wrote:

At least reduces the occurrences of FOLL_PIN :)

I don't see where the problem is in letting people supply FOLL_PIN or
FOLL_GET. Why even have pin_user_pages() and get_user_pages() since they end
up at the same place. They should be inline wrappers, if separate functions
at all.

There once was a proposed goal of restricting FOLL_GET to core-mm and allowing other drivers etc. to only use FOLL_PIN. Providing pin_user_pages() and the corresponding unpin part seemed very clean to me.

To me that makes perfect sense and will prevent any misuse once we converted everything relevant to FOLL_PIN.


To be precise, I think we could get away in this patch set by not using FOLL_PIN and FOLL_GET and it wouldn't really reduce readability of the code ...

--
Thanks,

David / dhildenb