Re: [PATCH v2 13/13] mm/gup: move private gup FOLL_ flags to internal.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24.01.23 21:34, Jason Gunthorpe wrote:
Move the flags that should not/are not used outside gup.c and related into
mm/internal.h to discourage driver abuse.

To make this more maintainable going forward compact the two FOLL ranges
with new bit numbers from 0 to 11 and 16 to 21, using shifts so it is
explict.

Switch to an enum so the whole thing is easier to read.

Using a __bitwise type would be even better, but that requires quite some adjustments ...

The primary leftover for FOLL_GET seems to be follow_page(). IIRC, there is only one caller that doesn't pass FOLL_GET (s390). We could either add a new function to "probe" that anything is mapped (IIRC that's the use case), or simply ref+unref.

So we might just be able to make FOLL_GET internal fairly easily, too ...

Anyhow

Acked-by: David Hildenbrand <david@xxxxxxxxxx>


--
Thanks,

David / dhildenb





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux